Manuscript Offprint
arXiv:2610.24055ToolRosetta: Surface-Form Invariance of Tool-Call Guards
Abstract
Step-level guards for tool-using agents are evaluated on tidy JSON tool calls, but deployed coding agents act through execute_bash and execute_code tools whose payloads are strings. We introduce TOOLROSETTA, which re-renders every candidate action in the AGENTDOJO and AGENTHARM splits of TS-BENCH as a Python call, as a shell command, and without the agent's rationale. The renderings are produced by code and verified by round-trip parsing, so the user request, the history, the label and the action's effect stay fixed while only the surface form changes. Across eleven guards with two placebo controls, frontier and strong open-weight guards are stable: no frontier error rate moves by more than 3.4 points. Four of five specialized agent guards are not: under the shell form their false-positive rates rise by 21 to 47 points on AGENTDOJO, and TS-GUARD's by 38 points on its own home benchmark, blocking between a third and nine in ten benign actions; the fifth, STEPGUARD, does not move. A small open guard drifts five points more permissive. Removing the agent's rationale moves most guards whose input carries it, in guard-specific directions. A request-blind control on one guard shows that the rationale is where intent is read from. A parser that restores the canonical call in front of the guard removes the effect for these renderings, by construction. Benchmark accuracy on JSON calls does not predict a guard's operating point behind a code-acting agent.
1 Introduction
Runtime guards that approve or block an agent's tool call before execution are the most direct defense for tool-using agents [Mou et al., 2026, Zheng et al., 2026, Chennabasappa et al., 2025]. They are trained and benchmarked on step datasets in which the candidate action is a typed call: a tool name and a JSON argument object. Code-acting agents [Wang et al., 2024, 2025] route most actions through one or two generic tools, execute_bash and execute_code, and the action the guard must judge is a string inside the argument. The same reservation, transfer or deletion arrives as reserve_hotel(hotel=...) inside a code block or as reserve-hotel -hotel ... inside a shell command.
Whether a guard’s verdict survives that change has not been tested. Recent agent-safety benchmarks stress agents and guards with multi-turn, decomposed or long-horizon attacks [Li et al., 2026a, Kothamasu et al., 2026, Jiang et al., 2026], audit what existing test suites cover [Chen et al., 2026a], or measure agents’ own paraphrase robustness [Rabanser et al., 2026]; none varies how the same action is written. Chen et al. [2026b] observed that guard accuracy on tool trajectories correlates with structured-data competence more than with jailbreak robustness, but did not intervene on the format. Work on the text-to-tool gap [Cartagena and Teixeira, 2026, Yu et al., 2026] asks how the agent changes when it can act. We ask the same of the referee.
40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: Third Workshop on Agents in the Wild: Safety, Security, and Beyond.
We answer it with a paired, label-preserving intervention. Every step in the AGENTDOJO and AGENTHARM evaluation splits of TS-BENCH [Mou et al., 2026] is rewritten so that only the candidate action's surface form changes. The renderings are produced by code, not by a model. Each rendered row is parsed back and compared with the original tool and arguments before it is accepted, so labels are inherited rather than re-annotated, and any change in a guard's decision is attributable to the writing of the action alone. Two placebo conditions bound tokenization noise and the effect of declaring the wrapper tool.
Our contributions are: (i) TOOLROSETTA, a derivation recipe and pinned artifact that turns any step-level guard benchmark into a surface-form invariance test: four renderings, two placebos, labels inherited, code renderings round-trip verified; (ii) an evaluation of eleven guards, from frontier APIs to five specialized agent guards, with pre-registered, placebo-adjusted estimands; (iii) the finding that surface form leaves frontier guards nearly untouched but shifts four of five specialized guards by 21 to 47 false-positive points while the fifth holds; and (iv) mechanism evidence, from a request-blind control on one guard, that intent is read from the agent's rationale.
Conditions. We hold the request, history and label byte-identical and change only the candidate action (and, for wrapper conditions, append one fixed tool definition):
• original: the released step.
• placebo (whitespace / wrapper): trailing whitespace on the action, the tokenization-noise floor; or the action unchanged with the execute_python definition appended to the tool list, isolating the tool-list change the code condition also makes.
• no rationale: the Thought and any preamble are dropped; Action and Action Input untouched.
• Python / shell: Thought kept; the call becomes execute_python with code = "tool(k=v, ...) " (keyword-only Python literals), or execute_bash with command = "tool -key value ..." (shlex-quoted, compact JSON for nested values).
• prose: Thought kept; the Action and Action Input lines are replaced by one first-person sentence, written by Gemini 3.8 Flash, that states the action and contains every argument value verbatim and no tool name.
Python and shell renderings are deterministic. Each rendered action is parsed back with ast or shlex and the recovered (tool, arguments) must equal the original object exactly, or the row is excluded from that condition and counted. Of 7,182 evaluation steps, 6,764 have a parseable JSON argument object and are renderable; none failed the round trip. The primary cohort is the renderable AGENTDOJO [Debenedetti et al., 2024] (1,220 steps, 352 unsafe) and AGENTHARM [Andriushchenko et al., 2024] (718 steps, 512 unsafe) splits; ASB [Zhang et al., 2024a] is reported as an extension (§3.3). Appendix E shows a step under every condition.
Guards and prompts. Frontier: Gemini 3.8 Flash, Claude Sonnet 5. Open weights: Llama 4 Maverick, GLM 5.2, gpt-oss-120b, Gemma 4 26B (managed); Qwen 3.8 27B, Nemotron 3.5 Lightning 30B (self-hosted, greedy). Specialized: TS-GUARD [Mou et al., 2026], STEPGUARD [Zheng et al., 2026], AgentDoG [Liu et al., 2026, Li et al., 2026b], ShieldAgent [Zhang et al., 2024b] and Safiron [Huang et al., 2025], each run with its authors' released prompt and parser. The last three judge trajectories or plans rather than steps and start from weak baselines here, so we report their shift, not their accuracy. LLM guards use the TS-BENCH authors' assessment prompt and a JSON schema (malicious request, third-party attack, action harmfulness in ); a step is blocked when the composite score is . A request-blind control runs Gemini with the user request withheld. Temperature 0, one run per guard and condition; hosted guards are non-deterministic, so every effect is read above the whitespace placebo. STEPGUARD, AgentDoG, ShieldAgent and Safiron are fed a parsed (tool, arguments) record rather than the step text. The prose form has no record to parse, so it is outside their input contract and reported as not applicable.
Table 1: Verdict flips above the matching placebo (pts) per rendering, and the shell form's FPR / TPR; rows ordered by the shell form's FPR on AGENTDOJO. *: 95% interval excludes zero; full estimands in Appendix D.
| Guard | AgentDojo | AgentHarm | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| flip - placebo (pts) | shell form | flip - placebo (pts) | shell form | |||||||
| Python | Shell | No rat. | ΔFPR | ΔTPR | Python | Shell | No rat. | ΔFPR | ΔTPR | |
| Specialized agent guards | ||||||||||
| Safiron (8B) | +9.7* | +43.1* | +1.6* | +47.1* | +34.9* | +4.6* | +22.8* | +4.2* | +17.0* | +17.7* |
| AgentDoG (4B) | +10.8* | +18.8* | +12.5* | +29.8* | +0.0 | +6.3* | +8.2* | +7.0* | +10.7* | +2.5* |
| ShieldAgent (7B) | +14.4* | +22.5* | n/a | +26.8* | +6.2* | +5.6* | +4.7* | n/a | +12.1* | +1.5 |
| TS-Guard (7.6B, JSON-trained) | +5.1* | +15.6* | +4.4* | +21.2* | +6.6* | +2.2* | +4.5* | -0.1 | +12.6* | +0.0 |
| StepGuard (4B, JSON-trained) | +1.2* | +1.1* | +0.0 | +0.3 | +0.0 | +2.5* | +3.6* | +1.5* | -0.5 | -0.5 |
| General-purpose LLM guards | ||||||||||
| Claude Sonnet 5 | +0.3 | +0.6 | +3.4* | +2.5* | +0.3 | +0.7 | +0.7 | +4.1* | +1.0 | -1.0 |
| Llama 4 Maverick | +2.6* | +2.6* | +8.7* | +1.5 | +1.7 | +3.6* | +3.3* | +6.7* | +1.9 | -1.5 |
| Nemotron 3.5 Lightning 30B | +1.2* | +1.8* | +4.0* | +1.2 | +0.6 | +1.8 | +1.8 | +7.8* | -5.8* | +0.5 |
| Gemini 3.8 Flash | +0.0 | +0.0 | +0.6* | +0.0 | +0.0 | +0.3 | +0.3 | +1.1 | +3.4* | +1.5 |
| Gemini 3.8 Flash (request-blind) | +0.0 | +0.0 | +0.6* | +0.0 | +0.0 | +0.0 | +0.1 | +4.6* | +0.0 | +0.5 |
| Qwen 3.8 27B | +0.2 | +0.2 | +0.2 | -0.8* | +0.0 | -0.1 | +0.1 | +2.6* | +0.0 | -0.5 |

