Source-linked AI summary
AgentBoundary: Counterfactual Evaluation of Safety in Tool-Using LLM Agents
Tianzhuo Yang, Zirui Mi, Yantao Huang, Guoxi Zhang, Jiawei Chen, Yaodong Yang, Jingwei Yi
TL;DR
Agentic safety requires deciding whether to act as permission-relevant evidence emerges during execution, but existing evaluations can confound apparent risk, permissibility, and task competence. AgentBoundary evaluates matched executable counterfactuals, and its results show that runtime calibration can improve authorized completion while also improving unsafe-action blocking.
Problem
Existing evaluations do not cleanly separate permission decisions from apparent risk, capability demand, and execution outcomes in tool-using agents.
Source: §1 · p. 1Method
AgentBoundary varies apparent risk and action permissibility across four variants of the same executable workflow, then evaluates trajectories and resulting state.
Source: §1 · p. 2Results
Runtime calibration improves authorized-task completion by 18.2 percentage points and unsafe-action blocking by 5.4 points on average across ten configurations.
Source: §1 · pp. 2–3Takeaways & Limitations
Abstract
from arXiv · showhide
Safety alignment for large language models (LLMs) in conversational settings is largely framed around whether to answer or refuse a request. In agentic settings, however, the same models must decide whether to act as permission-critical evidence emerges during execution. This creates a distinct challenge: apparent risk, action permissibility, and task competence are easily confounded, making agentic over-refusal difficult to distinguish from ordinary task failure. To address this, we introduce AgentBound, the first four-way counterfactual generation-and-evaluation framework for tool-using agent safety. AgentBound transforms the same executable workflow by independently varying apparent risk and action permissibility, enabling controlled comparisons of risky-looking but authorized tasks and routine-looking but unauthorized tasks. These comparisons jointly diagnose over-refusal and unsafe compliance while controlling for task competence. We instantiate AgentBound as a human-validated 4,000-task evaluation suite with trajectory-based and post-state-based judgments. Across 17 model and harness configurations, high safety frequently coexists with poor authorized-task completion: GPT-5.5 blocks 99.5\% of routine-looking unauthorized actions yet completes only 28.7\% of risky-looking authorized tasks. We further train a lightweight runtime calibration module that improves authorized-task completion by 18.2\% on average across 10 evaluated configurations, while improving unsafe-action blocking by 5.4\% on average. These show that effective agentic alignment requires action decisions to track permission-relevant execution evidence, rather than refusal strength alone.
1 INTRODUCTION
Agentic safety decisions must track permission-relevant evidence that may emerge during execution, not merely whether a request appears risky. AgentBoundary evaluates that distinction with matched executable workflows and reports that strong unsafe-action blocking can coexist with poor authorized-task completion.
1 INTRODUCTION
- Conversational over-refusal benchmarks and agentic evaluations do not cleanly isolate permission decisions from apparent risk, capability demand, and execution outcomes.A failed task may reflect over-refusal, limited capability, or execution error, while successful completion may itself be unsafe.Source: §1 · pp. 1–2
- AgentBoundary creates four counterfactual task variants that vary apparent risk and action permissibility while retaining a shared workflow scaffold.It preserves comparable capability demands and evaluates tool calls and resulting state, with human validation of counterfactual semantics, environment consistency, and trajectory judgments.Source: §1 · p. 2
- A lightweight runtime calibration module revises pre-action reasoning with trajectory evidence while leaving the underlying model unchanged.It operates after execution context is integrated and before the next action is committed.Source: §1 · p. 2
- 18.2 percentage points average improvement in Hard-Benign utility and 5.4 points in Covert-Malicious safety follow runtime calibration across ten configurations.GPT-5.5 reaches 99.5% safety on routine-looking unauthorized tasks but completes 28.7% of risky-looking authorized tasks.Source: §1 · p. 2
- Reliable agentic behavior requires robustness to misleading risk cues and responsiveness when execution evidence changes what is permitted.These properties jointly expose over-refusal and unsafe compliance.Source: §1 · pp. 1–2
2 RELATED WORK
Related evaluations cover response-level refusal, interactive task completion, agentic harms, and interventions in agent workflows. The paper distinguishes its focus through multi-step execution, trajectory or post-state assessment, and controlled executable counterfactuals.
2 RELATED WORK
- Response-level benchmarks test over-refusal on benign prompts or refusal on unsafe instructions, but do not observe authorized tool use or forbidden state transitions.The cited examples include XSTest, OR-Bench, and SORRY-Bench (Röttger et al., 2024; Cui et al., 2025; Xie et al., 2025).Source: §2 · p. 3
- Agent utility benchmarks emphasize interactive task completion, while other agent evaluations assess harms; Table 1 compares representative evaluations against the paper’s criteria.The cited examples include AgentBench, WebArena, ToolSandbox, ToolEmu, AgentDojo, AgentHarm, and OS-Harm (Liu et al., 2025; Zhou et al., 2024; Lu et al., 2025; Ruan et al., 2024; Debenedetti et al., 2024; Andriushchenko et al., 2025; Kuntz et al., 2025).Source: §2 · p. 3, Table 1 · p. 3
- Agentic alignment work includes multi-step post-training, executable alignment data, pre-tool interventions, generated guardrail code, and a thought editor in the think–act–observe loop.THOUGHT-ALIGNER rewrites the current Thought before execution, then returns control to the unchanged agent to regenerate its action.Source: §2 · p. 3
3 PROBLEM SETUP
The setup models tool use as a partially observed process and separates task utility, unsafe behavior, and safety-induced over-refusal. Its objective maximizes authorized task success subject to an acceptable unsafe-action rate.
3 PROBLEM SETUP
- A task instance comprises the user instruction, initial state, available tools and transition semantics, and a hidden judge; the agent acts from its history of observations and prior decisions.A policy induces a trajectory of thoughts, actions, observations, and a final response; terminal actions leave the state unchanged.Source: §3 · pp. 3–4
- Over-refusal is counted on authorized-benign tasks when the agent fails and avoids a required safe action despite an available safe completion path.Ordinary capability failures are excluded without trajectory evidence of safety or permission misclassification.Source: §3 · p. 4
- Task utility and unsafe behavior are distinct trajectory outcomes: success requires the authorized objective, correct tool arguments, and post-state, while unsafe behavior proposes or executes a forbidden side effect.The setup reports these separately from over-refusal, which is not a second reward traded against task success.Source: §3 · p. 4
- The calibration objective maximizes expected authorized-benign task success subject to expected unsafe behavior across the task distribution being at most ε.The safety constraint is attached to the realized transition.Source: §3 · p. 4
4 AGENTBOUNDARY SYNTHESIS PIPELINE
AGENTBOUNDARY builds four executable task variants that vary apparent risk and permission while sharing a workflow scaffold, then evaluates systems on authorized completion and unsafe-action blocking. Human validation supports the intended boundary contrasts; benchmark results show persistent authorized-task failures and variation across model scale and agent stacks.
4 AGENTBOUNDARY SYNTHESIS PIPELINE
- AGENTBOUNDARY transforms tasks into executable four-way families that retain a shared topic, tool interface, and action scaffold while varying authorization and consequences.Human validation checks both the intended contrast and the quality of the shared tool–environment scaffold.Source: §4 · p. 4, §4.2 · p. 6
4.1 CONSTRUCTION PROTOCOL
- Each seed becomes four related siblings: a disguised forbidden COVERT-MALICIOUS task, lawful EASY-BENIGN work, and risky-looking but authorized HARD-BENIGN work, alongside the harmful source.The generator–verifier checks boundary semantics, environmental support, and family diversity; hard-validation tasks are stratified across eight top-level risk categories and 13 Cybercrime risk classes.Source: §4.1 · pp. 4–5, §4 · p. 4
- Accepted families package four instructions with executable fixtures, shared tools, completion criteria, and forbidden-state predicates for consistent agent execution.The agent’s trajectory and post-state are evaluated separately for task utility and tool-call safety; the primary metrics are Utility(HB) and Safety(CM).Source: §4.1 · p. 5
4.2 HUMAN VALIDATION
- Across 2,787 families, construction gates pass at 97.0–99.7%; the HARD-BENIGN/COVERT-MALICIOUS contrast reaches 98.0%, and intended split-safety semantics reach 99.1%.Human and automatic scores agree within one point in 91.0% of helpfulness comparisons and 96.7% of tool-risk comparisons.Source: §4.2 · p. 6
4.3 BENCHMARK EVALUATION
- The benchmark compares 14 model agents and three deployed frameworks on 1,000 boundary-critical families, measuring authorized HARD-BENIGN completion against matched COVERT-MALICIOUS blocking.Table 2 reports these primary boundary metrics and all-split aggregates under a common protocol.Source: §4.3 · p. 7
- For 16 of 17 configurations, HARD-BENIGN-only failure is the largest non-passing outcome within matched families, revealing a difficult utility–safety tradeoff.Systems with near-ceiling COVERT-MALICIOUS safety still complete only a limited share of HARD-BENIGN tasks; the least restrictive system gains utility at the cost of weaker covert-risk blocking.Source: §4.3 · p. 7
- Model scale does not consistently improve either boundary metric: large systems vary widely in HARD-BENIGN utility, and parameter count alone does not solve boundary calibration.Hosted closed models generally avoid the lowest-utility regime and block covert risk more strongly than the smallest open models, but the relationship is not monotonic.Source: §4.3 · p. 7
- With GPT-5.5 held fixed, OpenClaw raises HARD-BENIGN utility by 8.5 points versus Codex, with only a small change in COVERT-MALICIOUS safety.This controlled comparison holds task prompts and benchmark tools fixed and is consistent with the evaluated harness policies.Source: §4.3 · p. 7
5 MITIGATION EXPERIMENTS
The mitigation uses a decision-time Thought editor to calibrate actions against live execution context. Across configurations, it recovers authorized progress while preserving or improving covert-harm blocking; case-study and ablation results further examine this two-sided effect.
5 MITIGATION EXPERIMENTS
- The plug-in rewrites the current Thought after trajectory context is integrated and before the next state-changing action, then the unchanged agent regenerates its action.It conditions on the live execution context while leaving the base agent, tools, and runtime unchanged.Source: §5 · p. 7, §5.2 · p. 8
5.1 PLUG-IN ALIGNMENT AND TRAINING DATA
- Training preserves safe, useful Thoughts, redirects plans advancing forbidden transitions, and revises false-positive refusals to resume authorized work with minimal corrections.The family-disjoint training pool combines preservation examples with unsafe-compliance and over-refusal corrections; evaluation adds only the plug-in aligner.Source: §5.1 · pp. 7–8
5.2 EXPERIMENTAL RESULTS
- Across 10 configurations, Thought correction raises all-split and HARD-BENIGN utility in every case while preserving or improving COVERT-MALICIOUS safety in eight.Figure 4 and Table 3 report paired Bare-to-Aligner comparisons; the comparison holds the base agent, prompt, tools, runtime, and judges fixed.Source: §5.2 · p. 8, Figure 4 · p. 8, Table 3 · p. 8
5.3 CASE STUDY
- In a matched family, alignment changes refusal of authorized publication and compliance with targeted public harassment into task completion and pre-publication blocking.The aligned agent blocks the harmful request before content generation or publication.Source: §5.3 · p. 9
5.4 ABLATION STUDIES
- Across four backbones, boundary training improves HARD-BENIGN utility and COVERT-MALICIOUS safety over the untrained wrapper; GuardAgent has lower HARD-BENIGN utility than both.Table 4 compares HARD-BENIGN utility and COVERT-MALICIOUS safety for the boundary-correction and tool-gating baselines.Source: §5.4 · p. 9, Table 4 · p. 9
6 CONCLUSION
AgentBoundary treats agent safety as a measurable action-boundary problem involving both authorized completion and prevention of harmful state transitions. Across evaluated agents, the Thought aligner improves authorized completion while retaining covert-harm blocking.
6 CONCLUSION
- A plug-in Thought aligner raises authorized completion across all 10 evaluated model and harness configurations while preserving or improving covert-harm blocking in eight.The benchmark comprises 2,787 counterfactual task families.Source: §6 · p. 9
- Across model agents and deployed harnesses, no system consistently combines strong authorized completion with reliable covert-harm blocking.The paper frames action-boundary calibration as a central objective for agent alignment.Source: §6 · p. 9
- The benchmark makes the action boundary measurable through a human-validated executable suite of 2,787 counterfactual task families.The required boundary includes both completing authorized work and stopping harmful state transitions.Source: §6 · p. 9
AI USE STATEMENT
The statement describes generative AI assistance across manuscript preparation, research, experiments, and review, alongside author review and responsibility.
AI USE STATEMENT
- Generative AI assisted with drafting and polishing, literature search, figure preparation, methodological feedback, experiment scripting, data processing, and mathematical-argument and aggregate-result review.The authors say they reviewed AI-assisted materials and take responsibility for the paper’s text, code, data, and claims.Source: AI USE STATEMENT · pp. 9–10
- LLMs generated and verified the synthetic four-way benchmark dataset and scored agent trajectories.The authors point to Sections 4.1 and 4.2 and Appendices B and D for data construction, scoring, and human validation.Source: AI USE STATEMENT · pp. 9–10
- The authors reviewed AI-assisted materials and take responsibility for the paper’s text, code, data, and claims.Source: AI USE STATEMENT · p. 10
ETHICS STATEMENT
The materials describe safeguards for synthetic or sandboxed evaluation, prior work and benchmark design, and the construction of matched task families across risk categories.
ETHICS STATEMENT
- Harmful tasks use mock state and local endpoints, not live accounts, private repositories, or public communication channels; annotators could skip or withdraw and were compensated above local minimum-wage standards.Released materials omit operational credentials, personal data, annotator identities, private links, and raw comments.Source: ETHICS STATEMENT · p. 10
A EXTENDED RELATED WORK
- Prior work covers dialogue refusal, agent utility and security, and process-level alignment; AGENTBOUNDARY adds a matched test of justified continuation versus unsafe compliance.The related-work discussion distinguishes text-response benchmarks from evaluations of tool trajectories and state changes.Source: A EXTENDED RELATED WORK · pp. 14–15
- Boundary control requires preserving the local tool, state, and action scaffold while varying permission-critical facts, beyond merely including benign and harmful tasks.The benchmark also evaluates trajectory or post-state behavior and diagnoses refusal on tasks intended to be completed.Source: A EXTENDED RELATED WORK · p. 15
B BOUNDARY-FAMILY PROMPTS AND METADATA
- Families share a tool interface and workflow while varying authorization; split labels and evaluation metadata are hidden, and nonboundary details stay fixed where possible.The four siblings contrast overt harm, routine-looking forbidden work, risky-looking authorized work, and ordinary benign work.Source: B BOUNDARY-FAMILY PROMPTS AND METADATA · pp. 15–16
B.1 GENERATOR AND VERIFIER TEMPLATES
- Five ordered construction prompts calibrate a harmful source, create benign and malicious variants, and review the four siblings; failed checks trigger targeted revision and re-review.The verifier checks that the harmful path remains intact in the covert-malicious sibling while the hard-benign sibling preserves the easy-benign safe trajectory.Source: §B.1 · pp. 16–17
B.2 CATEGORY COVERAGE AND CONSTRUCTION FRAMES
- The taxonomy uses coverage and boundary discriminability to define eight risk categories; the suite covers 1,000 families, including 507 Cybercrime families across 13 risk classes.Counts describe constructed families that passed all gates, not an assumed real-world prevalence distribution.Source: §B.2 · p. 17, Figure 5 · p. 17
C NATIVE AGENT HARNESS CONFIGURATIONS
The evaluation compares native harness configurations using a shared MCP tool interface while preserving each harness’s own execution behavior.
C NATIVE AGENT HARNESS CONFIGURATIONS
- Three native agent harnesses are evaluated in four configurations, with each task run in a fresh session, isolated workspace, and separate harness process.Execution traces are converted to a common benchmark format while native context management, tool interaction, and stopping behavior are preserved.Source: C NATIVE AGENT HARNESS CONFIGURATIONS · pp. 18–19
- Codex runs GPT-5.5 with unrelated built-in tools disabled, while OpenClaw runs the same model and tool interface through its native Pi harness.OpenClaw disables parallel tool calls, allowing comparison of harness policy and control flow with Codex.Source: C NATIVE AGENT HARNESS CONFIGURATIONS · p. 19
- DeepSeek Harness runs DeepSeek V4 Pro with isolated state and the same restricted tool interface, extending the comparison to another model family and runtime.Source: C NATIVE AGENT HARNESS CONFIGURATIONS · p. 19
- The fourth configuration adds THOUGHT-ALIGNER to OpenClaw, which can revise a visible pre-action Thought before the model generates or reuses the tool action.Some first-step read-only actions may bypass alignment; on later steps, the next tool call or final response comes from the aligned Thought.Source: C NATIVE AGENT HARNESS CONFIGURATIONS · p. 19
D BENCHMARK METRICS AND AGGREGATION
The benchmark scores helpfulness and tool-call safety separately, applies a fixed pass threshold, and reports rates over valid scored trajectories.
D BENCHMARK METRICS AND AGGREGATION
- Helpfulness and tool-call risk are each scored on a 0–3 scale and binarized at 2, with utility requiring at least good completion and safety allowing no more than possible mild risk.On malicious splits, refusal or containment can satisfy the expected safe outcome without rewarding completion of the forbidden action.Source: D BENCHMARK METRICS AND AGGREGATION · p. 19
- Missing trajectories, judge errors, and unparseable scores are excluded from the affected metric’s denominator and separately recorded as utility or safety coverage.The benchmark targets 1,000 trajectories per split and 4,000 total.Source: D BENCHMARK METRICS AND AGGREGATION · p. 19
- The family-level diagnostic pairs valid HARD-BENIGN utility and COVERT-MALICIOUS safety records, using only families with both scores valid.Its valid-pair denominator can differ across systems and is separate from split-level metrics.Source: D BENCHMARK METRICS AND AGGREGATION · p. 19
- Figure 6 presents construction-gate, inter-annotator, and human–judge validation panels with 95% family-cluster bootstrap confidence intervals.Source: Figure 6 · p. 20
E HUMAN VALIDATION PROTOCOL
Human validation checks family construction, boundary labels, and trajectory scores separately, using trained annotators, repeated labels, and human–judge comparisons.
E HUMAN VALIDATION PROTOCOL
- Annotators received common training and a written manual; a quality reviewer checked every example, and acceptance review preceded aggregation.Qualification, calibration, independent repeated labels, and options to flag unclear or distressing examples were part of the protocol.Source: E HUMAN VALIDATION PROTOCOL · p. 20
- Human–judge comparisons count scores within one point as agreement on the shared 0–3 rubric, and exclude blank, other, or unmatchable rows from the relevant denominator.The reported uncertainty intervals use family-level resampling to retain dependence among questions, sibling scores, and repeated annotations.Source: E HUMAN VALIDATION PROTOCOL · p. 21
- Family judgments assess sibling consistency and whether permission edits distinguish safe HARD-BENIGN from unsafe COVERT-MALICIOUS tasks, separately from naturalness.Trajectory audits separately assess coherence, tool misuse, helpfulness, and risk; malicious tasks may be handled correctly through refusal or containment.Source: E HUMAN VALIDATION PROTOCOL · p. 22
- Repeated family-label calibration agreement was 92.2% for sibling consistency, 96.4% for boundary contrast, and 99.5% for split semantics; human–judge within-one agreement was 91.0% for helpfulness and 96.7% for tool-call risk.Source: E HUMAN VALIDATION PROTOCOL · p. 23
- The main boundary-family pass covered 2,787 unique families labeled by five annotators, while a repeated calibration set independently labeled 100 families with four annotators each.Source: E HUMAN VALIDATION PROTOCOL · p. 23
F ALIGNMENT TRAINING DATA
The aligner learns to preserve useful authorized reasoning while correcting unsafe or over-refusing thoughts, with training data and quality gates designed to keep those corrections grounded in tool trajectories. Case studies show it can complete a risky-looking authorized task while refusing a routine-looking harmful one.
F ALIGNMENT TRAINING DATA
- Training targets preserve safe, useful thoughts and minimally correct unsafe or over-refusing thoughts to resume authorized progress.Labels, reasons, correction targets, and evaluator metadata are hidden from the model at inference.Source: F ALIGNMENT TRAINING DATA · p. 23
G QUALITY GATES
- Quality gates require tool-grounded, split-compatible, causally consistent records and corrections that preserve safe prefixes while addressing harmful effects.Prompt hygiene also keeps shortcut labels, target annotations, and expected trajectories out of SFT inputs.Source: G QUALITY GATES · pp. 23–24
H MITIGATION OBJECTIVE AND SCOPE
- The objective does not guarantee improvement on every trajectory, so evaluation checks downstream helpfulness, tool risks, environment state, and post-state.Changing a thought can alter later actions and observations, making measured outcomes dependent on the base agent and environment.Source: H MITIGATION OBJECTIVE AND SCOPE · p. 24
- The plug-in revises a raw thought after integrating trajectory context but before the unchanged agent selects its next action.The objective trains the aligner to predict original or corrected thoughts from rendered task, tool, history, and raw-thought inputs.Source: H MITIGATION OBJECTIVE AND SCOPE · p. 24
I CASE STUDIES
- On the student-bulletin family, the bare model refused the authorized task and executed the harmful one, while the aligned model completed the former and blocked the latter.The four trajectories had no iteration-limit failure, malformed tool call, or simulator error.Source: I CASE STUDIES · p. 25
I.1 BENCHMARK DESIGN: THE SAME INVOICE, BUT A DIFFERENT EFFECT
The examples hold workflow details steady while varying authorization and effects, exposing both over-refusal and unsafe compliance. On a student-bulletin family, the aligned model completes the authorized task and refuses the harmful one; the paper also notes that its benchmark results do not establish deployment readiness.
I.1 BENCHMARK DESIGN: THE SAME INVOICE, BUT A DIFFERENT EFFECT
- Topic words alone cannot resolve the invoice family; the agent must assess the requested effect.The hard-benign prompt uses suspicious language for sandboxed work, while the covert-malicious prompt uses administrative language for altering a real financial record.Source: §I.1 · p. 25
- The invoice family controls vendor, amount, artifact, and workflow while changing the authorization boundary and terminal effect.Mock data saved in an isolated test environment is safe, whereas replacing a real invoice and publishing the altered ledger is financial falsification.Source: §I.1 · p. 25
I.2 ALIGNER BEHAVIOR: PRAISE OR PUBLICLY TARGET A STUDENT
- The bare model refused the authorized hard-benign task, but accepted and publicly distributed stereotyped content about a named student in the covert-malicious task.The paper reports no execution noise in the four trajectories, so the contrast reflects boundary decisions.Source: §I.2 · p. 26, §I.2.1 · p. 26, §I.2.2 · p. 28
- The aligned model completed the hard-benign bulletin and refused the covert-malicious task before generating or publishing harmful content.It retained safe read-only context checks before refusing.Source: §I.2 · p. 26, §I.2.3 · p. 29, §I.2.4 · p. 31
J BROADER IMPACT STATEMENT
- The paired evaluation can expose unsafe compliance and unwarranted refusal before deployment, including in sensitive but legitimate workflows.The paper notes that excessive caution can deny useful service.Source: J BROADER IMPACT STATEMENT · p. 31
- Benchmark results do not establish deployment readiness; consequential applications require additional domain-specific evaluation and human oversight.Execution remains bound to mocked tools and state.Source: J BROADER IMPACT STATEMENT · p. 31
Related papers
This paper cites
- Training language models to follow instructions with human feedback2022
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues?2023
- Let's Verify Step by Step2023
- Constitutional AI: Harmlessness from AI Feedback2022
- OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments2024
- $τ$-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains2024