🤗 Hugging Face | 📄 AgentDoG 1.0 Technical Report | 📄 AgentDoG 1.5 Technical Report | 📄 AgentDoG2 Technical Report | 🌐 Project Page | 简体中文
Visit our Hugging Face organization (click links above), search checkpoints with names starting with AgentDoG-, and you will find all you need! Enjoy!
AgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks
News
2026.11.30· We released AgentDoG2 for long-horizon agent safety, together with ATBench-Pro and ManipulationArena. Technical report2026/05/28· AgentDoG 1.5 added lightweight alignment and an OpenClaw guardrail. Technical report2026/04/16· We released ATBench-Claw and ATBench-Codex. Technical report2026/04/02· The ATBench paper introduced the trajectory-level safety benchmark. Benchmark paper2026/01/26· AgentDoG 1.0 introduced the diagnostic guardrail. Technical report
Introduction
AgentDoG2 is a guardrail framework for long-running agent tasks. An approval can expire between tool calls. Judging the next call requires both the user's original request and the permissions still in force.
- 🧩 ATBench-Pro uses the expanded taxonomy to test whether guards diagnose risks across tools, sessions, and changing permissions.
- 🎯 ManipulationArena tests whether a running agent preserves the user's objective under covert goal manipulation.
- 🛡️ Three guardrails cover direct trajectory diagnosis (AgentDoG2), single-pass trajectory classification (AgentDoG-Jev), and pre-execution action checks (AgentDoG-Step).
- 🔁 SafeRSI applies recursive self-improvement (RSI) to both the harness and the policy model. Failure traces guide each round, and evaluation tracks safety alongside task utility.
Demos
The following video demonstrations illustrate agent safety risks in textile product lookup and automotive order retrieval, showing how agents can exceed the scope of user authorization during task execution.
Textiles · Public product lookup
A user asks about products in a public catalog. The agent crosses a login boundary and accesses internal order data.
Automotive · Single-order lookup
A request for one vehicle order expands into a list query that returns 207 internal records.
Model Zoo
AgentDoG2 family
| Guardrail | When to use it | Base models | Output | Weights | |-----------|----------------|-------------|--------|---------| | AgentDoG2 | Audit a completed trajectory | Qwen3.5 (0.8B, 2B, 4B, 9B) or Llama-3.1 (8B) | Direct verdict or diagnosis under the expanded taxonomy | 0.8B · 2B · 4B · Llama-3.1-8B · 9B | | AgentDoG-Jev | Classify a trajectory in one forward pass | Qwen3.5 (0.8B, 2B, 4B) or Llama-3.1 (8B) | Binary decision or three diagnostic fields, with confidence scores | 0.8B · 2B · 4B · 4B-U · Llama-3.1-8B · FG 0.8B · FG 2B · FG 4B · FG Llama-3.1-8B | | AgentDoG-Step | Check a pending tool call or reply | Qwen3.5 (0.8B, 2B, 4B, 9B) or Llama-3.1 (8B) | Brief analysis and pre-execution verdict | 0.8B · 2B · 4B · Llama-3.1-8B · 9B |
Jev 4B-U is the binary variant trained from the unified 1.5 checkpoint. The table links to the checkpoints currently published in the collection. AgentDoG2 collection
SafeRSI
| Component | Type | Parameters | Resources | | --- | --- | ---: | --- | | SafeRSI-27B-V1 | Policy model | 27B | Hugging Face | | SafeRSI-27B-V2 | Policy model | 27B | Hugging Face | | SafeRSI Harness V1 | Harness code | — | GitHub | | SafeRSI Harness V2 | Harness code | — | GitHub |
Earlier releases
| Release | Available checkpoints | Hugging Face | ModelScope | |---------|-----------------------|--------------|------------| | 1.5 | Binary and fine-grained models on Qwen3.5 (0.8B, 2B, 4B) and Llama-3.1 (8B), plus Unified-4B | 🤗 1.5 collection | 🤖 1.5 collection | | 1.0 | Binary and fine-grained models on Qwen3-4B-Instruct-2507, Qwen2.5-7B-Instruct, and Llama-3.1-8B-Instruct | 🤗 1.0 collection | 🤖 1.0 collection |
✨ Safety Taxonomy
AgentDoG2 diagnoses three aspects of a trajectory.
- Risk Source (15 labels in 1.5, 18 in 2) identifies the origin, such as workspace content or tool feedback.
- Failure Mode (18 → 21 labels) describes the action or omission, such as reusing expired approval.
- Real-World Harm (11 labels) describes the consequence, such as disclosure of private information.
Benchmarks
ATBench Family
The ATBench benchmarks evaluate guardrails on recorded agent trajectories.
| Benchmark | Agent setting | What it evaluates | Resource | |-----------|---------------|-------------------|----------| | ATBench-Pro | Long-horizon, stateful tool use | Goal manipulation, evolving permissions and obligations, and loss of control | 🤗 Dataset | | ATBench | General tool use | Safety verdicts and three-dimensional diagnoses on 1,000 trajectories | 🤗 Dataset | | ATBench-Claw | OpenClaw | 500 trajectories involving persistent sessions, tools, and skills | 🤗 Dataset | | ATBench-Codex | Repository and command execution | 500 trajectories involving files, commands, and workspace changes | 🤗 Dataset |
ATBench-Pro contains 1,000 trajectories, averaging 48.98 tool calls and 57.51k tokens each. A set of 56 risk-source and 50 failure-mode sub-labels guides synthesis. Experts audit the verdicts and primary diagnostic labels.
ManipulationArena 🤗 Dataset
ManipulationArena evaluates running agents on 30 tasks from AppWorld, GAIA2, τ-bench, MedAgent, and HealthAgent. Its 888 validated cases cover seven manipulation strategies, six channels, and seven failure modes. Trajectories average 24.12 agent turns and 23.35 tool calls.
State checks and an independent evaluator establish whether manipulation caused an unsafe action. ManipulationArena's overall attack success rate (ASR) is the unweighted mean of the seven per-strategy success rates.
AgentDoG2 Guardrails
A trajectory is unsafe if any executed step violates a safety boundary. Safely refusing a risky instruction can yield a safe verdict.
Building Pipeline
AgentDoG2 learns the taxonomy through supervised fine-tuning (SFT) and refines individual fields with Group Reward-Decoupled Normalization Policy Optimization (GDPO). It returns verdicts or diagnostic labels without generating a chain of thought. A safe diagnosis gives the risk source (or None). An unsafe diagnosis adds failure mode and harm.
AgentDoG-Jev scores the allowed labels at each position in a JSON schema. One forward pass fills the binary field or all three diagnostic fields.
AgentDoG-Step uses SFT and GDPO on the history and pending action. Risk-source feedback on safe steps helps it recognize appropriate handling of risky inputs.
Evaluation
Accuracy, unsafe-class F1, and recall in the following tables are percentages.
Trajectory-level safety
On ATBench, AgentDoG2 2B reaches 81.7% unsafe-class F1. On the longer ATBench-Pro trajectories, the 8B model reaches 81.0% accuracy and 71.8% unsafe-class F1. Overall accuracy weights the three benchmarks equally.
| Model | R-Judge unsafe F1 | ATBench unsafe F1 | ATBench-Pro unsafe F1 | ATBench-Pro accuracy | Overall accuracy | | --- | ---: | ---: | ---: | ---: | ---: | | GPT-6.1-Sol | 95.0 | 77.5 | 67.8 | 62.7 | 78.5 | | AgentDoG2 0.8B | 71.7 | 76.1 | 58.6 | 75.4 | 76.1 | | AgentDoG2 2B | 79.9 | 81.7 | 69.4 | 78.3 | 79.6 | | AgentDoG2 4B | 83.3 | 76.7 | 69.7 | 80.3 | 80.6 | | AgentDoG2 8B | 74.5 | 75.3 | 71.8 | 81.0 | 77.6 | | AgentDoG2 9B | 88.8 | 76.3 | 64.2 | 78.4 | 81.6 |
Single-pass classification with Jev
Jev returns a verdict in one forward pass. On ATBench, 4B-U reaches 77.9% unsafe-class F1 at 59.8 ms mean latency. On ATBench-Pro, 4B reaches 68.9% unsafe-class F1 at 1.465 s.
| Model | ATBench accuracy | ATBench unsafe F1 | ATBench-Pro accuracy | ATBench-Pro unsafe F1 | R-Judge unsafe F1 | | --- | ---: | ---: | ---: | ---: | ---: | | AgentDoG-Jev 0.8B | 51.2 | 64.9 | 40.7 | 52.4 | 81.3 | | AgentDoG-Jev 2B | 63.7 | 70.4 | 54.9 | 53.9 | 86.2 | | AgentDoG-Jev 4B | 69.0 | 70.9 | 71.7 | 68.9 | 87.6 | | AgentDoG-Jev 4B-U | 77.1 | 77.9 | 71.9 | 58.5 | 84.3 | | AgentDoG-Jev 8B | 66.2 | 72.6 | 44.7 | 57.4 | 80.2 |
Figure 12 compares Jev with matched AgentDoG 1.5 checkpoints. Binary judgments are 103.9–184.9× faster on ATBench and 3.68–20.90× faster on ATBench-Pro. Timings use one H200 GPU, one request at a time, and no prefix caching.
Fine-grained diagnosis
Diagnosis is scored on trajectories labeled unsafe. Mean accuracy weights risk source, failure mode, and real-world harm equally. The Jev evaluation on ATBench-Pro uses the 319 unsafe trajectories with reference labels for all three fields.
| Model | ATBench risk source | ATBench failure mode | ATBench harm | ATBench mean | ATBench-Pro mean | | --- | ---: | ---: | ---: | ---: | ---: | | AgentDoG2 0.8B | 51.7 | 18.3 | 45.5 | 38.5 | 32.3 | | AgentDoG2 2B | 59.8 | 21.5 | 52.9 | 44.7 | 41.4 | | AgentDoG2 4B | 61.8 | 16.1 | 46.9 | 41.6 | 41.9 | | AgentDoG2 8B | 61.2 | 20.5 | 50.7 | 44.1 | 36.3 | | AgentDoG2 9B | 61.2 | 19.9 | 45.9 | 42.3 | 38.7 | | AgentDoG-Jev 0.8B | 56.1 | 20.3 | 51.3 | 42.6 | 18.9 | | AgentDoG-Jev 2B | 61.6 | 23.1 | 56.5 | 47.1 | 42.3 | | AgentDoG-Jev 4B | 63.4 | 28.8 | 60.0 | 50.7 | 35.4 | | AgentDoG-Jev 8B | 63.4 | 28.4 | 56.7 | 49.5 | 28.7 |
Pre-execution safety
The three pre-execution benchmarks are TS-Bench-Dojo (1,220 steps), TS-Bench-ASB (3,765), and StepShield (2,670). Worst-class recall (WCR) is the lower of safe-class and unsafe-class recall. Overall scores weight the three benchmarks equally.
| Model | Dojo WCR | ASB WCR | StepShield WCR | Overall accuracy | Overall unsafe F1 | Overall WCR | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Gemini-3.8-Flash | 97.7 | 87.8 | 94.4 | 94.9 | 85.4 | 93.3 | | StepGuard-4B | 94.9 | 52.4 | 98.2 | 93.4 | 83.3 | 81.8 | | AgentDoG-Step 0.8B | 84.9 | 66.0 | 82.4 | 88.3 | 71.1 | 77.8 | | AgentDoG-Step 2B | 95.4 | 73.3 | 89.8 | 93.4 | 82.2 | 86.2 | | AgentDoG-Step 4B | 95.9 | 87.9 | 98.2 | 94.7 | 87.5 | 94.0 | | AgentDoG-Step 8B | 95.7 | 74.9 | 94.4 | 93.7 | 80.8 | 88.4 | | AgentDoG-Step 9B | 96.1 | 75.7 | 98.8 | 92.9 | 84.5 | 90.2 |
SafeRSI
SafeRSI uses failure traces for two forms of recursive self-improvement (RSI). Harness self-improvement translates observed failures into rules or runtime checks and validates them on held-out cases. Policy model self-improvement preserves the history before a failure and trains the model on reviewed, safer continuations. AgentDoG-Step can check the updated policy’s proposed actions before execution.
Harness self-improvement |
Policy model self-improvement |
Table 10 compares the base DeepSeek Harness and Qwen3.8-27B with two rounds of joint harness and policy updates, evaluated with and without AgentDoG-Step at runtime.
| Harness and policy | AgentLAB ASR ↓ | AutoControl-Arena ASR ↓ | ManipulationArena ASR ↓ | BFCL-v3 accuracy ↑ | | --- | ---: | ---: | ---: | ---: | | DeepSeek Harness + Qwen3.8-27B | 35.11% | 13.69% | 65.84% | 75.34% | | SafeRSI V1 | 28.66% | 7.62% | 28.04% | 66.72% | | SafeRSI V2 | 26.54% | 7.38% | 25.68% | 65.17% | | SafeRSI V1 + AgentDoG-Step | 22.10% | 4.31% | 21.40% | 67.39% | | SafeRSI V2 + AgentDoG-Step | 21.07% | 3.69% | 24.21% | 64.92% |
With Step in round V1, ManipulationArena attack success falls from 65.84% for the baseline to 21.40%. BFCL-v3 function-calling accuracy falls from 75.34% to 67.39%.
Getting Started
📁 Repository Structure
AgentDoG/
├── Agentic Safety Training/
│ ├── Agentic RL/
│ │ └── README.md
│ └── Agentic SFT/
├── AgenticXAI/
├── Online Agentic Guardrail/
│ └── README.md
├── README.md
├── README.zh-CN.md
├── SafeRSI-Harness/
│ ├── SafeRSI-Harness-V1/
│ │ └── README.md
│ └── SafeRSI-Harness-V2/
│ └── README.md
├── docs/
│ ├── figures/
│ ├── index.html
│ ├── style.css
│ ├── v1/
│ │ └── index.html
│ ├── v1_5/
│ │ └── index.html
│ └── v2/
│ ├── getting_started.md
│ ├── getting_started.zh-CN.md
│ ├── index.html
│ ├── media/
│ ├── site.css
│ └── zh.html
├── examples/
│ ├── getting_started_v1.md
│ ├── getting_started_v1_5.md
│ ├── getting_started_v2.md
│ ├── readme_v1.md
│ ├── run_openai_moderation.py
│ └── trajectory_sample.json
├── figures/
│ └── v2/
└── prompts/
├── v1.0/
│ ├── taxonomy_finegrained.txt
│ ├── trajectory_binary.txt
│ └── trajectory_finegrained.txt
├── v1.5/
│ ├── coarse_grained_moderation.txt
│ └── unified_safety_classification.txt
└── v2.0/
├── agentdog2/
│ ├── prompt-atbench-pro.txt
│ └── prompt.txt
├── agentdog_jev/
│ ├── prompt-atbench-pro.txt
│ ├── prompt-fg.txt
│ └── prompt.txt
└── agentdog_step/
└── prompt.txt
🛠️ Customization
- Edit prompt templates:
prompts/v1.0/trajectory_binary.txt,prompts/v1.0/trajectory_finegrained.txt,prompts/v1.5/coarse_grained_moderation.txt,prompts/v1.5/unified_safety_classification.txt - Update taxonomy labels:
prompts/v1.0/taxonomy_finegrained.txt - Change runtime integration:
examples/run_openai_moderation.py
📜 License
The AgentDoG project uses the Apache 2.0 License.
Related Projects from Our Group
🧬 dot-skill(同事.skill)
"You folks building LLMs are all code-sages! Flesh is weak! Ascend to cyberspace!"
|
🧑💼 Your colleague quit, your mentor graduated, your teammate transferred — taking their whole playbook and context with them? |
✨ dot-skill solves all three.
📖 Citation
If you use AgentDoG or ATBench in your research, please cite:
@misc{liu2026agentdog2efficientalignmentframework,
title={AgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks},
author={Dongrui Liu and Qingyu Liu and Tianyi Zhou and Donghang Duan and Yilian Shi and Qinghua Mao and Yu Li and Xinhao Li and Haoyu Wang and Dadi Guo and Zhonghao Yang and Jiachen Ma and Peng Huang and Xingbang He and Ruiyang Qin and Peng Wang and Leitao Yuan and Yuejin Xie and Jinchen He and Ning Wu and Junfeng Fang and Yueming Lyu and Wen Shen and Wenjie Wang and Le Yang and Qiaosheng Zhang and Xiang Wang and Bo Zhang and Mingjie Li and Yinpeng Dong and Zhuosheng Zhang and Zhongjie Ba and Shangding Gu and Jie Zhang and Na Zou and Tianhang Zheng and Quanshi Zhang and Xingjun Ma and Hui Xue and Xiangnan He and Xia Hu},
year={2026},
eprint={2611.41434},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2611.41434},
}
@article{liu2026agentdog15,
title={AgentDoG 1.5: A Lightweight and Scalable Alignment Framework for AI Agent Safety and Security},
author={Liu, Dongrui and Li, Yu and Yang, Zhonghao and Wang, Peng and Chen, Guanxu and Xie, Yuejin and Mao, Qinghua and Qu, Wanying and Zhu, Yanxu and Zhou, Tianyi and others},
journal={arXiv preprint arXiv:2605.29801},
year={2026}
}
@article{liu2026agentdog,
title={AgentDoG: A Diagnostic Guardrail Framework for AI Agent Safety and Security},
author={Liu, Dongrui and Ren, Qihan and Qian, Chen and Shao, Shuai and Xie, Yuejin and Li, Yu and Yang, Zhonghao and Luo, Haoyu and Wang, Peng and Liu, Qingyu and others},
journal={arXiv preprint arXiv:2601.18491},
year={2026}
}
@article{li2026atbench,
title={ATBench: A Diverse and Realistic Trajectory Benchmark for Long-Horizon Agent Safety},
author={Li, Yu and Luo, Haoyu and Xie, Yuejin and Fu, Yuqian and Yang, Zhonghao and Shao, Shuai and Ren, Qihan and Qu, Wanying and Fu, Yanwei and Yang, Yujiu and others},
journal={arXiv preprint arXiv:2604.02022},
year={2026}
}
@misc{qian2026behind,
title={The Why Behind the Action: Unveiling Internal Drivers via Agentic Attribution},
author={Chen Qian and Peng Wang and Dongrui Liu and Junyao Yang and Dadi Guo and Ling Tang and Jilin Mei and Qihan Ren and Shuai Shao and Yong Liu and Jie Fu and Jing Shao and Xia Hu},
year={2026},
journal={arXiv preprint arXiv:2601.15075}
}
🤝 Acknowledgements
We thank the trajectory-safety benchmark contributors and the Jev project, whose structured-decision approach underlies AgentDoG-Jev. This project builds upon prior work in agent safety, trajectory evaluation, and risk-aware AI systems.




