Skip to content
Beta
All articles

Policy gates for coding agents: why rule wording matters more than the model

A study of 22 decision models as runtime policy checks for coding agents found examples and counterexamples cut false alarms. What it shows and its limits.

By The SpanDock team

5 min read

A bar chart for one model in the paper: hazards caught rise from 89.3 to 98.2 per cent and harmless actions interrupted fall from 30.6 to 4.8 per cent when rules include examples and counterexamples

A coding agent that asks permission for everything gets switched off. One that asks for nothing is a liability. Runtime policy checks, where a fast classifier scores each proposed tool call against rules such as "permanently deletes data" or "reads credential material", are one answer. A paper posted to arXiv on 1 November 2026 tested 22 hosted "decision models" in that role. Its most useful finding is not which model won. It is that how the rules were written changed both detection and false alarms more than most model choices did.

What was tested

The author, James P. Beno of Agent Approve, built the study to choose a classifier for his company's own policy engine, which the paper says is in beta. That context matters, and the paper is open about it.

The setup:

  • Decision models. These are classifiers that take a structured input and a set of typed questions and return a probability per question, without generating text. The paper evaluates 22 of them from 15 vendors, plus two prompted general-purpose models as a baseline.
  • Data. A synthetic dataset of 2,643 tool calls, grouped into 106 families such as cleaning up a repository, deploying to production or messaging a colleague. Each call was labelled against 28 policy rules, and a holdout set was sealed before any model was run.
  • Two kinds of rule text. A one-sentence definition of each rule, or the definition plus examples and counterexamples that state where the boundary lies.
  • Measures. Recall (hazards caught), false positives, and the "unnecessary interruption rate": the share of harmless actions on which at least one blocking rule fired.

What it found

Definitions alone were not enough. With one-sentence definitions, the eight leading models caught 85 to 90 per cent of hazards with false-positive rates of 1.2 to 2.7 per cent per rule. That sounds acceptable until the rules are combined. Checked against more than 20 rules on every action, they interrupted 12 to 32 per cent of harmless actions.

Examples and counterexamples helped every model. Adding them raised recall by 5.5 to 26.1 percentage points on all 23 models that were available, and reduced false positives on 21. The paper's lead example is a model called Jev 1.14: recall rose from 89.3 to 98.2 per cent, while unnecessary interruptions fell from 30.6 to 4.8 per cent of 252 clean actions. With the examples, it answered in a median 120 milliseconds at $0.46 per thousand requests, at list prices.

Strong models used the boundaries, not the strings. When every command, flag, tool and path name in the examples was replaced with a generic description, the ten strongest models moved by half a point or less. Six weaker models lost 2 to 10 points. The paper's reading is that examples help by stating where the line is, not by giving the model strings to match.

Gains held on new scenarios. On a separate set of 16 families and 320 cases written after the main studies, examples improved recall on 22 of 23 models and reduced interruptions on 21.

Long inputs were a weak spot. Cutting actions over 16 KiB down to that size lost 9 to 39 recall points on 19 of 21 models tested, though on only 20 actions. Whatever classifier sits in the path, it needs to see the whole action.

The limits the paper states

The limitations section is candid, and worth reading before quoting any number:

  • All cases are synthetic, shaped like real tool calls rather than sampled from production.
  • Labels were generated and adjudicated by models under a rulebook, with limited human review.
  • The holdout was reused after results were seen, and the confirmation set reused families, so it is not an untouched validation.
  • Identical requests two weeks apart changed recall by 2.5 to 3.8 points on two models, so run-to-run variation is real and not captured by the confidence intervals.
  • Latency and cost reflect particular endpoints and dates, and use list prices rather than invoices.

The code, dataset and rule texts are published on GitHub, which makes the central claim easy to test on your own rules.

Analysis: what transfers

The model names in this study will date quickly. The method will not.

First, false alarms compound. A rule with a low false-positive rate looks fine in isolation; twenty such rules evaluated on every action interrupt a large share of normal work. If you evaluate a policy check one rule at a time, you will underestimate how often it gets in the way, and an engine that interrupts a third of harmless actions will be disabled by the people it is meant to protect.

Second, rule text is a security artefact. Writing down what is in scope and what is not, with examples on both sides, improved results for every model tested. That is a cheap change compared with switching vendors, and it can be reviewed like code.

Third, a classifier is still a classifier. Even at 98 per cent recall, some hazards pass. Australia's new guidance on securing AI testing environments makes the same point about automated approval checks: they "can fail or be bypassed" and should complement independent containment, monitoring and human oversight. A model-based gate belongs in front of deterministic controls, such as permissions, sandboxing and credentials the agent cannot read, not instead of them. The earlier article on Copilot's assisted permissions covers the same trade-off from a vendor's side.

What it means for engineering and security leaders

If you are evaluating runtime policy checks for coding agents, ask vendors for two numbers per configuration: recall on hazards and the share of harmless actions interrupted across the full rule set. Ask how rule texts are written and whether you can see them. Ask what happens to inputs over the classifier's limit.

If you are writing your own rules, treat this paper as evidence that examples and counterexamples are worth the effort, and that you should measure the interruption rate on real, harmless sessions before rolling out.

Practical takeaways

  • Measure interruptions per action across all rules, not false positives per rule.
  • Write each rule with examples and counterexamples that state the boundary, and keep the texts in version control.
  • Check input limits: confirm long commands and large diffs are not silently truncated before classification.
  • Re-test periodically; the paper saw recall shift by several points on unchanged requests over two weeks.
  • Keep deterministic controls underneath any model-based gate.
  • Try the published dataset and harness against your own candidate models before committing.

Sources

  1. arXiv 2611.02155: Decision Models as Policy Gates for Coding Agents (Beno, 1 November 2026)
  2. agentapprove/decision-policy-rules: code, dataset and rule texts
  3. cyber.gov.au: Securing AI testing environments (12 November 2026)
Cookie categories

Details: Cookie Policy.