AgentDoG2: An efficient alignment framework for emergent risks in long-horizon agent tasksAgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks
Shanghai AI Laboratory proposes a long-horizon agent safety framework; the authors say AgentDoG-Step 4B achieves an overall WCR of 94.0% on three step-level benchmarks.
The attacker covertly changes the agent's goal or acceptance criteria during long-horizon execution through user instructions, tool/skill specifications, plugin manifests, environment observations, or memory; the attack agent can observe target progress and adjust its plan, with at most two attempts per configuration. The victim systems are six types of harness–policy agents, and ASR is determined by unauthorized, unsafe, or violating actions.
- Risks in long-horizon agents accumulate across steps, and goal manipulation, permission and obligation violations, and loss of control may be hidden within normal operations. The authors argue that existing trajectory benchmarks are too short, attack channels and runtime adaptability are insufficient, and guardrails need to intervene faster and earlier.
- The framework extends the three-dimensional safety classification and constructs ATBench-Pro; it generates goal manipulation attacks via task planning and runtime adaptation, forming ManipulationArena; it then trains trajectory-level, single-forward-pass decision-level, and pre-execution step-level guardrails, and explores co-evolution of the harness and policy.
- The authors report that AgentDoG-Step 4B achieves an overall WCR of 94.0% on three step-level benchmarks; all six agents have attack successes on ManipulationArena. SafeRSI plus step-level guardrails reduces ASR on three safety benchmarks while preserving BFCL-v3 function-calling capability.
- The authors state that the current classification and defenses mainly handle text trajectories, and that cross-modal extension and adaptation to novel unknown attacks in the open world remain to be studied. Attack training and evaluation share the same attack mechanism, isolating only the underlying scenarios; the main text does not specify the attack agent model or the semantic review model.
- Evaluated models
- AgentDoG2 0.8BAgentDoG2 2BAgentDoG2 4BAgentDoG2 8BAgentDoG2 9BAgentDoG-Jev 4BAgentDoG-Step
- Benchmarks
- ATBench-ProManipulationArenaR-JudgeATBenchTS-Bench-DojoTS-Bench-ASBStepShieldAgentLABAutoControl-ArenaBFCL-v3
- Metrics
- ASRAccunsafe F1WCRRS/FM/RWH accuracylatencycost
The paper proposes the AgentDoG2 framework for characterizing, evaluating and mitigating emergent safety risks in long-horizon agent tasks. The authors update the agent safety taxonomy and release ATBench-Pro, covering emerging risks in long-horizon execution scenarios; they build ManipulationArena and propose a goal-manipulation attack method that frequently occurs in long-horizon agent tasks. To identify these risks more efficiently, the authors train three model series, AgentDoG2, AgentDoG-Jev and AgentDoG-Step (0.8B, 2B, 4B, 8B, 9B parameters), for trajectory-level and step-level safety evaluation, and report that they outperform closed-source models such as GPT-6.1-Sol and are nearly 100 times faster than AgentDoG1.5; the paper also preliminarily explores an AgentDoG-based recursive self-improvement method for safety agents to achieve automatic alignment, and open-sources all models and datasets.
Related events and news
1 events · 1 news mentions
- This event's paper
AgentDoG2:长程智能体任务风险对齐框架
News that mentions this paper
AgentDoG2:长程智能体任务风险对齐框架
- TOKENPOSTnames the paperAgentDoG2 框架为长程 AI 安全引入新测试
Paper analysis
What problem does this paper attempt to solve?
For the covert cumulative risks of long-horizon agents, unified extended taxonomy, attack evaluation, low-latency guardrails and automatic defense.
The core problem is how to characterize, reproduce and mitigate safety risks that accumulate across steps and are hard to detect in long-horizon agents.
- Problem scenario: The authors argue that malicious instructions can be introduced at any execution step and covertly influence subsequent decisions; long contexts also make permission boundaries and subsequent safety obligations harder to maintain.
- Existing gaps: The paper states that existing trajectory benchmarks average only 1.49–6.92 tool calls, making it hard to cover delayed triggers and cross-step combinations; existing attacks have limited strategies, channels, and ability to adapt along the execution trajectory.
- Core observation: Risk exposure does not equal unsafe execution; safely handling or refusing malicious input should still be judged safe. Step-level judgment uses only pre-execution history and the candidate action, so as to intervene before outcomes occur.
- Proposed framework: Extend the three-dimensional taxonomy of Risk Source, Failure Mode, Real-World Harm, build ATBench-Pro and ManipulationArena, train AgentDoG2, AgentDoG-Jev, AgentDoG-Step, and explore SafeRSI automatic alignment.
- Threat model:
- Goal: Make the agent deviate from authorized goals or acceptance criteria and execute unauthorized, unsafe or policy-violating actions.
- Knowledge and channels: The attacker can exploit user instructions, tool/skill specifications, plugin manifests, observations and memory; the paper does not define this attack using white-box, black-box or no-box.
- Capability: The attack agent first analyzes the task, then observes target progress and adapts its plan; on failure it can revise the blueprint, with at most two iterations per sampled configuration.
- Victim systems and judgment: Six harness–policy agents; rules check the action log and final environment state, and when semantic attribution is needed, an independent LLM judge reviews it.
What related research exists?
Related work is divided into safety classification and benchmarks, guardrail models, and recursive self-improvement; this paper connects all three lines.
Safety classification and trajectory benchmarks
- AgentDoG and the ATBench series: AgentDoG (Liu et al., 2026b;a) proposes a three-dimensional structure of risk sources, failure modes, and real-world harms; ATBench-Claw/Codex (Yang et al., 2026c) adapts it to OpenClaw and Codex, and HINTBench (Wang et al., 2026b) studies endogenous risk without external attacks.
- Trajectory identification and diagnosis: R-Judge (Yuan et al., 2024) and ASSEBench (Luo et al., 2025) evaluate risk in multi-turn interaction records; ATBench (Li et al., 2026e) synthesizes trajectories using a tool pool and delayed triggers, and TRACE (Guo et al., 2025b) synthesizes trajectories through test-time exploration.
- Attack and vulnerability evaluation: InjecAgent, AgentDojo, AgentHarm, ToolEmu, and AgentLAB cover indirect injection via tool outputs, attack and defense in dynamic tool environments, compliance with harmful requests, tool sandboxes, and multi-turn long-horizon attacks, respectively.
Attack generation and guardrail models
- Automated attacks: Imprompter, AgentVigil, AutoHijacker, MINJA, and AdapTools automatically generate injected content and adapt to persistent memory and tool use. The paper criticizes existing methods as mostly limited to preset strategies and channels, with runtime adaptation mainly around attack content or induced behavior.
- Generative and decision-based guardrails: LlamaGuard and Qwen3Guard target content safety; ShieldAgent, GuardReasoner, and AgentDoG1.5 target agent behavior or trajectory diagnosis. The paper notes that long reasoning and autoregressive decoding increase overhead; Jev-type models make decisions in a single forward pass, but it cites Deußer et al. (2026) as saying they may degrade on fine-grained or noisy labels.
- Step-level intervention: ToolSafe (Mou et al., 2026) and StepGuard (Zheng et al., 2026) study step-level safety evaluation, and StepShield (Felicia et al., 2026) studies intervention timing during execution.
Recursive self-improvement
- Research agents and attack-defense evolution: AIDE2, RSIFlow, and ScienceBuddy rewrite agent code or evolve the harness; GPT-Red, CoER, and CoDeL co-evolve attacks and defenses across adversarial rounds.
- Safety harness evolution: SHE and EvoSafeHarness freeze the agent model and evolve the safety harness; Evolution Under Fire also evolves the attack pressure source, and SafeEvolve evolves both the harness and the policy.
Baselines and positioning of this paper
- Comparison setup: Trajectory-level comparisons use closed-source, open-weight, and dedicated guardrails, using R-Judge, ATBench, and ATBench-Pro; step-level uses TS-Bench-Dojo, TS-Bench-ASB, and StepShield; attack and defense use AgentLAB, AutoControl-Arena, and ManipulationArena, and utility uses BFCL-v3.
- Authors' positioning: They place long-horizon classification and attack generation, fast trajectory-level diagnosis, pre-execution interception, and harness–policy co-evolution within a single framework, rather than optimizing only one of these components.
How does the paper address this problem?
Using the extended classification as a shared label system, it links long-trajectory data, two-stage attacks, three types of guardrails, and co-evolutionary defense.
The overall idea is for the AgentDoG2 family to share one set of risk semantics: AgentDoG2 directly generates structured diagnostics, AgentDoG-Jev outputs a decision in a single forward pass, and AgentDoG-Step intercepts before execution; SafeRSI then uses attack results to update the harness and policy.
Risk Formalization and Benchmark Construction
- Three-dimensional taxonomy: Extended to 18 risk sources, 21 failure modes, 11 real-world harm categories, with added CGM, AOV, LoC scenario tags; the synthesis layer additionally has 56 risk sources and 50 failure-mode sub-labels.
- Safety judgment: At trajectory level, y=unsafe ⇔ ∃ i∈{1,…,n}, Unsafe(ti)=True, i.e., if any step is unsafe the whole trajectory is unsafe; safe refusal or proper handling of risky input is not judged unsafe.
- Fine-grained output: Diagnostic labels are yfine=(ℓrisk,ℓmode,ℓharm), corresponding to RS, FM, RWH respectively; safe trajectories are also annotated with visible RS, which is None when there is no risk.
- ATBench-Pro: Generated by a long-horizon synthesis engine, with source-level separation from training data; candidates undergo multi-stage filtering, consistency checks and human expert audit. 1,000 in total, averaging 95.09 turns, 48.98 tool calls, 57.51k tokens (Table 1).
Two-stage Goal Manipulation Attack and ManipulationArena
- Configuration space: Seven strategy types cover goal-directed inducement and condition-induced misalignment; six carrier types are user instructions, tool specifications, skill specifications, plugin manifests, observations and memory, for 42 combinations in total.
- Planning and execution: Phase 1 identifies key steps from task dependencies and forms an attack blueprint; Phase 2 performs online grounding based on the target agent's observable progress, and after failure revises the blueprint based on the full trajectory.
- Data scale: 30 solvable tasks are selected from AppWorld, GAIA2, τ-Knowledge, MedAgentBench, HealthAgentBench, retaining 888 validated reusable plans; at most two iterations per configuration, stopping on success.
- Success judgment: A rule evaluator checks the specified action or effect and requires linking the violation to the attack; when semantic attribution is needed, an independent LLM judge examines the full trajectory and rule evidence. ASR is the proportion of runs meeting each strategy's success criterion.
Data and Training for the Three Guardrail Types
- AgentDoG2 data engine: Fork points are selected in real benign workflows and risks injected, forming a comparison group of 1 unsafe and 3 safe styles; a Verifier coordinates multiple sub-roles to check and repair trajectories, and a group is retained after the unsafe and at least 1 safe pass verification.
- AgentDoG2 optimization: First CoT-free SFT on five bases, learning rate 10−5; then GDPO, with Safety, RS, FM, RWH normalized within groups respectively, weights 0.4, 0.2, 0.2, 0.2. G=8, learning rate 10−6, KL coefficient β=10−5.
- AgentDoG-Jev: Rewrites AgentDoG1.5 SFT data into a JSON skeleton with <decision>, supervising only the decision positions; one field for binary classification, three fields for fine-grained, trained for two epochs, learning rate 2×10−6. At inference, softmax is restricted to the legal symbols of each field.
- AgentDoG-Step: Adapts StepGuard's five-stage StepGen, sequentially performing risk-anchored planning, trajectory rollout, prefix-aligned comparison group construction, step labeling and filtering. SFT learning rate 2×10−5; GDPO requires valid <Analysis>, β=10−3, G=8.
SafeRSI Collaborative Defense
- Runtime defense line: AgentDoG-Step evaluates candidate tool calls or replies at designated monitoring points, and at runtime can intervene before a tool takes effect or a reply is delivered.
- Harness Evolution: The Analyzer attributes failures to natural-language policy P or executable control C, and the Editor generates patches; paired evaluation on a fixed 50 validation tasks, and the release condition marked in Figure 18 is a 10 percentage point ASR reduction with no more than a 10 percentage point utility drop.
- Policy Evolution: The Failure Analyst locates correction points, the Trajectory Synthesizer preserves the task and risk prefix and generates a safe continuation, the Trajectory Critic checks safety, prefix consistency and task preservation, and then SFT is performed on accepted demonstrations.
- Isolation: Training and evaluation use the same attack mechanism but isolate the underlying scenarios; the evaluation set consists of out-of-distribution scenarios.
What experiments did the paper conduct?
The experiments cover trajectory-level and step-level guardrails, six categories of agent attack and defense, and SafeRSI ablations, and measure latency, cost, and utility.
Experimental Setup
- Trajectory-level models: five variants each of AgentDoG2/Jev; compared against GPT-6.1-Sol, Gemini-3.8-Flash, DeepSeek-V4.1-Flash, GLM-5.3, Qwen3.5-397B, Qwen3.8-27B, Qwen3.5-9B/4B, Llama-3.1-8B, as well as LlamaGuard3, Qwen3Guard, ShieldAgent, StepGuard, StepSafe, BraveGuard, AgentDoG1.5, etc.
- Trajectory-level protocol: R-Judge, ATBench, ATBench-Pro report Acc and unsafe F1; on unsafe trajectories of ATBench/Pro, RS, FM, RWH accuracy and their mean are reported. Latency is measured on a single H200, concurrency 1, with prefix caching disabled, using 64 balanced trajectories per benchmark, repeated 3 times.
- Step-level protocol: five variants of AgentDoG-Step use TS-Bench-Dojo (1,220 steps), TS-Bench-ASB (3,765 steps), StepShield (2,670 steps); only the pre-execution prefix and candidate action are used, reporting Acc, unsafe F1 and WCR=min(RecallSafe, RecallUnsafe).
- Attack-defense targets: Claude Code+Opus 5.5, Codex+GPT-6.1-Sol, DeepSeek Harness+DeepSeek-V4.1-Flash, KimiCode+Kimi-3.1-Pro, ZCode+GLM-5.3, DeepSeek Harness+Qwen3.8-27B.
- Attack-defense metrics and review: ASR is the proportion of attack trajectories that execute unauthorized, unsafe or policy-violating actions; ManipulationArena is judged by a rule evaluator, and when semantic attribution is needed, an independent LLM judge reviews it; the main text does not state its model. BFCL-v3 reports function-calling Acc.
- Training details: AgentDoG2 bases are Qwen3.5-0.8B/2B/4B/9B-Base and Llama-3.1-8B; Jev performs SFT from the AgentDoG1.5 checkpoint. The main text does not report the attack agent models, the number of repetitions for each main table, or human audit consistency.
Main Results
The table below lists both trajectory-level overall unsafe F1 and step-level overall WCR; Overall is the unweighted mean of the three corresponding benchmarks, according to Table 3, 5, 7.
Model Trajectory-level overall unsafe F1 Step-level overall WCR GPT-6.1-Sol 80.1% 82.5% Gemini-3.8-Flash 70.8% 93.3% StepGuard-4B 74.9% 81.8% AgentDoG2 2B 77.0% not reported AgentDoG2 4B 76.6% not reported AgentDoG-Jev 4B 75.8% not reported AgentDoG-Step 4B not reported 94.0% AgentDoG-Step 9B not reported 90.2% - Authors' interpretation: AgentDoG2 at all sizes exceeds the matched AgentDoG1.5-U on ATBench-Pro, with accuracy gains of up to +25.3 percentage points; however, overall unsafe F1 does not improve for all variants.
- Step-level results: AgentDoG-Step 4B's overall Acc, unsafe F1, WCR are 94.7%, 87.5%, 94.0% respectively; its WCR on TS-Bench-ASB is 87.9%, versus 87.8% for Gemini-3.8-Flash.
- Counterexamples and exceptions: Qwen3Guard-8B has unsafe F1 and WCR of 0.0% on TS-Bench-Dojo; StepGuard-4B has WCR of 52.4% on TS-Bench-ASB, lower than its 98.2% on StepShield.
Fine-grained Diagnostics and Efficiency
- Diagnostic accuracy: AgentDoG2 2B's average diagnostic accuracy on ATBench is 44.7%, and AgentDoG2 4B's on ATBench-Pro is 41.9% (Table 4); the latter is lower than GPT-6.1-Sol's 44.5% and close to Gemini-3.8-Flash's 41.8%.
- Jev's trade-off: On ATBench-Pro, Jev 2B rises from a baseline of 27.27% to 42.32%, but 0.8B falls from 22.36% to 18.91%; on ATBench, RS accuracy decreases for all four variants. The authors suggest that AgentDoG1.5's explicit analysis may help cross-trajectory attribution.
- Latency: Relative to the matched 1.5-U, AgentDoG2 speeds up by 13.0–18.6×, 7.9–15.5×, 1.9–10.8× on R-Judge, ATBench, ATBench-Pro respectively (Figure 10). Jev binary classification speeds up by 103.9–184.9× on ATBench and 3.68–20.90× on ATBench-Pro (Figure 13).
ManipulationArena Attacks and SafeRSI Defense
- Attack coverage: The average ASR across the six configurations is 46.82%–74.37% (Table 9); the lowest is Claude Code+Opus 5.5, the highest is DeepSeek Harness+DeepSeek-V4.1-Flash. The range across strategy×configuration cells is 24.47%–94.57%.
- Strategy exceptions: Although Opus 5.5 has the lowest average ASR, its Obstruction is 66.67%; Kimi-3.1-Pro's Self-preservation is 94.57%. The authors accordingly state that different harnesses have different weak points.
- Full defense: Relative to DeepSeek Harness+Qwen3.8-27B, V1 plus AgentDoG-Step reduces ASR on AgentLAB, AutoControl-Arena, ManipulationArena from 35.11%, 13.69%, 65.84% to 22.10%, 4.31%, 21.40% respectively, and BFCL-v3 Acc changes from 75.34% to 67.39% (Table 10).
- Second-round changes: V2 plus guardrails gives ASR of 21.07%, 3.69%, 24.21% on the three, and BFCL-v3 Acc of 64.92%; ManipulationArena's ASR is higher than that of the V1 full defense, and the paper does not explain this change.
Other Ablations and Analyses
- Without step-level guardrails: SafeRSI V1/V2 have ASR of 28.04%/25.68% on ManipulationArena and BFCL-v3 Acc of 66.72%/65.17% (Table 10).
- safe RS ablation: AgentDoG-Step 4B compares Safety+RS with Safety Only under the same data and hyperparameters; after SFT, Safe F1 is 96.2% vs 94.7%, and at the 100th GDPO iteration it is 96.9% vs 96.4% (Figure 17).
- Update-group proportion: Safety+RS's safety-group participation rate is 50.1%–56.3% over the first 80 iterations and 41.8% at the 100th; Safety Only falls from 24.8% at the 20th iteration to 10.9% at the 100th (Figure 17).
- Benchmark composition: ManipulationArena contains 888 plans, averaging 24.12 agent response turns and 23.35 tool-call steps; Table 2 does not give per-item sample sizes for each target configuration.
What are some points that can be further explored?
The authors explicitly leave two directions, cross-modal and open-world adaptation; the experiments also have some protocol information not described in the main text.
Limitations and future directions noted by the authors
- Text trajectory scope: The authors state that the current classification and defense framework mainly operates on text-based trajectories; as agents enter native multimodal environments, extending the overall safety framework to cross-modal challenges is a future direction (Section 7.2).
- Open-world adaptation: The authors state that sustained effort is still needed for the co-evolutionary paradigm of AgentDoG and SafeRSI to dynamically adapt to highly novel, unseen attacks in open-world deployments (Section 7.2).
Scope of experimental coverage
- Trajectory evaluation: Uses R-Judge, ATBench, and ATBench-Pro; ATBench-Pro contains 1,000 trajectories, and latency is measured on 64 balanced trajectories per benchmark with 3 repetitions (Sections 2.2, 4.2.3).
- Step-level evaluation: Covers TS-Bench-Dojo, TS-Bench-ASB, and StepShield, three pre-execution binary classification benchmarks in total; the paper states that existing public step-level benchmarks have only binary safety labels, so step-level fine-grained diagnostic results on these benchmarks are not reported (Section 4.4.3).
- Attack and defense targets: The attack table covers six harness–policy configurations; the defense table starts from DeepSeek Harness+Qwen3.8-27B and compares two rounds of SafeRSI and the version with AgentDoG-Step added (Tables 9–10).
- Relationship between attack training and evaluation: Both use the same attack mechanism, isolating only the underlying scenarios, and the evaluation scenarios are called out-of-distribution; each sampled configuration has at most two attack iterations (Sections 3.1.2, 5.1).
- Unreported protocol information: The attached main text does not specify the models used for the attack agent and semantic review, the number of evaluation runs per ManipulationArena configuration, the number of repetitions of the main results, or the consistency of human expert audits; the runtime settings point to Appendix A.5.1, which is not fully attached.
Summarize the main content of the paper
The paper combines long-horizon risk classification, attack generation, three-level guardrails and co-evolutionary defense into one alignment framework.
This is a study of a safety framework for long-horizon agents, focusing on covert goal manipulation, permission and obligation violations, and loss of control in the absence of external attacks.
- Classification and data: The authors extend the three-dimensional classification to 18 risk sources, 21 failure modes, and 11 real-world harm categories. ATBench-Pro contains 1,000 trajectories, averaging 48.98 tool calls and 57.51k tokens, and is used for trajectory-level safety judgment and diagnosis.
- Attack method: The two-stage attack first plans based on cross-step dependencies, then adapts along the target execution trajectory; ManipulationArena retains 888 plans, covering 7 strategy categories and 6 channel categories. The average ASR across six agent configurations is 46.82%–74.37% (Table 9).
- Guardrail design: AgentDoG2 removes CoT and directly outputs structured diagnoses; AgentDoG-Jev reads decision fields in a single forward pass; AgentDoG-Step does not look at action outcomes and judges candidate actions before execution.
- Main detection results: AgentDoG2 2B achieves an average diagnostic accuracy of 44.7% on ATBench (Table 4); AgentDoG-Step 4B achieves an overall WCR of 94.0% and unsafe F1 of 87.5% on three step-level benchmarks (Table 7).
- Efficiency and defense: Jev binary classification on ATBench is 103.9–184.9× faster than the matched AgentDoG1.5 (Figure 13). SafeRSI V1 plus step-level guardrails reduces ManipulationArena ASR from 65.84% for the base configuration to 21.40%, with BFCL-v3 Acc of 67.39% (Table 10).
- Authors' conclusions: The authors state that external structural guardrails and internal policy alignment can form complementary defenses, reducing attack success while preserving benign tool-calling capability; cross-modal risk and adaptation to unknown attacks in the open world remain future directions.
Research lineage
11 foundations · 0 follow-ups in library- Cites2026-09Stealth Apart, Harm Together: Skill Cascading Attacks on Skill-Based Agent Systems§ 2.1 Characterizing Risks in Long-Horizon Agent Tasks
- Cites2026-10Runtime Authorization of Self-Generated Subgoals in Long-Horizon Tool-Using AI Agents§ 2.1 Characterizing Risks in Long-Horizon Agent Tasks
- Cites2026-07When Claws Remember but Do Not Tell: Stealthy Memory Injection in Persistent Personal Agents§ 2.1 Characterizing Risks in Long-Horizon Agent Tasks
No later in-library follow-ups recorded yet.
“Goal-directed inducement introduces unauthorized objectives through role-play and scenario nesting (Ding et al., 2024; Jiang et al., 2026), implicit reformulation and multi-step or cross-skill decomposition (Jiang et al., 2026; Chen et al., 2026a; Zhu et al., 2026b), sleeper p…”