TL;DR
This paper demonstrates that specialized "decision models" can act as high-performance, low-latency security gates for coding agents. By providing these models with explicit "policy boundaries"—clear examples and counterexamples of what to allow or block—researchers achieved a massive boost in hazard detection (up to 98.2% recall) while slashing unnecessary user interruptions from 30% down to less than 5%.
What Problem Does This Paper Address?
Autonomous coding agents are a double-edged sword: they can refactor a codebase in seconds, but they can also delete production databases or leak secrets just as quickly. Human-in-the-loop review is the standard safety measure, but it’s a bottleneck. If an agent asks for permission for every trivial file read, it becomes too annoying to use; if it never asks, it’s a liability.
The challenge is building an automated "policy gate" that can evaluate complex tool calls (like Bash commands or API requests) against a set of security rules in real-time. This gate needs to be:
- Accurate: Catching malicious or accidental hazards.
- Low-friction: Minimizing "false alarms" that interrupt the developer.
- Fast and Cheap: Operating at a latency and cost that doesn't hinder the agent's performance.
Methods
The author evaluated 22 hosted "decision models" (specialized, fast-inference models like TypeSafe’s Jev, Cloudflare’s Clef, and OpenAI’s Decisions API) and two general-purpose LLMs as baselines. Unlike standard LLMs, these "System One" models are designed to return probabilities for specific questions without generating text, making them significantly faster and cheaper.
The core experiment compared three prompt conditions for the policy rules:
- Definition Only: A single-sentence description of the rule.
- Definition + Examples: Adding explicit "Opus-authored" examples and counterexamples to define the policy boundaries.
- Name-Free Control: Replacing specific command names (e.g.,
rm -rf) with generic descriptions (e.g., "recursive deletion") to see if models were just memorizing strings or actually understanding the operations.
The researchers also tested the impact of "preamble placement"—whether instructions should be repeated for every rule or shared once per request.
Datasets
The study utilized a newly created synthetic dataset of 2,643 tool calls grouped into 106 "families" (scenarios like repository cleanup or production deployment).
- Labeling: Every call was labeled against 28 policy rules. To ensure high quality, labels were generated by GPT-6 and cross-checked by Claude Opus 5.5, achieving 99.9% agreement.
- Holdout: A "sealed holdout" was used to prevent data leakage during model tuning.
- Confirmation Set: An additional 320 cases were created after the initial study to test how well the findings transferred to entirely new scenarios.
Key Insights and Ideas
- One sentence is not enough: Simple definitions led to inconsistent results. Models struggled to "draw the line," resulting in either missed hazards or a flood of false positives.
- Policy Boundaries are the "Secret Sauce": Providing examples of what is a violation and counterexamples of what is not (e.g., "deleting a file" vs. "moving a file to trash") was the single most effective way to improve performance.
- Understanding over Memorization: Strong models didn't just look for keywords like
rm. When specific names were replaced with generic descriptions, the top models maintained their accuracy, proving they understand the semantics of the tool calls. - The "System One" Advantage: Specialized decision models can evaluate dozens of rules in a single pass. Models like Jev 1.14 achieved sub-200ms latency, making them viable for "runtime" protection.
Key Results
The addition of explicit examples raised recall by 5.5 to 26.1 percentage points across all 23 available models.
- Jev 1.14 Performance: With examples, its recall jumped from 89.3% to 98.2%. More importantly, the "unnecessary interruption rate" (harmless actions that triggered a block) plummeted from 30.6% to 4.8%.
- Efficiency: Jev 1.14 delivered these results with a median latency of 120 ms at a cost of only $0.46 per thousand requests.
- Top Tier: Seven models reached over 98% recall with the fuller text, suggesting that for high-end models, the bottleneck is no longer accuracy, but rather cost and speed.
Limitations and Future Work
- Synthetic Nature: The dataset consists of synthetic tool calls rather than live production data, which may not capture the full messiness of real-world agent behavior.
- Context Gaps: The "tool-only" evaluation ignores broader context, such as the user's original request or project-specific facts (e.g., "is this the official repository?"). The author notes that adding this context is a key area for future study.
- Model Stability: The paper observed that identical requests made two weeks apart could result in recall shifts of 2-3 points, highlighting the volatility of hosted API models.
The author concludes that for developers building agentic systems, the path to safety isn't just better models, but better policy engineering: specifically defining the "gray areas" with clear inclusions and exclusions.
Summary updated