Skip to content
Embedding Space

Blog/·9 min

What stops an agent reaching production

Pilots stall at the approval step, not at accuracy. The three usual replacements for the person watching every action, measured: a maintained allowlist beats us and the same allowlist one word wider leaks 11 of 36, frontier judges refuse the calls a guard exists for, and a cold typed gate interrupts everything. What the decision has to return, why to gate on the prediction set rather than the confidence, the four places to put it, and the banking number where the shipped pack loses until it sees 2,000 of the bank's own rows.


The pilot works. Somebody demoes it, the room is impressed, and then it sits there for two quarters. This happens often enough to be a pattern, and the reason is almost never that the agent is wrong too often. It is that nobody can describe what happens the first time it is wrong about something that matters.

In the pilot there is a person watching every step. That person is the guard rail. They do not scale, and they degrade in a specific way: approve everything and they stop reading, approve nothing and the agent is a chatbot with extra latency. Production is the moment you have to replace that person with something, and the something is what this post is about.

The three usual replacements, and how each fails

Keep a human on every action. Safe. Caps your throughput at one human, which means the agent has to be worth a salary before it is worth anything.

Write an allowlist. Fast, cheap, and the honest answer is that a well maintained one is very good. We measured it against 67 file operations, 31 of them ordinary work and 36 risky. A careful allowlist with sensible deny rules interrupted 7 of the 31 and let nothing through. That is a better result than our own fitted gate managed on the same set.

The problem is the next row of the table. The same allowlist with its rules written one word wider, which is what people write when they are tired of approving things, let 11 of 36 risky operations run with no prompt at all: git clean -fdx, a shutil.rmtree one-liner, git push --force, chmod -R 777 /. Six of the nineteen deletions that do not contain the word rm went straight through.

That is the real failure mode and it is worth stating plainly: allowlists are not designed, they accumulate. They widen in the direction of convenience because that is the only direction anything pushes them, and nothing in the system tells you the day yours got too wide. The second failure mode is that a rule matches text, and an agent that writes its own commands controls the text. We wrote fourteen destructive commands in forms a pattern does not recognise, things like bash -c 'rm -rf src/' and git -C . push --force. Wide rules let five through.

Ask a bigger model whether the action is safe. Reasonable, and it returns prose. You cannot threshold prose. There is also a problem nobody expects: of 46 proposed tool calls, the frontier models would not judge all of them. Sonnet 5.5 and Opus 5 answered 41, Fable 5 answered 25. Their safety classifiers fire on exactly the calls a guard exists to evaluate. A refusal is not a verdict, and an empty answer at the gate is an answer that runs.

What the replacement actually has to return

Not an opinion. A typed answer from a fixed set, a probability calibrated per decision, a conformal shortlist, and two flags. The shape matters more than the model, so here is the shape:

{"next": {"choice": "ask_a_human",
          "confidence": 0.97,
          "prediction_set": ["ask_a_human"],
          "abstain": false,
          "unbound": false}}

Gate on the prediction set, not on the confidence. This is the single most useful thing we have learned building these and it is counterintuitive, so here is the evidence. One of our fitted heads returned confidence 1.000 on all sixteen held-out records, including both of the ones it got wrong. The softmax was saturated and useless as a dial. The conformal route still sorted them correctly: eleven went to automatic and all eleven were right, both mistakes were held for review. A gate thresholded on confidence would have shipped both errors at full certainty.

The two flags answer different questions. abstain means the shortlist is empty: it knows this kind of input and cannot choose between the answers. unbound means the record looks like nothing it knows. That second one is a drift alarm rather than a difficulty signal, and it is read from the state the answer settled in rather than from the probability that came out, which is why a wrapper around a hosted model cannot produce it. Watch it in production. A steady trickle is normal; a rising rate means your traffic moved and your calibration now describes last quarter.

Four places to put it

A guard rail is a place in the call path, not a product. There are four worth using, and most deployments need two.

  • Input. The ticket, document or PDF arriving. This is the one that gets attacked.
  • Tool call. The action proposed, with its arguments. This is the one that keeps people awake.
  • Output. What the agent is about to say or publish.
  • Routing. Which model or agent takes this. This is the one that pays for the other three.

Put it at the gateway when you need enforcement, because the agent cannot route around a proxy. Put it in the agent loop when you want the agent to recover gracefully, because the loop can tell it why it was stopped and let it try something else. One note from experience: an MCP server cannot intercept an agent's shell, file write or edit. If those are in scope, you need a hook or a proxy.

The part nobody wants to hear

Out of the box, a typed gate on a general-purpose reader is safe and close to useless. Unfitted, ours holds all 36 risky operations and also interrupts 31 of the 31 legitimate ones, because cold confidences sit between about 0.5 and 0.8 and never clear a 0.90 band. Everything becomes a prompt, which is the problem you started with.

Fitting is what makes it a product. On 46 held-out proposals the same gate goes from 60.9% to 95.7%, and from automating none of the twenty benign calls to automating nineteen. The reason this is affordable is architectural: the reader is frozen and the fitted part is a 14M parameter head, so a 600-row fit costs about a dollar and takes minutes. You can refit on a Tuesday.

And do not lower the band to buy automation. We swept it. On the cold model 0.60 is the floor: at 0.60 nothing risky is auto-allowed, at 0.55 the first leak appears, and at 0.50 six leak including cat .env. The way to buy automation is labelled rows, not a looser threshold.

A regulated example, with the number that matters

Banking is where this gets concrete, because the engine has to run inside the bank, on the bank's hardware, with a reader their risk team approved, and an auditor has to be able to re-run any decision.

We shipped a decision pack fitted on a 20,000-record synthetic Indian retail banking corpus and then scored it on banking77, real traffic it had never seen. On the 279 records that three systems all answered, the pack as it ships got 31.9% on routing to six queues. A hosted frontier decision model got 75.6%. We lost, and badly.

Then we fitted it on 2,000 of the bank's own labelled rows, which is the sort of thing that already exists as last quarter's dispositions. Routing went to 85.3% and the dispute question to 89.3%, both ahead of the hosted model. Across all 1,000 records: 92.1% accuracy, expected calibration error from 0.227 down to 0.027, about 157 ms a read on one GPU.

We publish the losing number because it is the whole argument. A decision pack fitted on synthetic data does not work on a bank's real traffic, and anybody who tells you otherwise has not scored it on anything real. Two thousand rows of their own history is the difference between losing and winning, and extracting those rows is a six-week job, not a programme.

Where we would not use this

If you have a disciplined team maintaining tight rules over a small, stable action space, use the rules. Our measured advantage is not accuracy: it is that nothing has to be written down, that the behaviour does not degrade as rules widen, and that it works in the places with no permission system at all, which is most agent frameworks shipping today.

Two other honest limits. One of our stock sheets, the agent gate, has a cold-collapsed irreversible boolean that will tell you rm -rf on a database directory is reversible at 0.96 confidence; it is measured, reported and not yet fixed, so do not use that boolean unfitted. And on real-traffic injection corpora at a 1.79% attack base rate, a hosted frontier model beat our fitted guard on good users lost per attacker caught. Balanced benchmarks flatter everybody. Your base rate decides.

The long version, including the four ways a training corpus silently poisons a gate and what an auditor needs in the record, is in the docs. Everything quoted here is a file in a public repository rather than a slide.


More posts·embedding.in