Don't Let the Agent Mark Its Own Homework: Running Engineering With AI Coding Agents

AI coding agents are fast and inconsistent. A case study in giving them the discipline a good engineering team already has - a definition of ready, separate roles for writing and checking, budgets and a person who decides what merges - and what broke along the way.

By Rafal Skucha

On a busy day my ticketing platform starts about 23 tickets and finishes about 17. To do that it runs some 240 agent stages, around 17 hours of agent work. On its busiest day so far it had up to 30 agents working at once. It has also been building itself: its own pipeline wrote 135 of the platform’s 327 commits.

None of that is the interesting part. AI coding agents are fast, and left alone they are inconsistent: they guess at unclear requirements, report tests as passing without running them and stop halfway through. A better prompt does not fix that. What fixes it is the process a good engineering team already follows, written down and enforced. This is a case study of the Agent Ticketing Platform, which Egon Expert Ltd built for its own engineering and now runs across seven projects, including two client platforms. It is how I run delivery, and the decisions in it are the ones I make for clients bringing AI into a development team.

Write the process down before automating it

The platform is an engineering team’s process expressed as code. Every ticket goes through the same stages, each worked by a separate agent with its own instructions:

  1. Completeness: an analyst checks the ticket is clear enough to build.
  2. Context: a scout gathers what the work needs to know about the codebase.
  3. Decomposition: a planner splits the work into chunks that can run in parallel.
  4. Implementation: one agent per chunk writes the code, in its own copy of the repository.
  5. QA: a different agent tests each chunk and sends it back with a finding if it fails.
  6. Assembly, review and integration: the chunks are joined, reviewed as a whole and prepared to merge.

The agents that check work cannot edit files; their editing tools are switched off. A ticket also fixes its process at the moment it is submitted, so changing the flow never breaks work already running.

Most of the effort in this project went into writing the process down, not into the AI. A team whose process lives only in people’s heads has nothing to automate, with or without agents.

A definition of ready that is enforced, not hoped for

Every ticket has to meet a written standard: the end state, acceptance criteria that can be checked by running something, the commands that check them, what is in and out of scope, what must not change and what it depends on. It also has to pass a simple test: could the pipeline do this work without live systems, credentials or a decision nobody has made yet?

Three rules are enforced mechanically, when a ticket is filed and again when it is submitted: acceptance criteria must exist, the description must be long enough to mean something and there must be a command that verifies the work when the project’s own tests are not a real check. The reason is cost. A ticket that obviously falls short should be refused before an agent is paid to find that out.

A ticket stopped at the completeness check with the analyst’s specific questions (demo data)

A ticket that passes the rules but is still unclear stops at the completeness check with specific questions, not a guess. Answering re-runs the check, so an answer is judged rather than taken on trust. About a quarter of tickets (26%) were sent back on their first check. Every one of those would otherwise have been an agent guessing what I meant, with the bill and the rework to match.

Checking is separate from doing

The rule every engineering team learns eventually: the person who wrote the code is not the person who signs it off. Here QA is a different agent from the implementer. When a chunk fails, it goes back with a concrete finding, and the number of attempts is capped, so a ticket that keeps failing stops and waits for a person instead of looping.

A chunk that failed QA with a specific finding and passed on the second attempt (demo data)

The most useful change came from not believing the agents. An agent’s report that the tests pass could be a command left running in the background, a pipe that swallowed the exit code or no test run at all. So after every commit the platform runs the project’s own test command itself and records the result, separating a broken test environment from a failing test. That result goes to QA, the reviewers and the final report as evidence. Of 311 such runs, 78% passed, 14% failed and 7% could not run. Each of the failures is a case where “the tests pass” would otherwise have been taken on trust.

The checking holds up. QA passed 89% of pieces of work first time and sent the rest back; review passed 86% first time. For a second opinion, a project can add another reviewer running on a different family of models, so the two do not share the same blind spots.

Money and time are design inputs

Every stage and every ticket has a budget, and the limits are configurable per project. The defaults are $5 per stage attempt, $25 per ticket including all its chunks and 90 minutes per stage. A run can raise one stage’s cap up to a set ceiling, and a project with bigger tickets can be given a bigger budget. Two details matter more than the numbers. Spend from attempts that failed still counts against the ticket. And a stage stopped by its time limit, which reports no spend at all, is counted at its full cap. That second rule exists because three stages killed at the old 30-minute limit had each recorded $0.00 for up to three hours of work.

