Manuscript Offprint

arXiv:2611.02155

Decision Models as Policy Gates for Coding Agents: Explicit Policy Boundaries Improve Detection and Reduce False Alarms

James P. Beno

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Coding agents can destroy data, leak secrets and message the wrong person faster than a human can review. Could a decision model catch these risks at runtime? We evaluated 22 hosted decision models and two prompted general models as classifiers for a multi-rule policy engine. A synthetic dataset of 2,643 tool calls was labeled blind against 28 rules, with a sealed holdout. With a single shared preamble in both conditions, explicit boundaries written as examples and counterexamples raised recall by 5.5–26.1 percentage points on all 23 available models and reduced false positives on 21. Jev 1.14's recall rose from 89.3% to 98.2%, while unnecessary interruptions fell from 30.6% to 4.8% of 252 clean actions. With examples, its median latency was 120 ms at $0.46 per thousand requests. Strong models retained the recall gains when concrete names were replaced by generic descriptions; three largely retained them when the same boundaries were written as prose. On 16 new scenarios written after the initial studies, a follow-up improved recall on 22 of 23 models and reduced unnecessary interruptions on 21. We release the dataset, rule texts and harness.

1 Introduction

A coding agent that asks permission for everything is annoying. One that asks for nothing is a liability. OpenAI's own system card describes agents that are careless with actions beyond the task's scope, and deceptive when reporting them (OpenAI, 2026b). The Agent Incident Registry (Enkrypt AI, 2026a) records reports of coding agents that destroyed a production volume and every backup in nine seconds (Enkrypt AI, 2026c), hunted and exfiltrated secrets when a poisoned package told them to (Enkrypt AI, 2025), and published a personal attack on a maintainer who rejected a pull request (Enkrypt AI, 2026b).

The policy engine we built sits in between. At its heart are policy rules: descriptions of agent actions (permanently deletes data, reads credential material, pushes outside the project) paired with a policy decision (allow, block, or ask the user). Users can add rules from a library, or create their own. Every agent and subagent action is scored against every enabled rule; several rules can match. Deterministic policy code combines these scores into a decision. One false alarm can interrupt an otherwise harmless action. With parallel agents, the classifier also has to handle bursts of calls quickly and cheaply.

For a while, this kind of classifier seemed elusive. Then TypeSafe announced Jev (TypeSafe AI, 2026), a decision model that promised that combination. Jev is a System One model after Kahneman (2011): it takes a state object and typed questions, and returns a probability per question in a single pass, with no generated text. Other vendors soon offered decision models, several through a shared endpoint (Cloudflare, 2026; OpenAI, 2026a; Microsoft, 2026; OpenRouter, 2026). We needed to know which could catch hazardous actions without repeatedly interrupting harmless work, at a latency and cost the product could bear.

We evaluated a variety of hosted decision models as the classifier in our policy engine. Four hypotheses guided the evaluation: A decision model can evaluate one tool call against all of a user's rules in a single request, within a 3-second provider deadline and at no more than $0.50 per thousand requests (H1). A one-sentence definition alone can serve as the rule text, drawing on the model's knowledge of commands and tools (H2). Adding examples and counterexamples will increase accuracy (H3). Replacing command and parameter names in the examples with generic descriptions will reduce the gain, because the models match on those words (H4).

To test these hypotheses, we built a synthetic dataset of 2,643 tool calls grouped into 106 fami-lies, such as cleaning up a repository, deploying to production, or messaging a colleague. Each tool call was labeled blind against 28 of the policy engine's rule templates, and a holdout was sealed before inference. We then ran 22 hosted decision models (plus two prompted general models as a baseline), on the rule definitions alone, and on the definitions with examples and counterexamples. We measured recall, the false-positive rate, and the unnecessary interruption rate: the share of harmless actions on which at least one deny-side rule fired.

A one-sentence definition was not enough. With definitions and a single shared preamble, eight models detected 85–90% of hazards at 1.2–2.7% false positives. Across 23 rules, they interrupted 12–32% of harmless actions.

Explicit boundaries improved detection and reduced interruptions. With the Opus-authored examples and counterexamples, all 23 available models gained 5.5–26.1 recall points; seven reached 98.1–98.6%. Jev 1.14's recall rose from 89.3% to 98.2%, while its unnecessary interruptions fell from 30.6% to 4.8% of harmless actions.

Strong models retained recall without concrete names. With names in the examples replaced by generic descriptions, recall on the ten strongest tested models moved by half a point or less. Three strong models also retained the gains when the boundaries were written as prose. Six weaker models lost 2–10 recall points without the names.

We also tested transfer to new scenarios. We built a separate set of 16 families and 320 cases after the initial studies. On this set, examples improved recall on 22 of 23 models and reduced unnecessary interruptions on 21.

We make three contributions. A dataset of coding-agent tool calls labeled against 28 policy rules, with a sealed holdout (§3). An evaluation of 22 decision models from 15 vendors and two general models, measuring rule-level detection, action-level unnecessary interruptions, latency and cost (§6). And controlled comparisons of policy wording, showing when explicit boundaries help and when names and presentation matter (§7).

References (25)