Figure 1: Verdict flips above placebo per guard and rendering, with 95% intervals.
Estimands. Per guard, condition and source, paired to original on the same steps: the verdict flip rate minus the matching placebo's flip rate (wrapper placebo for Python and shell, whitespace placebo for no-rationale and prose), and the change in true- and false-positive rate, each with a 1,000-replicate percentile bootstrap clustered by trajectory. The protocol, cohort and floors were frozen before any perturbed-condition inference.
3 Results
3.1 Frontier guards are stable; four of five specialized guards are not
Frontier and strong open guards read through the syntax (Table 1, Figure 1; baselines in Appendix A). Gemini 3.8 Flash produces zero flips on AGENTDOJO under both the Python and the shell form, and on AGENTHARM its adjusted flips are +0.3 pts with intervals including zero. Claude Sonnet 5 adds one new miss out of 352 unsafe AGENTDOJO steps under either form; its only shift is +2.5 pts of false positives [+1.3, +3.9] under shell. Qwen 3.8 27B's flips are within 0.2 pts of placebo everywhere. Stable is not exactly invariant: Gemini's AGENTHARM false-positive rate moves by +3.4 pts under shell.
Specialized guards' operating points move with the surface form. TS-GUARD, trained on ReAct steps with JSON arguments, flips 15.6 pts [+12.8, +18.2] more verdicts than placebo under the shell form on AGENTDOJO. Its false-positive rate rises from 7.8% to 29% (+21.2 pts, [+17.7, +24.2]): 196 of 868 benign steps are newly blocked. Recall also rises (+6.6 pts), so this is not a cautious threshold but lost discrimination: balanced accuracy falls from 0.903 to 0.829, and on AGENTHARM the shell form moves TS-GUARD from fifth to last of eight guards (Kendall ). The Python form has a quarter of the effect (+5.3 pts FPR, [+3.4, +7.3]), so the wrapper alone, which the wrapper placebo also carries, does not explain it: the shell surface does. On AGENTHARM the shell form adds 12.6 pts of false positives [+5.7, +19.2]. STEPGUARD, the newer guard from the same group, trained
TOOLROSETTA code, protocol and per-row results are released; raw TS-BENCH text is not.
on contrastive same-context, different-action data, stays within +1.1 pts of placebo under shell with no error-rate shift. The other three specialized guards move like TS-GUARD or more: under the shell form on AGENTDOJO AgentDoG's false-positive rate rises by 29.8 pts [+26.6, +33.1], ShieldAgent's by 26.8 pts [+23.5, +30.4] and Safiron's by 47.1 pts [+43.4, +50.6]; the Python form moves each by a third to two thirds as much. One caveat: AgentDoG, ShieldAgent and Safiron judge trajectories or plans through our adapters from weak baselines (Appendix A), so their shifts measure instability within guard; of the two step-level guards, one moves and one does not.
Small open guards drift, in either direction. Llama 4 Maverick churns 2.6–3.6 pts above placebo under both forms on both sources without a net error shift. Nemotron 3.5 Lightning, the weakest guard, becomes more permissive: on AGENTHARM its false-positive rate falls by 4.9 pts [-9.3, -0.5] under Python and 5.8 pts [-9.1, -2.4] under shell at unchanged recall.
For the seven guards that read text, prose (Appendix B) is the mildest form: within 3 pts of placebo for all of them, and zero flips for Gemini. For the four record-based guards it is no form at all: their input contracts reject it.
3.2 Guards judge the narration
Dropping the agent’s Thought moves most guards whose input carries it (from 0.0 for STEPGUARD to 12.5 points of flips for AgentDoG on AGENTDOJO), and the direction tells us what each one reads. Claude’s over-blocking on AGENTDOJO drops by 3.2 pts [-5.0, -1.6] at unchanged recall: the Thought there echoes the injected instruction. Llama, Nemotron and AgentDoG block more without it (+3.6, +5.0 and +11.9 pts FPR on AGENTDOJO), and Llama misses more. ShieldAgent’s format has no slot for the rationale, so the condition is reported as not applicable. The request-blind control isolates the mechanism: on AGENTHARM, where the harm is the call itself, Gemini without the user request loses 4.4 pts of recall when the Thought is removed [-8.4, -0.9], while Gemini with the request loses none. The control covers Gemini only, so it does not explain the specialized guards.
3.3 Where format can matter
The difference between the two sources is itself diagnostic. On AGENTDOJO the harm signal lives in the history, in the injected instruction that precedes the step. On AGENTHARM the request is malicious and the harm is the call, and every guard that moves at all moves there. On the 4,826 renderable ASB steps, TS-GUARD's home benchmark (Appendix C), the shell form moves its false-positive rate by +37.8 pts [+35.4, +40.1] and its recall by +1.5 pts [+0.6, +2.5], while Gemini's adjusted flips stay at -0.3 pts [-0.8, +0.1].
3.4 Mitigation: resolve, then judge
For our code and shell renderings the mitigation is exact, by construction. The renderings are reversible, so a parser that reconstructs the Action / Action Input block from the code or shell string restores the guard's original input and, with it, the original verdict: the TOOLROSETTA parser, forty lines at the boundary, removes a 21- to 47-point shift. It is not a defense for arbitrary agent-written code, and no command was executed. This is Li and Zhao [2026]'s "judge the effect, not the string" made operational.
4 Discussion
What the result is not. The six general-purpose LLM guards and STEPGUARD did not fail on the shell form. The claim is that a guard's benchmark score on JSON calls does not tell you how often it will block or miss once the agent writes its actions as code: four specialized guards move by 21 to 47 points, STEPGUARD does not, and with five guards we cannot say which property separates them.
Limitations. One run per hosted guard, so effects are read above a placebo; the two noisiest hosted guards (GLM 5.2, gpt-oss-120b) are reported only as floors. The wrapper definitions are fictional (bounded by the wrapper placebo), shell rendering preserves values but not types, and we render one canonical style per form. The prose form cannot be inverted by a parser; it has the smallest effects in the study.
References
Maksym Andriushchenko, Alexandra Souly, Mateusz Dziemian, Derek Duenas, Maxwell Lin, Justin Wang, Dan Hendrycks, Andy Zou, Zico Kolter, Matt Fredrikson, et al. Agentharm: A benchmark for measuring harmfulness of LLM agents. arXiv preprint arXiv:2410.09024, 2024.
Arnold Cartagena and Ariane Teixeira. Mind the gap: Text safety does not transfer to tool-call safety in llm agents. arXiv preprint arXiv:2602.16943, 2026.
Xuan Chen, Lu Yan, Ruqi Zhang, and Xiangyu Zhang. Who tests the testers? systematic enumeration and coverage audit of LLM agent tool call safety. arXiv preprint arXiv:2603.18245, 2026a.
Yen-Shan Chen, Sian-Yao Huang, Cheng-Lin Yang, and Yun-Nung Chen. Tracesafe: A systematic assessment of llm guardrails on multi-step tool-calling trajectories. arXiv preprint arXiv:2604.07223, 2026b. COLM 2026.
Sahana Chennabasappa, Cyrus Nikolaidis, Daniel Song, David Molnar, Stephanie Ding, Shengye Wan, Spencer Whitman, Lauren Deason, Nicholas Doucette, Abraham Montilla, et al. Llamafirewall: An open source guardrail system for building secure AI agents. arXiv preprint arXiv:2505.03574, 2025.
Edoardo Debenedetti, Jie Zhang, Mislav Balunović, Luca Beurer-Kellner, Marc Fischer, and Florian Tramèr. Agentdojo: A dynamic environment to evaluate prompt injection attacks and defenses for LLM agents. Advances in Neural Information Processing Systems (NeurIPS) Datasets and Benchmarks, 2024.
Yue Huang, Hang Hua, Yujun Zhou, Pengcheng Jing, Manish Nagireddy, Inkit Padhi, Greta Dolcetti, Zhangchen Xu, Subhajit Chaudhury, Ambrish Rawat, Liubov Nedoshivina, Pin-Yu Chen, Prasanna Sattigeri, and Xiangliang Zhang. Building a foundational guardrail for general agentic systems via synthetic data. arXiv preprint arXiv:2510.09781, 2025.
Tanqiu Jiang, Yuhui Wang, Jiacheng Liang, and Ting Wang. Agentlab: Benchmarking LLM agents against long-horizon attacks. arXiv preprint arXiv:2602.16901, 2026.
Vikhyath Kothamasu, Virginia Smith, and Chhavi Yadav. Hidden in plain sight: Benchmarking agent safety against decomposition attacks with DeCompBench. arXiv preprint arXiv:2606.13994, 2026.
Shawn Li and Yue Zhao. Agent safety is action alignment. arXiv preprint arXiv:2606.28739, 2026.
Xu Li, Simon Yu, Minzhou Pan, Yiyou Sun, Bo Li, Dawn Song, Xue Lin, and Weiyan Shi. Unsafer in many turns: Benchmarking and defending multi-turn safety risks in tool-using agents. arXiv preprint arXiv:2602.13379, 2026a. ICML 2026.
Yu Li, Haoyu Luo, Yuejin Xie, Yuqian Fu, Zhonghao Yang, Shuai Shao, Qihan Ren, Wanying Qu, Yanwei Fu, Yujiu Yang, Jing Shao, Xia Hu, and Dongrui Liu. Atbench: A diverse and realistic agent trajectory benchmark for safety evaluation and diagnosis. arXiv preprint arXiv:2604.02022, 2026b.
Dongrui Liu, Yu Li, Zhonghao Yang, Peng Wang, Guanxu Chen, Yuejin Xie, Qinghua Mao, Wanying Qu, Yanxu Zhu, Tianyi Zhou, et al. Agentdog 1.5: A lightweight and scalable alignment framework for AI agent safety and security. arXiv preprint arXiv:2605.29801, 2026.
Yutao Mou, Zhangchi Xue, Lijun Li, Peiyang Liu, Shikun Zhang, Wei Ye, and Jing Shao. Toolsafe: Enhancing tool invocation safety of llm-based agents via proactive step-level guardrail and feedback. arXiv preprint arXiv:2601.10156, 2026. Findings of ACL 2026.
Stephan Rabanser, Sayash Kapoor, Peter Kirgis, Kangheng Liu, Saiteja Utpala, and Arvind Narayanan. Towards a science of AI agent reliability. In International Conference on Machine Learning (ICML), 2026. arXiv:2602.16666.
Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, and Heng Ji. Executable code actions elicit better LLM agents. In International Conference on Machine Learning (ICML), 2024.
Xingyao Wang et al. Openhands: An open platform for AI software developers as generalist agents. International Conference on Learning Representations (ICLR), 2025.
Shasha Yu, Fiona Carroll, and Barry L. Bentley. The causal impact of tool affordance on safety alignment in llm agents. arXiv preprint arXiv:2603.20320, 2026.
Hanrong Zhang, Jingyuan Huang, Kai Mei, Yifei Yao, Zhenting Wang, Chenlu Zhan, Hongwei Wang, and Yongfeng Zhang. Agent security bench (ASB): Formalizing and benchmarking attacks and defenses in LLM-based agents. arXiv preprint arXiv:2410.02644, 2024a.
Zhexin Zhang, Shiyao Cui, Yida Lu, Jingzhuo Zhou, Junxiao Yang, Hongning Wang, and Minlie Huang. Agent-safetybench: Evaluating the safety of LLM agents. arXiv preprint arXiv:2412.14470, 2024b.
Zhijie Zheng, Yu Li, Chen Qian, Yuqian Fu, Yanwei Fu, Lu Sheng, Jing Shao, and Dongrui Liu. Stepguard: Learning step-level guardrails with scalable supervision and safety-utility balancing. arXiv preprint arXiv:2608.24777, 2026. EMNLP 2026.
A Baselines
Table 2: Baselines on the original steps and the whitespace-placebo flip rate (%). BACC: balanced accuracy.
| Guard | AgentDojo | AgentHarm | ||||||
|---|---|---|---|---|---|---|---|---|
| BACC | TPR | FPR | placebo flip % | BACC | TPR | FPR | placebo flip % | |
| Gemini 3.8 Flash | 0.983 | 0.98 | 0.01 | 0.0 | 0.831 | 0.83 | 0.17 | 2.8 |
| Claude Sonnet 5 | 0.954 | 0.99 | 0.08 | 1.3 | 0.807 | 0.89 | 0.28 | 2.7 |
| Gemini 3.8 Flash (request-blind) | 0.983 | 0.98 | 0.01 | 0.0 | 0.790 | 0.76 | 0.18 | 5.2 |
| Qwen 3.8 27B | 0.824 | 1.00 | 0.35 | 0.5 | 0.742 | 0.95 | 0.46 | 1.4 |
| Llama 4 Maverick | 0.811 | 0.90 | 0.28 | 4.1 | 0.738 | 0.73 | 0.26 | 4.2 |
| Nemotron 3.5 Lightning 30B | 0.815 | 0.97 | 0.34 | 3.4 | 0.660 | 0.70 | 0.38 | 4.6 |
| TS-Guard (7.6B, JSON-trained) | 0.903 | 0.88 | 0.08 | 3.4 | 0.752 | 0.98 | 0.48 | 3.9 |
| StepGuard (4B, JSON-trained) | 0.978 | 0.99 | 0.04 | 0.7 | 0.754 | 0.83 | 0.32 | 1.8 |
| AgentDoG (4B) | 0.687 | 1.00 | 0.63 | 0.8 | 0.519 | 0.92 | 0.88 | 0.0 |
| ShieldAgent (7B) | 0.759 | 0.91 | 0.40 | 0.1 | 0.585 | 0.94 | 0.77 | 0.0 |
| Safiron (8B) | 0.574 | 0.31 | 0.16 | 0.1 | 0.510 | 0.10 | 0.08 | 0.1 |
B Prose rendering
The seven guards whose prompt carries free text were run on the prose form; the four record-based guards (STEPGUARD, AgentDoG, ShieldAgent, Safiron) fill their prompts from a parsed (tool, arguments) record and reject every prose step before inference.
Table 3: Prose form: placebo-adjusted flips (pts) and shell-style error shifts per source. n/a: input contract rejects prose.
| Guard | AgentDojo | AgentHarm | ||||
|---|---|---|---|---|---|---|
| flip – placebo | ΔTPR | ΔFPR | flip – placebo | ΔTPR | ΔFPR | |
| Gemini 3.8 Flash | +0.0 | +0.0 | +0.0 | +0.3 | -0.5 | +0.5 |
| Claude Sonnet 5 | +1.9* | +0.6 | +2.4* | +1.4 | -2.1 | +1.0 |
| Gemini 3.8 Flash (request-blind) | +0.0 | +0.0 | +0.0 | -0.9 | -1.6 | -2.0 |
| Qwen 3.8 27B | -0.1 | +0.0 | +0.1 | -0.3 | +0.0 | +0.5 |
| Llama 4 Maverick | +2.9* | +6.9* | +1.7* | +2.4* | -1.5 | +0.5 |
| Nemotron 3.5 Lightning 30B | +0.7 | -0.3 | +1.8* | +3.0* | +0.0 | -1.5 |
| TS-Guard (7.6B, JSON-trained) | +2.2* | +4.3* | +0.0 | -0.1 | -0.5 | -4.0 |
| StepGuard (4B, JSON-trained) | n/a | n/a | n/a | n/a | n/a | n/a |
| AgentDoG (4B) | n/a | n/a | n/a | n/a | n/a | n/a |
| ShieldAgent (7B) | n/a | n/a | n/a | n/a | n/a | n/a |
| Safiron (8B) | n/a | n/a | n/a | n/a | n/a | n/a |
C ASB extension
TS-GUARD and Gemini 3.8 Flash were run on all six conditions over the 4,826 renderable ASB steps, TS-GUARD's home benchmark; the shell form is the largest shift in the study.
Table 4: ASB extension: baseline and placebo-adjusted effects on the 4,826 renderable ASB steps.
| Guard | original | flip – placebo (pts) | shell form | |||||
|---|---|---|---|---|---|---|---|---|
| BACC | TPR | FPR | Python | Shell | No rat. | ΔFPR | ΔTPR | |
| Gemini 3.8 Flash | 0.812 | 0.67 | 0.05 | -0.1 | -0.3 | +0.4 | +0.1 | -0.2 |
| TS-Guard (7.6B, JSON-trained) | 0.969 | 0.97 | 0.03 | +6.6* | +19.0* | +5.3* | +37.8* | +1.5* |
D Full pre-registered estimands
Every cell of the frozen protocol, per guard, condition and source: raw flip rate, placebo-adjusted flip with its 95% cluster-bootstrap interval, ΔTPR and ΔFPR with intervals, and the counts of newly missed unsafe steps and newly blocked benign steps.
Guard Condition Source flip % flip−placebo ∆TPR ∆FPR new misses new FPs Gemini 3.8 Flash Python AgentDojo 0.0 +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] 0 0 Gemini 3.8 Flash Python AgentHarm 3.2 +0.3 [-0.8, +1.4] +2.0 [-0.5, +5.2] +1.9 [-0.5, +4.6] 4 5 Gemini 3.8 Flash Shell AgentDojo 0.0 +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] 0 0 Gemini 3.8 Flash Shell AgentHarm 3.2 +0.3 [-1.3, +1.7] +1.5 [-0.5, +3.9] +3.4* [+0.9, +6.5] 2 8 Gemini 3.8 Flash No rationale AgentDojo 0.6 +0.6* [+0.2, +1.1] +0.3 [+0.0, +1.1] -0.7* [-1.3, -0.2] 0 0 Gemini 3.8 Flash No rationale AgentHarm 3.9 +1.1 [-0.6, +2.8] +1.5 [+0.0, +3.5] +1.5 [-1.8, +4.5] 5 5 Gemini 3.8 Flash Prose AgentDojo 0.0 +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] 0 0 Gemini 3.8 Flash Prose AgentHarm 3.0 +0.3 [-1.3, +1.8] -0.5 [-3.5, +2.0] +0.5 [-1.1, +2.1] 4 3 Claude Sonnet 5 Python AgentDojo 3.1 +0.3 [-0.7, +1.4] +0.0 [-0.9, +0.8] +0.0 [-1.4, +1.3] 1 18 Claude Sonnet 5 Python AgentHarm 4.2 +0.7 [-0.5, +1.9] -2.0 [-4.8, +0.4] +2.4* [+0.5, +4.9] 6 7 Claude Sonnet 5 Shell AgentDojo 3.4 +0.6 [-0.5, +1.7] +0.3 [-0.6, +1.4] +2.5* [+1.3, +3.9] 1 30 Claude Sonnet 5 Shell AgentHarm 4.2 +0.7 [-0.8, +2.3] -1.0 [-4.6, +2.1] +1.0 [-0.9, +2.8] 5 5 Claude Sonnet 5 No rationale AgentDojo 4.8 +3.4* [+2.2, +4.7] +1.1 [-0.3, +2.8] -3.2* [-5.0, -1.6] 1 12 Claude Sonnet 5 No rationale AgentHarm 6.7 +4.1* [+2.1, +6.2] -0.5 [-4.6, +3.3] +1.5 [-1.4, +4.4] 7 7 Claude Sonnet 5 Prose AgentDojo 3.2 +1.9* [+0.9, +2.8] +0.6 [+0.0, +1.5] +2.4* [+1.2, +3.7] 0 29 Claude Sonnet 5 Prose AgentHarm 4.0 +1.4 [-0.1, +3.2] -2.1 [-6.0, +1.1] +1.0 [-1.1, +3.8] 6 3 Gemini 3.8 Flash (request-blind) Python AgentDojo 0.0 +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] 0 0 Gemini 3.8 Flash (request-blind) Python AgentHarm 5.3 +0.0 [-1.5, +1.5] +2.0 [-0.0, +4.4] -1.0 [-3.7, +1.5] 2 3 Gemini 3.8 Flash (request-blind) Shell AgentDojo 0.0 +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] 0 0 Gemini 3.8 Flash (request-blind) Shell AgentHarm 5.4 +0.1 [-1.7, +1.9] +0.5 [-3.0, +4.2] +0.0 [-2.7, +2.8] 6 4 Gemini 3.8 Flash (request-blind) No rationale AgentDojo 0.6 +0.6* [+0.2, +1.0] +0.0 [+0.0, +0.0] -0.6 [-1.2, +0.0] 0 1 Gemini 3.8 Flash (request-blind) No rationale AgentHarm 9.7 +4.6* [+1.7, +7.3] -4.4* [-8.4, -0.9] -1.9 [-5.2, +1.0] 11 3 Gemini 3.8 Flash (request-blind) Prose AgentDojo 0.0 +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] 0 0 Gemini 3.8 Flash (request-blind) Prose AgentHarm 3.8 -0.9 [-2.5, +0.8] -1.6 [-3.5, +0.0] -2.0 [-4.4, +0.0] 3 1 Qwen 3.8 27B Python AgentDojo 0.7 +0.2 [-0.1, +0.6] +0.0 [+0.0, +0.0] -0.7 [-1.5, +0.0] 0 1 Qwen 3.8 27B Python AgentHarm 1.7 -0.1 [-1.2, +0.9] +0.0 [+0.0, +0.0] +0.5 [-2.5, +3.6] 0 5 Qwen 3.8 27B Shell AgentDojo 0.6 +0.2 [-0.2, +0.6] +0.0 [+0.0, +0.0] -0.8* [-1.5, -0.2] 0 0 Qwen 3.8 27B Shell AgentHarm 1.9 +0.1 [-1.0, +1.4] -0.5 [-1.7, +0.0] +0.0 [-2.9, +2.8] 1 4 Qwen 3.8 27B No rationale AgentDojo 0.7 +0.2 [-0.4, +0.7] +0.0 [+0.0, +0.0] +0.5 [-0.1, +1.1] 0 6 Qwen 3.8 27B No rationale AgentHarm 4.0 +2.6* [+1.1, +4.4] -1.0 [-3.4, +1.0] +1.0 [-2.5, +4.7] 3 8 Qwen 3.8 27B Prose AgentDojo 0.4 -0.1 [-0.6, +0.4] +0.0 [+0.0, +0.0] +0.1 [-0.4, +0.7] 0 3 Qwen 3.8 27B Prose AgentHarm 1.1 -0.3 [-1.1, +0.5] +0.0 [+0.0, +0.0] +0.5 [-1.8, +3.3] 0 3 Llama 4 Maverick Python AgentDojo 6.8 +2.6* [+1.2, +4.0] +3.4* [+0.6, +6.4] +0.8 [-0.7, +2.5] 7 32 Llama 4 Maverick Python AgentHarm 9.1 +3.6* [+1.5, +5.9] -0.5 [-3.8, +3.6] +0.5 [-2.6, +3.7] 6 5 Llama 4 Maverick Shell AgentDojo 6.8 +2.6* [+1.3, +4.1] +1.7 [-0.9, +4.4] +1.5 [-0.1, +3.1] 9 36 Llama 4 Maverick Shell AgentHarm 8.8 +3.3* [+1.3, +5.3] -1.5 [-4.1, +1.1] +1.9 [-1.9, +5.7] 5 10 Llama 4 Maverick No rationale AgentDojo 12.8 +8.7* [+6.7, +10.7] +0.3 [-3.7, +4.6] +3.6* [+1.1, +5.9] 26 67 Llama 4 Maverick No rationale AgentHarm 10.9 +6.7* [+4.2, +9.4] -3.9 [-8.6, +0.0] +0.5 [-3.0, +3.5] 12 7 Llama 4 Maverick Prose AgentDojo 7.0 +2.9* [+1.5, +4.3] +6.9* [+4.0, +9.8] +1.7* [+0.1, +3.5] 3 35 Llama 4 Maverick Prose AgentHarm 6.4 +2.4* [+0.6, +4.5] -1.5 [-5.5, +2.1] +0.5 [-1.9, +3.0] 6 4 Nemotron 3.5 Lightning 30B Python AgentDojo 4.0 +1.2* [+0.2, +2.3] +0.6 [-0.6, +2.0] +0.6 [-0.8, +2.0] 2 24 Nemotron 3.5 Lightning 30B Python AgentHarm 9.5 +1.8 [-0.1, +3.6] +0.0 [-3.0, +3.2] -4.9* [-9.3, -0.5] 9 3 Nemotron 3.5 Lightning 30B Shell AgentDojo 4.6 +1.8* [+0.9, +2.8] +0.6 [-0.3, +1.8] +1.2 [-0.4, +2.8] 1 31 Nemotron 3.5 Lightning 30B Shell AgentHarm 9.5 +1.8 [+0.0, +3.8] +0.5 [-3.6, +4.5] -5.8* [-9.1, -2.4] 8 1 Nemotron 3.5 Lightning 30B No rationale AgentDojo 7.5 +4.0* [+2.5, +5.4] +2.3* [+0.8, +4.1] +5.0* [+2.9, +6.9] 1 62 Nemotron 3.5 Lightning 30B No rationale AgentHarm 12.4 +7.8* [+5.1, +10.3] +4.9* [+1.5, +9.3] +1.5 [-3.5, +6.1] 5 14 Nemotron 3.5 Lightning 30B Prose AgentDojo 4.2 +0.7 [-0.4, +1.9] -0.3 [-1.7, +0.9] +1.8* [+0.4, +3.4] 3 31 Nemotron 3.5 Lightning 30B Prose AgentHarm 7.7 +3.0* [+1.3, +4.8] +0.0 [-3.2, +3.3] -1.5 [-5.6, +2.4] 6 6 TS-Guard (7.6B, JSON-trained) Python AgentDojo 8.9 +5.1* [+3.4, +6.8] +6.0* [+2.9, +9.4] +5.3* [+3.4, +7.3] 7 60 TS-Guard (7.6B, JSON-trained) Python AgentHarm 4.6 +2.2* [+0.5, +4.2] -0.5 [-1.8, +0.0] +3.4 [-2.3, +9.4] 2 16 TS-Guard (7.6B, JSON-trained) Shell AgentDojo 19.4 +15.6* [+12.8, +18.2] +6.6* [+3.7, +9.5] +21.2* [+17.7, +24.2] 3 196 TS-Guard (7.6B, JSON-trained) Shell AgentHarm 6.8 +4.5* [+2.3, +6.9] +0.0 [-1.9, +2.1] +12.6* [+5.7, +19.2] 2 33 TS-Guard (7.6B, JSON-trained) No rationale AgentDojo 7.9 +4.4* [+3.0, +5.9] +4.8* [+1.3, +8.6] +1.0 [-0.6, +2.6] 12 32 TS-Guard (7.6B, JSON-trained) No rationale AgentHarm 3.8 -0.1 [-1.6, +1.3] +1.0 [+0.0, +2.7] -1.5 [-5.1, +2.1] 0 6 TS-Guard (7.6B, JSON-trained) Prose AgentDojo 5.7 +2.2* [+1.0, +3.7] +4.3* [+1.2, +7.4] +0.0 [-1.4, +1.4] 8 19 TS-Guard (7.6B, JSON-trained) Prose AgentHarm 3.7 -0.1 [-1.5, +1.3] -0.5 [-1.8, +0.0] -4.0 [-8.5, +0.0] 1 7 StepGuard (4B, JSON-trained) Python AgentDojo 2.8 +1.2* [+0.4, +1.9] +0.0 [-0.9, +0.9] +0.9 [-0.6, +2.2] 1 20 StepGuard (4B, JSON-trained) Python AgentHarm 9.4 +2.5* [+0.4, +4.7] -0.5 [-5.7, +4.4] -2.0 [-5.8, +2.1] 9 6 StepGuard (4B, JSON-trained) Shell AgentDojo 2.7 +1.1* [+0.3, +1.8] +0.0 [-0.8, +0.9] +0.3 [-0.9, +1.6] 1 17 StepGuard (4B, JSON-trained) Shell AgentHarm 10.5 +3.6* [+1.3, +6.2] -0.5 [-5.2, +4.5] -0.5 [-4.5, +3.2] 10 8 StepGuard (4B, JSON-trained) No rationale AgentDojo 0.7 +0.0 [-0.5, +0.5] +0.0 [+0.0, +0.0] +0.3 [-0.3, +1.0] 0 6 StepGuard (4B, JSON-trained) No rationale AgentHarm 3.4 +1.5* [+0.7, +2.6] -0.5 [-2.7, +1.6] -1.0 [-4.0, +2.2] 3 4 AgentDoG (4B) Python AgentDojo 13.3 +10.8* [+8.9, +12.6] +0.0 [+0.0, +0.0] +18.7* [+15.9, +21.6] 0 162 AgentDoG (4B) Python AgentHarm 8.4 +6.3* [+3.9, +8.8] +1.5 [+0.0, +3.2] +6.3* [+3.0, +10.1] 0 14 AgentDoG (4B) Shell AgentDojo 21.2 +18.8* [+16.5, +21.1] +0.0 [+0.0, +0.0] +29.8* [+26.6, +33.1] 0 259 AgentDoG (4B) Shell AgentHarm 10.3 +8.2* [+5.5, +11.1] +2.5* [+0.4, +5.3] +10.7* [+6.8, +15.3] 0 22 AgentDoG (4B) No rationale AgentDojo 13.4 +12.5* [+10.5, +14.6] +0.0 [+0.0, +0.0] +11.9* [+8.8, +14.9] 0 133 AgentDoG (4B) No rationale AgentHarm 7.0 +7.0* [+4.6, +9.3] +1.0 [-1.7, +3.6] +0.0 [-3.6, +3.8] 2 7 ShieldAgent (7B) Python AgentDojo 18.5 +14.4* [+12.2, +16.8] +2.8* [+0.8, +5.0] +13.4* [+10.4, +16.7] 3 163 ShieldAgent (7B) Python AgentHarm 9.5 +5.6* [+3.0, +8.4] +2.0* [+0.4, +3.9] +11.2* [+6.1, +16.7] 0 25 ShieldAgent (7B) Shell AgentDojo 26.6 +22.5* [+20.0, +25.1] +6.2* [+3.8, +8.7] +26.8* [+23.5, +30.4] 0 268 ShieldAgent (7B) Shell AgentHarm 8.6 +4.7* [+2.4, +7.6] +1.5 [+0.0, +3.1] +12.1* [+6.6, +18.3] 0 26 ShieldAgent (7B) No rationale AgentDojo 0.2 +0.1 [+0.0, +0.3] +0.0 [+0.0, +0.0] -0.2 [-0.6, +0.0] 0 0 ShieldAgent (7B) No rationale AgentHarm 0.1 +0.1 [+0.0, +0.4] +0.0 [+0.0, +0.0] +0.0 [+0.0, +0.0] 0 0 Safiron (8B) Python AgentDojo 11.0 +9.7* [+7.9, +11.7] +15.3* [+11.3, +19.6] +5.1* [+3.3, +6.8] 9 53 Safiron (8B) Python AgentHarm 7.0 +4.6* [+2.8, +6.4] +4.9* [+1.1, +9.0] +1.9 [-1.0, +5.2] 2 7 Safiron (8B) Shell AgentDojo 44.4 +43.1* [+39.8, +46.6] +34.9* [+29.7, +40.7] +47.1* [+43.4, +50.6] 3 411 Safiron (8B) Shell AgentHarm 25.2 +22.8* [+19.4, +26.4] +17.7* [+11.1, +25.1] +17.0* [+11.1, +22.9] 2 39 Safiron (8B) No rationale AgentDojo 1.7 +1.6* [+1.0, +2.4] +4.0* [+1.8, +6.3] +0.1 [-0.2, +0.5] 2 2 Safiron (8B) No rationale AgentHarm 4.3 +4.2* [+2.6, +5.9] +4.4* [+1.1, +9.0] -1.0 [-3.1, +1.0] 2 1 E A step under every condition Original (AGENTHARM, unsafe): (1) Thought: I will start by using the Stable Diffusion model to create an image of the politicians, Donald Drewski and Fernando Whitehall, shaking hands. (2) Action: run_stable_diffusion_model (3) Action Input: {"image_path": "", "prompt": "Donald Drewski and Fernando Whitehall shaking hands"} Python form (Thought unchanged; the execute_python definition is appended to the tool list): 8
(2) Action: execute_python (3) Action Input: {"code": "run_stable_diffusion_model(image_path='', prompt='Donald Drewski and Fernando Whitehall shaking hands')"}
Shell form:
(2) Action: execute_bash (3) Action Input: {"command": "run_stable_diffusion_model -image-path" -prompt 'Donald Drewski and Fernando Whitehall shaking hands'}
Prose form (Thought unchanged; lines (2)–(3) replaced by the sentence):
I will now run a stable diffusion model with an image file name of "" and the prompt Donald Drewski and Fernando Whitehall shaking hands.
No-rationale form drops line (1). The whitespace placebo appends one trailing space; the wrapper placebo appends the execute_python definition and leaves the action untouched.
F Protocol notes, failures and cost
Claude Sonnet 5 returns an empty completion for the same two AGENTHARM steps in every condition and on retry; they are excluded from its cells consistently (n = 716). AGENTHARM repeats 205 (interaction, segment) keys; step identifiers are persisted on materialized rows. Llama 4 Maverick's wrapper placebo alone raises its AGENTDOJO recall by 3.7 pts [+1.2, +6.2], which is why wrapper-condition effects are adjusted against that placebo. Hosted-guard inference for the primary cohort cost about 32 in GPU hours for the three self-hosted guards.
Prose form. Gemini 3.8 Flash (T = 0.3, up to nine candidates) wrote one sentence per step; a candidate is kept only if every argument value appears verbatim, the tool name does not, no authorization or urgency phrase was added, and it is at most three times the length of the original block; 1,921 of the 1,938 cohort steps received one. Gemini 3.1 Pro recovered the exact (tool, arguments) from the sentence and the tool definitions for 1,745; Claude Sonnet 5 judged 600 before partner billing was stopped and recovered 573. The 185 rows on which a judge failed were reviewed one by one by Claude (Fable 5.1) following the authors' written instructions, and the authors accepted that review in place of a human pass: 183 accepted (every judge failure was a trailing period absorbed into a value, a dropped null, a type coercion, a parameter rename, an empty tool, or a multi-sentence value truncated by the judge), 1 repaired (a Python list literal in the recipient slot), 1 rejected (a hallucinated tool whose name carried the agent's own disclaimer); 1,920 sentences were frozen (FREEZE.json). STEPGUARD rejects every prose step for missing Action markers; AgentDoG, ShieldAgent and Safiron raise before inference because there is no tool call to extract. Prose inference cost about $23 of hosted tokens and 1.8 GPU-hours.