A finished ticket costs a median of $6.35, with nine in ten under $17, and takes a median of 50 minutes from start to finish, with nine in ten done within about six hours. A busy day comes to roughly $200. The Claude roles run on a subscription, so those are the costs the tools report at API prices: what the same work would cost on pay-as-you-go keys, not what I am invoiced.

The cheapest lever is choosing the right model for each job. Planning, implementation and security review get the strongest model. Analysis, QA and review get a mid-tier model. Gathering context and writing the report get the cheapest one.

Bring the agents and models you already use

The platform does not call model APIs itself. It runs coding agents that are already installed, Claude Code and OpenCode today, without a screen, one per stage. Each connects through a small adapter with four jobs: name itself, say what it can do, check it is ready to run and run a stage. Adding another coding agent is one more adapter, not a redesign.

Every role has its own provider and model, set in layers: shipped defaults, then environment settings, then per project. Moving the reviewer from a Claude model to an open model is a settings change, and a mistyped setting is caught at start-up rather than an hour into a run. In use today are Anthropic’s models through Claude Code, and models hosted on Ollama Cloud, such as Kimi K3.1 Pro, GLM 5.3 and Mistral Large 4, through OpenCode, with my own model gateway available per project.

The platform holds no model credentials; each tool keeps its own login. So the same pipeline runs on a subscription plan or on pay-as-you-go API keys, and switching between them changes nothing in the platform. Before each stage it checks that the tool can actually run and, when a login has expired, says so and what to do about it. That check exists because an expired login once looked perfectly healthy until a stage failed.

Models are chosen by measurement, not reputation. Seven models were compared over 43 trials before one was picked as the second reviewer, and a popular open model was ruled out because it did not keep to the output format the pipeline needs. When a provider changes its prices or a better model ships, the change is one setting per role, tried on real tickets first. There is no lock-in to a vendor.

What broke

The most useful part of the project is the list of things that went wrong, and none of them is really an AI problem.

  • Finished work was deleted. The agents’ instructions said the platform handled git, but nothing in the platform ever committed. Implementers wrote code they were not allowed to commit, and the clean-up at the end removed it. The platform now commits each stage’s work itself.
  • An agent used the wrong database login. Agents inherited the platform’s whole environment, including its database login. A task one agent ran in another project picked that up and recreated that project’s development database with the platform’s credentials. The platform now strips its own settings and logins from every agent’s environment.
  • The backup had never been restored. The first time anyone tried, it failed. A backup nobody has restored from is a hypothesis; there is now a restore drill against a throwaway database.
  • The documentation oversold the build. One commit is titled “correct docs that oversold the build”. Agents write documentation as fluently as code, and it drifts from the truth just as fast.
  • A free model that hangs costs more than a paid one that answers. A local, free model kept hanging until its timeout, so those roles moved to a hosted one. Metered inference that answers beats free inference that does not.
  • Work started before the work it needed. Tickets began before the changes they depended on had merged, which is why tickets now declare their dependencies.

Every one of these is a failure a fast-growing team has: unclear ownership, too much access, untested recovery, stale documentation, false economies and missing dependencies. Agents make them arrive faster.

Where people stay in the loop

A ticket that has passed every stage, with integration held for a person’s approval (demo data)

The merge is always a person’s decision. The platform never merges into the main branch; I do, after reading what each ticket did and what it cost.

Approval inside the pipeline is optional and set per project. In manual mode every ticket stops for a person before integration. In automatic mode a clean pass goes straight through, and only work that passed with reservations stops and waits. In practice that was about one integration in eight (17 of 133). Oversight is a dial, not a switch: start every project on manual and loosen it once its numbers have earned that. A person also always decides what the ticket is, answers the questions it raises and handles anything that runs out of attempts.

It is worth being clear about the limits. Every agent runs in a sandbox, not as a user on the host machine, and only with the commands its role allows. The platform also treats text from comments as untrusted and fences it off, but that is a precaution, not a claim that prompt injection is solved. For a team, it is the first thing I would keep tightening.

The board across projects: what is running, blocked and waiting for a decision (demo data)

What this means for a team

Take the AI out and every decision here still stands: a definition of ready that refuses vague work, a separate person checking what another wrote, evidence instead of self-report, budgets that count everything and one accountable person at the merge. Agents do not remove the need for that discipline. They punish its absence faster and reward it with throughput no small team could match by hand.

The tools and the evidence behind them are covered in AI-augmented software development: what the evidence shows and in the guide to tooling-assisted development. If you are bringing coding agents into your own team, that is what an AI adoption engagement is for, or book a free 30-minute consultation. Straight conversation, no commitment.

← Back to Blog