Every week someone tells me they built an AI software factory over the weekend and don't need developers anymore.
Before that thing opens a single pull request on code your customers rely on, make sure you've got:
> self-contained tickets with explicit I/O contracts and edge cases, because the agent has zero tribal knowledge
> a gate that bounces vague tickets back to a human before the agent starts guessing
> testable acceptance criteria on every ticket
> a short list of ticket types the factory is allowed to touch, and a much longer list of the ones it can't
> a trigger that won't kick off the same ticket twice if someone drags it to "AI: Ready" and back
> webhook signature verification, so nobody outside your org can trigger a run on your repo
> a fallback poller for the day the webhook silently drops
> a written spec before any code gets written, approved by a real person
> a way to route open questions to a human instead of letting the model wing it
> a build plan laying out the architecture, data changes, and contracts upfront
> a sanity check confirming the spec, plan, and task list actually agree with each other
> big tickets broken down into chunks an agent can finish in a single run
> acceptance criteria that stay attached to the ticket all the way through code review
> documented architecture decisions, so the agent stops trying to relitigate them every run
> a repo that builds cleanly from a fresh checkout, since the agent doesn't have your laptop's local state
> setup steps an agent can execute without pinging someone on Slack
> a queryable code map, so it actually knows what calls the function it's about to change
> your domain rules written down somewhere the agent can read them
> only the slice of the repo the ticket needs, instead of stuffing the whole codebase into every prompt
> a fresh sandbox for every task that gets nuked the second it finishes
> preloaded dependencies, so runs don't burn ten minutes on npm install every time
> parallel sandboxes that don't trample over a single shared test database
> seeded test data in every sandbox, with zero production data copied over
> zero long-lived credentials sitting inside the sandbox
> an outbound network allowlist, so the agent can't install some random package it read about in a GitHub comment
> write access locked to one working branch, with no way to push to main
> zero merge permissions anywhere in the factory
> a retry cap, so a stuck ticket goes back to the board instead of looping all night
> a cap on CI runs per ticket, because CI minutes aren't free
> a hard timeout for the run that decides your entire billing module needs a rewrite
> hard spend caps per run and per day (the review agent we built for a US healthcare data company cuts off at $20 a day)
> a kill switch that halts every active run immediately
> a dry-run mode that does all the work and posts nothing until you give the green light
> a single gateway for all model calls, treating any direct vendor call as a bug
> provider API keys that never leave that gateway
> separate keys per team, service, and agent, each with its own budget
> rate limits so one noisy repo doesn't starve everyone else
> model names living in config, so swapping models doesn't require a code deploy
> a fallback provider for the afternoon your primary one goes down
> a migration plan for when your model gets deprecated
> spend alerts that fire the same day, well before the monthly invoice lands
> cost tracked per merged PR, not just raw token counts
> customer and patient data stripped out of any ticket or comment the agent reads
> a signed BAA with your model provider before any ticket touching patient data goes near it
> code and data staying inside your own cloud if your customer contracts require it
> secrets scrubbed from prompts, traces, and PR comments
> code-level blocks preventing the agent from even opening secret files
> a secrets scan running on every single diff
> prompt injection defenses on every ticket, comment, and README, so a malicious README can't tell the agent to drop a table
> a check verifying that every new package actually exists and isn't a typosquat
> dependency scanning on every pull request
> a guard against deleted tests, because an agent that can't fix a failing test will sometimes just delete it
> protected files that require human sign-off: CI config, auth, migrations, and the factory's own settings
> least-privilege tokens for your issue tracker, repo, and CI
> strict tenant isolation, so one client's code never leaks into another client's context
> a full audit trail of what the agent read, what it changed, and who signed off
> a real answer for customer security questionnaires asking exactly what the AI can access
> an incident plan for the day a tracker token leaks
> linting, type-checking, and tests running as plain code before any model reviews a line
> CI acting as the judge, never trusting the agent's own claim that "all tests pass"
> tests written from the acceptance criteria, not generated from the agent's own code, so it isn't grading its own homework
> a review agent forced to quote the exact line it's flagging, or the comment gets dropped
> deterministic rules around the model written as unit-testable code
> a cap of five review comments, security first and style last, because nobody is reading forty
> memory of past dismissals, so a finding an engineer already rejected doesn't pop right back up on the next PR
> pull requests small enough for a human to review before lunch
> draft pull requests by default
> autonomy earned repo by repo based on your own metrics, where a single revert knocks it back down a tier
> first-pass CI rate, merged-unchanged rate, and revert rate tracked for every repo
> prompts stored in git and reviewed like production code
> a golden set of tickets with known answers, rerun whenever you tweak a model, prompt, or tool
> an eval suite that blocks the change if even one case fails
> evals specifically testing the ugly stuff: patient data in logs, committed .env files, delete-only diffs, prompt injections
> evals written by your own engineers, rather than a vendor's cherry-picked demo set
> a prompt version stamped on every run, so you can trace which one opened the bad PR
> a playbook for the Thursday your model provider ships a silent update and your eval scores tank
> full traces of every model call: prompt, output, tokens, latency, and cost
> self-hosted traces, because those prompts contain your source code
> one unbroken chain linking session, branch, commit, PR, ticket, and epic
> logs that never capture secrets, tokens, or patient data
> run history stored in a real database, not inside an agent's memory
> checkpoints so a crashed run picks up where it left off instead of starting over and billing you twice
> alerts when the queue backs up, before product asks why nothing shipped
> cycle time pulled straight from that chain, not from developer surveys
> reporting rolled up by team and feature, with zero individual developer leaderboards
> config-driven adapters for your tracker, git host, and CI
> a plan for when your issue tracker changes its API
> review comments posted right in the PR tool your engineers already live in, instead of some separate dashboard nobody opens
> a way to kill a run directly from the ticket
> your existing CI/CD handling deploys, keeping your release rules intact
> a clear policy for the Claude Code, Cursor, and Codex seats your engineers are already using
> seat telemetry that tracks usage without ever logging prompts or code
> device management on every laptop that has agent access to your repos
> the entire factory running on infrastructure you actually own
> a straight answer to "does this keep working if we stop paying the vendor tomorrow?"
> the factory's own infrastructure managed as code
> separate dev, staging, and prod environments for the factory itself
> unit tests for the factory that run without a model or a database
> contract tests covering every adapter
> a deploy pipeline for the factory with the exact same gates as your core product
> prompt rollbacks that are just as fast as code rollbacks
> an on-call rotation for the factory, with someone who actually answers the page
> runbooks for the morning the factory opens 40 pull requests overnight
> postmortems that fix the factory itself, not just the broken code it shipped
> a changelog for the factory so engineers know why it started behaving differently on Tuesday
> real documentation your team can read before they're asked to trust it
> a reviewer rotation so the same two senior engineers don't burn out reading every agent PR
> a weekly tally of how many hours your senior engineers are spending on reviews
> a human approving every single merge, every time
> a clear owner who holds the budget and actually reads the bill
> every key, repo, and account under the company's name, not tied to whoever hacked together the weekend prototype
> a bus factor higher than one
Oh, and on top of keeping all of that alive every day, forever, your weekend software factory is still going to need people who actually know what they're doing:
> writing the spec the agent builds from (a product owner who knows the domain)
> signing off on the plan before a line of code exists (a senior engineer)
> reading every pull request before it merges (a senior engineer, again)
> deciding which tickets the factory is never allowed to touch (a tech lead)
> keeping the architecture from turning into spaghetti while agents keep adding to it (an architect)
> writing the test cases the factory gets graded on (QA)
> running the gateway, sandboxes, and cloud bill (a platform engineer)
> rerunning evals every time a model changes (an AI engineer)
> walking an auditor through what the agent read and what it changed (security and compliance)
> explaining to the CFO why the token bill doubled in March (an engineering manager)
> answering the 3 a.m. page when an agent-written change breaks checkout (whoever's on call)
> debugging the code when the agent that wrote it gets stuck (a senior engineer)
> remembering why the factory was built this way a year from now (someone who was actually there)
Wishing them the best π«‘