The SEAD paper proposes state-perspective attack and defense methods DART and SAGE for tool-based agentsSEAD: A State-Based Perspective on Attack and Defense in Tool-Using Agents
The paper proposes the attack DART and the defense SAGE, reducing DART's Hard ASR from 48.0% to 4.0% on GPT-5.6 Luna.
The adaptive attacker knows the harmful goal g, controls the instructions sent to the target agent, and uses execution and rejection feedback to plan; the target autonomously selects tool actions; the defender observes its own visible history h_n^D and the pending action u_n, obtains state evidence through private read-only queries, and enforces BLOCK before the tool action takes effect; the trusted execution layer intercepts major actions, and the attacker cannot tamper with the interception mechanism.
- Tool-calling agents may accumulate harmful states through multiple locally benign-looking steps, while each party only has a partially observable view of the environment, making it impossible to identify the critical state transition that triggers harm from visible history alone.
- Formalize attack and defense as partially observable state control; the attack method DART adaptively plans through execution prefix tree search and execution feedback, and the defense method SAGE proactively probes the environment state through private read-only queries before action execution to eliminate ambiguity.
- Across 187 malicious tasks, DART achieves Hard ASR of 33.2%–54.7% on 4 target models; in offline evaluation, SAGE achieves a 95.79% benign pass rate and an F1 score of 50.78%; in online attack-defense, SAGE reduces DART's Hard ASR against GPT-5.6 Luna from 48.0% to 4.0%.
- The intervention interface focuses on single-step action interception, not covering concurrent processes, composite actions, and assistant output leakage; defense evaluation is mainly based on GPT-5.6 Luna, and no controlled experiments have been conducted on the individual components of search and probing.
- Evaluated models
- GPT-5.6 LunaGPT-5.6 TerraGemini 3.8 FlashClaude Sonnet 5SAGE
- Benchmarks
- MT-AgentRiskOpenAgentSafety
- Metrics
- Semantic ASRHard ASRBenign all-pass rate (B)H1H2F1F2ℓ1
The paper uniformly models attack and defense for tool-based agents as a partially observable state control problem, and proposes attack method DART and defense method SAGE. DART decomposes harmful goals into locally plausible steps and uses feedback from real tool execution for trajectory tree search; SAGE investigates relevant states through read-only queries before execution, then decides to pass or intercept. On four target models, DART's semantic attack success rate is 18.8 to 35.9 percentage points higher than the strongest baseline, with consistent improvements under executable verification. On recorded trajectories, SAGE preserves 95.79% of benign trajectories and intercepts 92.73% of harmful paths at harmful boundaries; in online attack-defense evaluation, it reduces DART's executable attack success rate from 48.0% to 4.0%, and remains effective across four attack methods and on PostgreSQL and Web domains not seen in training. Code and data are open-sourced on GitHub.
Why it was selectedThe paper unifies attacks and defenses for tool-based agents under a partially observable state control framework, and provides reproducible datasets and code, making it suitable as a reference for teams conducting agent safety evaluation.
Paper analysis
What problem does this paper attempt to solve?
To address the problem of multi-step operations accumulating harm in tool agents with partially observable environment states, the paper proposes a state control framework and attack DART and defense SAGE.
In tool-calling language model agents, how to identify and defend against harmful state transitions accumulated from seemingly benign preparatory steps in a partially observable execution process, while maintaining normal execution of benign tasks.
- Scenario and Importance: Language model agents operate external systems (files, permissions, databases, etc.) through tools, and model outputs become state transitions upon tool execution; security evaluation must focus on executed action trajectories and the persistent states they reach.
- Shortcomings of Existing Methods: Existing evaluations and defenses typically review isolated responses, completed trajectories, or make pre-execution judgments based on incomplete interaction histories; due to partial state observability, visible history alone cannot distinguish legitimate preparatory operations from harmful state boundary crossings.
- Core Observation and Perspective: The paper formalizes attack and defense as a partially observable state control process (SEAD), pointing out that the harmfulness of an action depends on the current environment state; attackers can adaptively plan through execution feedback, while defenders need to obtain decision-relevant state evidence through read-only queries before changing the environment.
- Paper's Solution: The authors propose an adaptive attack method DART based on execution prefix tree search, and a pre-execution defense method SAGE with private read-only environment probing capability, and construct an evaluation benchmark based on environment-executable verification.
- Threat Model:
- Attacker Goal: Induce the victim system to reach an environment state satisfying the harmful goal g (Hg(s) = 1).
- Attacker Knowledge and Capabilities: Knows the harmful goal g, controls instructions sent to the target agent, adaptively plans based on execution and rejection feedback exposed by the protocol; cannot modify the execution layer's interception mechanisms or evaluation criteria.
- Defender Knowledge and Capabilities: Observes its own visible history hnD and the pending action un, has no access to the attacker's goal or validator checkpoints; can perform bounded read-only queries that do not modify task state to obtain private evidence, and can enforce BLOCK before tool actions take effect.
- Victim System: A tool-calling target agent that autonomously selects specific tool actions and interacts with the external environment under interception by a trusted execution layer.
What related research exists?
The paper focuses on agent adaptive attacks and runtime action defense, pointing out that existing methods lack a state evolution perspective, and this paper introduces execution feedback and environment probing.
Agent Evaluation and Adaptive Attacks
- Agent Capability and Safety Benchmarks: AgentBench (Liu et al., 2024), WebArena (Zhou et al., 2023), and SWE-bench (Jimenez et al., 2024) measure task capability; ToolEmu (Ruan et al., 2023), R-Judge (Yuan et al., 2024), AgentHarm (Andriushchenko et al., 2025), and AgentHazard (Feng et al., 2026) examine tool use failures, risk identification, and harmful goals; Agent Security Bench (Zhang et al., 2025) broadens threat coverage across prompt, tool use, and memory dimensions.
- Interactive Feedback Adaptive Attacks: The Trojan Knowledge (Wei et al., 2025) searches for question-answer paths conditioned on replies in dialogue; AgentDojo (Debenedetti et al., 2024) and TRACE (Zeng et al., 2026) evaluate attacks on agents that execute tools.
Agent Runtime Action Defense
- Defense Intervention Timing: R-Judge (Yuan et al., 2024) scores completed trajectories; TurnGate (Shen et al., 2026) reviews pending dialogue replies; ToolSafe (Mou et al., 2026) checks tool calls before execution; StepGuard (Zheng et al., 2026) supports trajectory auditing and pre-execution action checks.
- Defense Decision Basis: GuardAgent (Xiang et al., 2025) and ShieldAgent (Chen et al., 2025) reason based on policies; AIRGuard (Qin et al., 2026) focuses on tool permissions; AttriGuard (He et al., 2026) uses intent attribution; SafeMCP (Wang et al., 2026) introduces environment-oriented forward reasoning.
Comparison Baselines and Evaluation Benchmarks
- Baseline Methods and Datasets: Attack baselines include single-turn direct request Direct, multi-turn fixed decomposition MTA (from MT-AgentRisk, Li et al., 2026b), STAC combining synthetic tool contexts with adaptive interaction (Li et al., 2026a), and prompt-adaptive refinement Intent Hijacking (Jiang et al., 2026); defense baselines include Base Binary, Fine-tuned Binary, StepGuard, TS-Guard, and Safiron (Huang et al., 2026); experiments build a malicious benchmark based on MT-AgentRisk tasks and use OpenAgentSafety (Vijayvargiya et al., 2026) to construct benign control trajectories.
Positioning Differences Between This Paper and Related Work
- Positioning Differences: The authors state that existing attacks and defenses typically start from their own isolated role perspectives, whereas this paper starts from persistent effects, partial state observation, and execution feedback, unifying attack and defense as partially observable state control in the SEAD shared execution loop; DART introduces execution feedback and state progress into tree search, while SAGE introduces private read-only environment probing before execution to eliminate state ambiguity.
How does the paper address this problem?
By modeling the execution loop as state control, DART uses execution prefix tree search for adaptive attacks, while SAGE combines private read-only environment probing for gated interception.
The paper models tool-agent interaction as a partially observable state control framework SEAD, and proposes an attack method DART based on prefix tree search and execution feedback, as well as a pre-execution defense method SAGE with private read-only environment probing capability.
Partially Observable State Control Formalization
- Shared Execution Loop and State Evolution: The attacker provides instructions, the target agent proposes specific tool actions, and the pre-execution defense gate decides to pass or block before the action takes effect. System state evolution is defined by the following gated transition process:
(s_{n+1}, o_{n+1}) = \begin{cases} (F(s_n, u_n), \Omega(s_n, u_n)), & d_n = \text{PASS} \\ (s_n, o^{\text{BLOCK}}), & d_n = \text{BLOCK} \end{cases}This equation defines the control of defense decisions over state transitions: PASS allows passage and produces a new state and observation, while BLOCK keeps the state unchanged and returns a rejection feedback.
- State Ambiguity and Harm Boundary: The paper points out that harm is a property of the evolving state, and benign and malicious interactions can share preparatory operations; the key to achieving harm lies in identifying the first state transition boundary that achieves the harmful goal:
βg(s, u) = 1{Hg(s) = 0, Hg(F(s, u)) = 1}This equation indicates that action u in state s transitions harmful goal g from not achieved to achieved, marking the critical state transition for realizing harm. State ambiguity arises when the visible history and states requiring opposite decisions are simultaneously compatible, prompting the defender to obtain environmental evidence before execution.
Adaptive Attack Method DART
- Execution Prefix Tree Search: DART builds a tree structure on executed target trajectories, where each node represents an execution prefix. The proposal strategy samples candidate instructions in the current parent node's planning context, and target execution produces child nodes and records the true state. UCT algorithm is used for node selection, balancing path value estimation and exploration.
- Multi-Source Node Value Evaluation: The initial value Qv of a child node combines executable checkpoint progress Pv, introspection score Iv (evaluated by an introspection critic model on the usefulness of the instruction toward the harmful goal), and feedback score Cv (evaluated by a feedback critic model on the contribution of observable execution), computed by the linear formula Qv = 0.20Iv + 0.30Cv + 0.50Pv.
- Termination Conditions and Reward Backpropagation: A path terminates when goal completion is confirmed, there are 3 consecutive repeated instructions/rejections/no-ops, maximum depth is reached, or node budget is exhausted. Termination reward combines progress and penalty terms, backpropagated to update Qv and visit counts of path nodes.
- Attack Implementation and Hyperparameters: The proposal strategy and both critic models use Huihui-Qwen3.8-27B-abliterated (sampling temperature 0.7, top-p 0.9, output limit 1024 tokens). Search settings: maximum depth 8, branching factor 2, per-task attempt limit of 25 execution nodes and 25 controller planning calls.
State-Aware Pre-Execution Defense SAGE
- Private Read-Only Environment Probing: After the target proposes an action un to be executed, SAGE evaluates whether the action would trigger a harm boundary in the current state; if the visible history cannot determine the decision-relevant state, SAGE performs up to K steps of read-only queries (e.g., reading files, viewing processes, checking database table structures, or web page status) through a private read-only interface, with probing results kept secret from the target and without modifying task state.
- Gating Decision and Continuous Follow-up: After probing, the decision policy outputs PASS or BLOCK. If judged as BLOCK, the rejection feedback enters the target's visible history; when the target or attacker proposes new replanning actions, each new action must be submitted again to the defense gate for review.
- Fine-Tuning Training Settings: SAGE is based on Qwen3-4B-Instruct-2507 with full-parameter fine-tuning, using AdamW optimizer, constant learning rate 2e-5, batch size 16, trained for 1 epoch (463 updates). Training data comes from 7407 teacher demonstrations from 1230 source trajectories (4201 benign, 2591 harmful pre-closed-loop, 615 harmful closed-loop), with inverse frequency label weighting to balance PASS and BLOCK weights.
- Inference Parameters and Cross-Domain Application: At inference, temperature is 0, thinking is disabled, output limit per step is 1024 tokens, and up to 6 defense interaction steps are allowed. Training uses only Filesystem and Terminal trajectories; at inference, the same model checkpoint is maintained and connected to domain-specific read-only probing tools.
What experiments did the paper conduct?
DART achieves the highest attack success rate across all four target models, SAGE achieves 95.79% benign pass-through and 50.78% F1, and reduces Hard ASR to 4.0% online.
Experimental Setup
- Models under test: RQ1 evaluates 4 target models: GPT-5.6 Luna, GPT-5.6 Terra, Gemini 3.8 Flash, Claude Sonnet 5; the target models for both RQ2 and RQ3 are GPT-5.6 Luna. The attack model backbone is Huihui-Qwen3.8-27B-abliterated.
- Dataset and scale: Built by adapting MT-AgentRisk, 187 malicious tasks (covering Filesystem 52, Terminal 51, PostgreSQL 42, GitLab 10, ownCloud 10, Reddit 22). RQ1 uses all 187 tasks; RQ2 and RQ3 use a subset of 75 tasks (45 Filesystem/Terminal and 30 PostgreSQL/Web). RQ2 additionally uses 95 benign trajectories adapted from OpenAgentSafety (containing 770 candidate actions).
- Comparison baselines: Attack baselines include Direct, MTA, STAC, Intent Hijacking; defense baselines include Base Binary, Fine-tuned Binary, StepGuard, TS-Guard, Safiron, SAGE (Base), and a no-defense control.
- Metric definitions: Attack metrics include Hard ASR determined by executable evaluators and Semantic ASR determined by judges; defense metrics include benign full pass rate B, closed-loop precise interception rate H1, time-aware interception score H2, and harmonic composite scores F1 and F2.
- Evaluation method: Semantic success is determined by an independent gemini-3-flash judge based on recorded execution evidence (temperature 0, output limit 2048 tokens); hard success is verified by task-specific executable evaluators in the sandbox checking the final environment state.
- Sample size and repetitions: In RQ1, each of the 187 tasks is attempted 1 time; RQ2 offline evaluation is based on 55 semantically successful trajectories produced by DART in the 75-task subset and 95 benign trajectories; the paper does not report the number of repeated independent evaluation rounds.
Main Results
According to Table 2, the ASR comparison of each attack method against the 4 target models on 187 malicious tasks is as follows (values in %):
Swipe horizontally to read the table
Target model and metric Direct MTA STAC Intent Hijacking DART GPT-5.6 Luna (Semantic) 37.4 27.8 29.4 27.2 73.3 GPT-5.6 Luna (Hard) 40.1 21.4 23.0 19.3 54.7 GPT-5.6 Terra (Semantic) 37.4 29.4 24.6 17.1 62.5 GPT-5.6 Terra (Hard) 33.2 22.5 18.7 11.8 51.1 Gemini 3.8 Flash (Semantic) 24.1 25.1 19.8 10.2 43.9 Gemini 3.8 Flash (Hard) 25.1 19.8 18.2 8.6 33.2 Claude Sonnet 5 (Semantic) 17.1 16.0 18.2 13.4 51.9 Claude Sonnet 5 (Hard) 23.5 13.4 14.4 10.7 38.7 - Attack success rate improvement: The authors report that DART achieves the highest Semantic ASR and Hard ASR on all 4 target models, with Semantic ASR exceeding each model's best baseline by 18.8 to 35.9 percentage points and Hard ASR by 8.1 to 17.9 percentage points.
- Multi-turn interaction is not necessarily better than single-turn: The authors note that multi-turn attack baselines (MTA, STAC, Intent Hijacking) do not consistently outperform single-turn Direct; in agent environments, inducing a compliant reply is only an intermediate step, and attack success depends on whether subsequent tool operations actually achieve the harmful goal.
- Adaptive value of execution feedback: The authors argue that DART's advantage comes from using tool execution feedback and state progress to guide branch search, not merely from concealing malicious intent in the conversation.
Offline Defense Safety-Utility Trade-off Evaluation (RQ2)
- What was tested: On the 55 DART semantically successful trajectories and 95 benign trajectories from the 75-task subset, evaluate each defense method's ability to intercept harmful closed-loop actions while maintaining benign execution, and the interception timing (Table 3, Table 4).
- Experimental results: SAGE lets through 91 of the 95 benign trajectories (B of 95.79%), with H1 of 34.55%, H2 of 58.79%, and harmonic metrics F1 of 50.78% and F2 of 72.86%, all the highest among the tested defenses; in terms of first interception timing, SAGE's Exact interception rate is 34.55%, Early 58.18%, Late 0.00%, and Miss 7.27% (Table 3). Fine-tuned Binary achieves a 100.00% benign pass rate but has a Miss rate of 72.73% (Table 3).
- Authors' interpretation: The authors argue that SAGE intercepts the vast majority of harmful trajectories while preserving almost all benign trajectories; compared with TS-Guard, SAGE reduces premature interception from 78.18% to 58.18% and the miss rate from 14.55% to 7.27%, indicating that it can better preserve safe prefixes and accurately intercept at the harm boundary.
Online Defense and Dynamic Attack-Defense Interaction (RQ3)
- What was tested: On the 75-task subset with GPT-5.6 Luna as the target, test online defense effectiveness when the agent is allowed to re-plan after interception and the attacker receives feedback and adapts, including defense against DART, out-of-domain generalization, and performance across attack methods (Figure 3, Figure 4, Table 5, Figure 6).
- Experimental results: Against DART attacks, SAGE reduces Semantic ASR from 65.3% without defense to 10.7% and Hard ASR from 48.0% to 4.0% (Figure 3, Table 5); on the PostgreSQL and Web tasks not included in fine-tuning (30 in total), SAGE reduces DART's Semantic success count from 20 to 3 and Hard success count from 9 to 1 (Figure 3, Table 5); against the other 3 multi-turn attacks, SAGE also lowers ASR, with the highest residual ASR among tested attacks occurring under Intent Hijacking, at 13.3% Semantic and 6.7% Hard (Figure 4, Figure 6).
- Authors' interpretation: The authors argue that online attack-defense must be evaluated as the interaction continues to evolve, and early interception does not guarantee preventing the final harm from being achieved; SAGE's mechanism based on read-only environment probing can effectively transfer to tool domains unseen during training, maintaining defense effectiveness across domains and attack methods.
Other Ablations and Analyses
- SAGE without fine-tuning the backbone model, SAGE (Base), offline evaluation: B of 62.11%, H1 of 10.91%, H2 of 39.20%, Exact of 10.91%, Miss of 9.09% (Table 3).
- Mean absolute error of first interception distance l1: Fine-tuned Binary 1.20, SAGE 5.61, TS-Guard 6.77, Safiron 6.92, SAGE (Base) 7.42, StepGuard 8.94, Base Binary 10.25 (Table 4).
- Hard success counts by domain when defending DART online: SAGE has 1 in Filesystem, 1 in Terminal, 0 in PostgreSQL, 1 in Web; without defense, 14, 13, 5, 4 respectively (Table 5).
- Overall Hard ASR when defending different attacks online: SAGE against MTA 1.3%, STAC 4.0%, Intent Hijacking 6.7%, DART 4.0% (Figure 6).
- Overall Semantic ASR when defending different attacks online: SAGE against MTA 12.0%, STAC 4.0%, Intent Hijacking 13.3%, DART 10.7% (Figure 4).
Negative Results, Exceptions, and Failure Cases
- Premature interception phenomenon: In offline evaluation, although SAGE's Exact rate (34.55%) is higher than baselines, 58.18% of trajectories still undergo Early interception (Table 3); Figure 5 shows a wide spread in its premature interception distance from closure, and the authors note that improving the precise interception rate does not eliminate premature interception.
- Early interception does not prevent final harm: In the online task single.136, SAGE executes BLOCK in both round 3 and round 4 and performs read-only environment probing, but the target and attacker continue interacting in round 5, ultimately achieving the harmful goal and passing all 3 checkpoints (Table 9).
- Residual rates under specific attacks: In online defense, Intent Hijacking retains 13.3% Semantic ASR and 6.7% Hard ASR against SAGE, higher than DART's residual rates against SAGE (10.7% Semantic, 4.0% Hard) (Figure 4, Figure 6).
What are some points that can be further explored?
The authors note that existing intervention interfaces do not yet cover concurrency and compound actions, and propose that further exploration is needed into query termination timing and evidence reuse mechanisms.
Limitations and Future Directions Noted by the Authors
- Scope of intervention interfaces: The authors note that SEAD focuses on tool interactions where major actions pass through a pre-execution interception gate and state investigation uses private read-only queries; concurrent processes, compound actions, and assistant output leakage require extending the existing intervention interfaces (Appendix B).
- Target model coverage: The authors note that defense evaluation mainly used GPT-5.6 Luna, and broader target model coverage is a future extension direction (Appendix B).
- Controlled variable studies of algorithm components: The authors note that controlled studies of individual mechanisms within the search and investigation components are one future extension direction (Appendix B).
- Learning investigation strategies and state evidence reuse: The authors note that future work could further explore learning which queries change decisions, when to stop investigating, and how to reuse existing evidence while tracking the validity of evidence as the environment changes (Appendix A).
Experimental Coverage
- Target models under test: Attack effectiveness (RQ1) covers 4 target models: GPT-5.6 Luna, GPT-5.6 Terra, Gemini 3.8 Flash, Claude Sonnet 5; defense evaluation (RQ2, RQ3) covers only one target model, GPT-5.6 Luna.
- Tool environments and task domains: A total of 4 tool domains are covered (Filesystem, Terminal, PostgreSQL, Web), including 187 malicious tasks and 95 benign trajectories; defense fine-tuning data comes only from Filesystem and Terminal, with PostgreSQL and Web evaluated as out-of-domain tasks.
- Attack and defense comparison methods: The attack side compares 4 baselines: Direct, MTA, STAC, Intent Hijacking; the defense side compares 5 baselines: Base Binary, Fine-tuned Binary, StepGuard, TS-Guard, Safiron.
- Defense investigation permissions and interaction budget: On the defense side, SAGE uses only predefined read-only investigation tools, with a single-step decision budget allowing at most 6 defense interaction steps and 1024 tokens of output; on the attack side, DART is limited to maximum depth 8, branching factor 2, and a per-attempt cap of 25 nodes and 25 planning calls.
- Unreported experimental parameters: The paper does not report the number of repeated runs or statistical variance for attack and defense evaluations on each benchmark; temperature and top-p sampling parameters are not specified for Claude Sonnet 5.
Summarize the main content of the paper
The paper proposes the state control framework SEAD, the attack DART, and the defense SAGE; experiments show that execution feedback and environment probing play key roles in attack-defense interaction.
- Paper Positioning: This study investigates the security of tool-calling language model agents from a partially observable state control perspective, proposing the state control formalization framework SEAD and corresponding attack method DART and pre-execution defense method SAGE.
- Core Problem Faced: In tool agents, attackers can decompose harm into seemingly benign multi-step operations, with harm ultimately manifested as persistent changes to the external environment state; each role has only partial observability, and lack of environmental state evidence makes it impossible to distinguish legitimate preparatory operations from harmful boundary crossings.
- Core Method Design: The attack method DART expands search on executed prefix trees, using real environment feedback from tool execution to guide branch expansion; the defense method SAGE intervenes before the pending action takes effect, obtaining state evidence through limited-step private read-only environment queries, and then makes a pass or intercept decision after eliminating state ambiguity.
- Key Experimental Results: On 187 malicious tasks, DART achieves Semantic ASR of 43.9%–73.3% and Hard ASR of 33.2%–54.7% on 4 target models, improving over the corresponding best baselines by 18.8–35.9 and 8.1–17.9 percentage points respectively (Table 2); in offline evaluation on a 75-task subset, SAGE achieves a 95.79% benign pass rate and a 34.55% precise closed-loop interception rate, with composite metrics F1 of 50.78% and F2 of 72.86% (Table 3); in online defense, SAGE reduces DART's Hard ASR against GPT-5.6 Luna from 48.0% to 4.0% (Figure 3), and demonstrates cross-domain defense capability on PostgreSQL and Web tasks not seen in training (Table 5).
- Author Conclusions and Implications: The authors argue that tool calling transforms agent security into a partially observable control problem centered on critical state transitions; relying solely on dialogue semantics or isolated actions is insufficient to reliably judge harm, and incorporating environmental state evidence and execution feedback into the attack-defense loop is a key path to improving agent security evaluation and defense capability.