Blog
AI agents coding all night: our unattended pipeline and its 5 guardrails
We write an issue, label it, and go to sleep. In the morning there is a pull request with every check green and two reviews behind it. Getting AI to write code is easy; keeping it out of trouble when nobody is watching is the hard part. Here is how the pipeline works, and the incident behind each of its five guardrails.
One scheduler, four sub-agents
The scheduler loops and guards; a coordinator divides the work; only one agent writes product code.
It started simply: a laptop and a long-running program as the orchestrator. The first gap was the laptop itself. When it slept, the orchestrator slept, and “it runs overnight” quietly stopped being true. The orchestrator now keeps the machine awake while it works.
Each round, the scheduler takes the lowest-numbered ready issue whose dependencies are closed, opens a branch, and hands it to an AI coordinator. The coordinator calls four sub-agents in turn:
- The locator finds the relevant code. It only reads, on the lightest model.
- The implementer changes the code and writes unit tests.
- The verifier gets only the issue’s acceptance criteria, never the implementer’s notes, and writes its own end-to-end tests.
- The reviewer checks the change against the product’s hard rules: payments, privacy, copy, and any test that was loosened.
Hiding the implementer’s notes from the verifier is the key choice. An implementer tests what it built; a verifier that never saw the notes tests what was asked for. After that, a model from a different vendor reviews the code, because a model that reviews its own work shares its own blind spots.
So when the agent says “done”, why believe it?
Guardrail 1: the sign-off lives on the commit
You don’t. A change is done when the full checks pass on that exact commit, whatever the agent says.
In late September, GitHub Actions burned 788 minutes in a single day, and the next day the quota was gone. We moved testing back to our own machine, and with it lost the rule that only tested code deploys. So the local check now writes a sign-off status onto the commit itself, and production refuses to deploy a commit without one.
A pull request is green only with both the deploy check and that sign-off. An exit code alone is not enough: a failed check writes no sign-off at all, and some tools read a missing status as success. Branches that touch CI, deployment config or the sign-off script itself are stopped before push, because a weakened sign-off script would prove nothing.
Whether it passed is what the sign-off guarantees.
Guardrail 2: when the environment breaks, pause
A broken environment is not a failed issue, so the scheduler stops and waits for a person.
On 20 November the network dropped. The scheduler took an empty log and asked the agent to fix a failure that did not exist. After it paused, it still ran one more verification round and called the agent again. Now an unreachable package registry, an expired login or a dead network pauses the whole scheduler, and no issue is marked as failed for it.
Guardrail 3: trust live state, not a search index
Every decision that matters reads the issue’s live state, because search indexes lag.
On 1 November one issue was blocked and sent back for a human decision. A few seconds later the scheduler listed issues by label, still saw the old label in the search index, and put it back in the queue. The same issue was worked on several times over, leaving the same comment each time. A smaller cousin: checking a label through a pipe that closed early misread it once in 20 runs. Labels are now read in full, from the issue itself.
Guardrail 4: one merge at a time
Two pull requests that pass on their own can still break each other, so merges go one at a time, each after the last deploy succeeded.
On 23 October two pull requests merged 6 seconds apart, and the production gate blocked both deploys. On 3 November two branches merged with no text conflict, yet both had used the same CSS class name, and the layout broke. Only the full local check caught it.
- After green, the scheduler asks once in the terminal. One key merges; a timeout leaves the pull request open.
- Before merging it checks again: up to date with main, signed off, every check passed, and pinned to the exact commit the person saw go green.
- A person may label low-risk issues for automatic merging. They still need no payment-risk label, no protected file, a review from the second vendor’s model, and a successful deploy from the previous merge. If a production deploy fails, the scheduler pauses.
Guardrail 5: a usage gate and a watchdog
The scheduler stops starting new work before it runs out of model capacity, and tells a person when it has been still for too long.
The first usage gate read the wrong field. Its threshold could never trigger, so the scheduler only stopped when it hit the hard limit. It now reads both usage windows, stops starting new features near the limit, and when refused, waits only for the window that refused it. A watchdog sends an alert when nothing has moved for an hour; night-time alerts are held and sent as one morning summary.
The guardrails have tests of their own. Each incident added an offline test: the test runner loads the orchestrator’s offline verification functions directly and checks their decisions without GitHub and without calling a model. Anyone who loosens a guardrail turns a test red.
Every lesson becomes a test that can turn red.
Can your team use it?
This AI development pipeline does not depend on what FacialRate does; it needs requirements that can be written as issues with acceptance criteria. Try it today: pick one small, well-bounded issue, write three acceptance criteria, hand it to an AI coding agent and look at the result the next morning. To build the whole pipeline, talk to us; it is part of our AI engineering work. Or read 5 engineering decisions behind FacialRate first.
Questions
What is an unattended AI development pipeline?
A scheduler that takes ready issues one by one, has AI agents implement, test and review each change, and opens a pull request only when every automated check passes, without a person watching.
How do you stop AI coding agents from breaking things?
Rerun the full checks on the exact commit, keep the verifier away from the implementer’s notes, block changes to CI and deployment files, have a model from another vendor review the code, and merge one change at a time.
Can AI-written pull requests merge automatically?
Only by exception. A person labels low-risk issues, and the merge still requires a sign-off, no protected files, a second-vendor review and a successful previous deploy.
What kind of team can use this?
Any team whose requirements can be written as issues with acceptance criteria and that has automated checks it trusts.