Text Generation
Transformers
Safetensors
qwen3_5
image-text-to-text
agent-safety
guardrail
agentdog
long-horizon
conversational
Run this model with HF Jobs
Run AI45Research/AgentDoG-Step-Qwen3.5-4B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use AI45Research/AgentDoG-Step-Qwen3.5-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI45Research/AgentDoG-Step-Qwen3.5-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AI45Research/AgentDoG-Step-Qwen3.5-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("AI45Research/AgentDoG-Step-Qwen3.5-4B") model = AutoModelForMultimodalLM.from_pretrained("AI45Research/AgentDoG-Step-Qwen3.5-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AI45Research/AgentDoG-Step-Qwen3.5-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI45Research/AgentDoG-Step-Qwen3.5-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI45Research/AgentDoG-Step-Qwen3.5-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AI45Research/AgentDoG-Step-Qwen3.5-4B
- SGLang
How to use AI45Research/AgentDoG-Step-Qwen3.5-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "AI45Research/AgentDoG-Step-Qwen3.5-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI45Research/AgentDoG-Step-Qwen3.5-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "AI45Research/AgentDoG-Step-Qwen3.5-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI45Research/AgentDoG-Step-Qwen3.5-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AI45Research/AgentDoG-Step-Qwen3.5-4B with Docker Model Runner:
docker model run hf.co/AI45Research/AgentDoG-Step-Qwen3.5-4B
Complete AgentDoG 2.0 documentation and align project title
Browse files7 unmodified lines89101112131415161718192021222324258 unmodified lines3435363738394021 unmodified lines62636465666768697071727374757677787980817 unmodified lines- agent-safety- guardrail- safetensors---# AgentDoG-Step-Qwen3.5-4BAgentDoG-Step is a guard model for AI agents. It checks a proposed tool call beforeexecution or an assistant reply before it is sent. Given the visible interactionhistory and a candidate action, it returns a short rationale, a Safe/Unsafe verdict,and the risk source. Unsafe actions also receive a failure mode and risk consequence.[AgentDoG model collection](https://huggingface.co/collections/AI45Research/agentdog20)## QuickstartServe the model with vLLM.8 unmodified linescd ./step-example```Send the example as a single user message. Use the [input schema](input.schema.json)to format your own cases, including only evidence available at the decision point.```python21 unmodified linesprint(parse_response(answer))```## EvaluationStep-level Safety results from Table 7 of the AgentDoG 2.0 report.| Benchmark | Accuracy (%) | Unsafe F1 (%) | WCR (%) || --- | ---: | ---: | ---: || TS-Bench-Dojo | 96.2 | 93.6 | 95.9 || TS-Bench-ASB | 89.1 | 82.1 | 87.9 || StepShield (pre-action) | 98.8 | 86.9 | 98.2 || Overall | 94.7 | 87.5 | 94.0 |WCR is the smaller of Safe and Unsafe recall. Overall is the unweighted meanacross the three benchmarks.## LicenseReleased under the [Apache 2.0 License](LICENSE).7 unmodified lines891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161178 unmodified lines12612712812913013113221 unmodified lines1541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233247 unmodified lines- agent-safety- guardrail- safetensors- agentdog- long-horizon---# AgentDoG 2.0: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks<p align="center"><img src="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/assets/family.webp" width="95%" alt="AgentDoG 2.0, AgentDoG-Jev and AgentDoG-Step family overview" /></p><p align="center">🐙 <a href="https://github.com/AI45Lab/AgentDoG"><b>GitHub</b></a> | 🤗 <a href="https://huggingface.co/collections/AI45Research/agentdog20-6b09556a028a2ce10c53f2fe"><b>Models and Datasets</b></a> | 🌐 <a href="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/"><b>Project Page</b></a> | 🎬 <a href="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#demos"><b>Demos</b></a> | 📊 <a href="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#benchmarks"><b>Benchmarks</b></a> | 🛡️ <a href="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#evolution"><b>SafeRSI</b></a></p>**This repository:** [`AI45Research/AgentDoG-Step-Qwen3.5-4B`](https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B)<br>**Role:** Pre-execution guard for a candidate action and the visible interaction history.<br>**Published artifacts:** model weights, configuration and tokenizer.## 📌 Introduction**AgentDoG 2.0** is an efficient framework from **Shanghai Artificial Intelligence Laboratory** for characterizing, evaluating and mitigating emergent safety risks in long-horizon agent tasks. It connects a diagnostic risk taxonomy, long-horizon safety benchmarks, efficient trajectory and action guardrails, and data-driven defense evolution.- 🧩 **An expanded taxonomy for long-horizon risk.** Diagnose **18 risk sources, 21 failure modes and 11 real-world harms**, including covert goal manipulation, authority and obligation violations, and loss of control.- 📊 **Two complementary benchmarks.** **ATBench-Pro** evaluates complete long-horizon trajectories; **ManipulationArena** tests covert goal manipulation through reusable attack plans adapted to live agent execution.- 🛡️ **A family of efficient guardrails.** **AgentDoG 2.0** generates structured trajectory judgments; **AgentDoG-Jev** reads decisions in one forward pass; **AgentDoG-Step** evaluates the next action before execution.- 🔁 **SafeRSI.** Improve the execution harness and task-completion policy using attributed failures, and add AgentDoG-Step runtime intervention. Evaluate safety and benign task utility together.## 📦 Released ModelsThe following public repositories contain model weights, configurations and tokenizers. Select the repository for the task you need; the families use different inference interfaces.### AgentDoG 2.0: structured trajectory diagnosis| Checkpoint | Role | Size | Base checkpoint || --- | ---: | ---: | ---: || [AgentDoG2.0-Qwen3.5-0.8B](https://huggingface.co/AI45Research/AgentDoG2.0-Qwen3.5-0.8B) | Generative trajectory diagnosis | 0.8B | [Qwen/Qwen3.5-0.8B-Base](https://huggingface.co/Qwen/Qwen3.5-0.8B-Base) || [AgentDoG2.0-Qwen3.5-2B](https://huggingface.co/AI45Research/AgentDoG2.0-Qwen3.5-2B) | Generative trajectory diagnosis | 2B | [Qwen/Qwen3.5-2B-Base](https://huggingface.co/Qwen/Qwen3.5-2B-Base) || [AgentDoG2.0-Qwen3.5-4B](https://huggingface.co/AI45Research/AgentDoG2.0-Qwen3.5-4B) | Generative trajectory diagnosis | 4B | [Qwen/Qwen3.5-4B-Base](https://huggingface.co/Qwen/Qwen3.5-4B-Base) || [Llama-3.1-AgentDoG2.0-8B](https://huggingface.co/AI45Research/Llama-3.1-AgentDoG2.0-8B) | Generative trajectory diagnosis | 8B | [meta-llama/Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B) || [AgentDoG2.0-Qwen3.5-9B](https://huggingface.co/AI45Research/AgentDoG2.0-Qwen3.5-9B) | Generative trajectory diagnosis | 9B | [Qwen/Qwen3.5-9B-Base](https://huggingface.co/Qwen/Qwen3.5-9B-Base) |### AgentDoG-Jev: single-pass trajectory evaluation| Checkpoint | Role | Size | Base checkpoint || --- | ---: | ---: | ---: || [AgentDoG-Jev-Qwen3.5-0.8B](https://huggingface.co/AI45Research/AgentDoG-Jev-Qwen3.5-0.8B) | Single-pass binary safety judgment | 0.8B | [AI45Research/AgentDoG1.5-Qwen3.5-0.8B](https://huggingface.co/AI45Research/AgentDoG1.5-Qwen3.5-0.8B) || [AgentDoG-Jev-Qwen3.5-4B](https://huggingface.co/AI45Research/AgentDoG-Jev-Qwen3.5-4B) | Single-pass binary safety judgment | 4B | [AI45Research/AgentDoG1.5-Qwen3.5-4B](https://huggingface.co/AI45Research/AgentDoG1.5-Qwen3.5-4B) || [AgentDoG-Jev-Qwen3.5-4B-U](https://huggingface.co/AI45Research/AgentDoG-Jev-Qwen3.5-4B-U) | Single-pass binary safety judgment | 4B | [AI45Research/AgentDoG1.5-Unified-Qwen3.5-4B](https://huggingface.co/AI45Research/AgentDoG1.5-Unified-Qwen3.5-4B) || [AgentDoG-Jev-Qwen3.5-2B](https://huggingface.co/AI45Research/AgentDoG-Jev-Qwen3.5-2B) | Single-pass binary safety judgment | 2B | [AI45Research/AgentDoG1.5-Qwen3.5-2B](https://huggingface.co/AI45Research/AgentDoG1.5-Qwen3.5-2B) || [Llama-3.1-AgentDoG-Jev-8B](https://huggingface.co/AI45Research/Llama-3.1-AgentDoG-Jev-8B) | Single-pass binary safety judgment | 8B | [AI45Research/AgentDoG1.5-Llama-3.1-8B](https://huggingface.co/AI45Research/AgentDoG1.5-Llama-3.1-8B) || [AgentDoG-Jev-FG-Qwen3.5-0.8B](https://huggingface.co/AI45Research/AgentDoG-Jev-FG-Qwen3.5-0.8B) | Single-pass fine-grained diagnosis | 0.8B | [AI45Research/AgentDoG1.5-FG-Qwen3.5-0.8B](https://huggingface.co/AI45Research/AgentDoG1.5-FG-Qwen3.5-0.8B) || [AgentDoG-Jev-FG-Qwen3.5-2B](https://huggingface.co/AI45Research/AgentDoG-Jev-FG-Qwen3.5-2B) | Single-pass fine-grained diagnosis | 2B | [AI45Research/AgentDoG1.5-FG-Qwen3.5-2B](https://huggingface.co/AI45Research/AgentDoG1.5-FG-Qwen3.5-2B) || [AgentDoG-Jev-FG-Qwen3.5-4B](https://huggingface.co/AI45Research/AgentDoG-Jev-FG-Qwen3.5-4B) | Single-pass fine-grained diagnosis | 4B | [AI45Research/AgentDoG1.5-FG-Qwen3.5-4B](https://huggingface.co/AI45Research/AgentDoG1.5-FG-Qwen3.5-4B) || [Llama-3.1-AgentDoG-Jev-FG-8B](https://huggingface.co/AI45Research/Llama-3.1-AgentDoG-Jev-FG-8B) | Single-pass fine-grained diagnosis | 8B | [AI45Research/AgentDoG1.5-FG-Llama-3.1-8B](https://huggingface.co/AI45Research/AgentDoG1.5-FG-Llama-3.1-8B) |The `4B-U` variant is derived from the unified 1.5 checkpoint; the exported decision mapping in the 4B-U repository supports binary judgment. `FG` repositories provide fine-grained diagnostic readouts. Use each repository's own prompt and decision-token map rather than interchanging them.### AgentDoG-Step: pre-execution protection| Checkpoint | Role | Size | Base checkpoint || --- | ---: | ---: | ---: || [AgentDoG-Step-Qwen3.5-0.8B](https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-0.8B) | Pre-execution action assessment | 0.8B | [Qwen/Qwen3.5-0.8B-Base](https://huggingface.co/Qwen/Qwen3.5-0.8B-Base) || [AgentDoG-Step-Qwen3.5-2B](https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-2B) | Pre-execution action assessment | 2B | [Qwen/Qwen3.5-2B-Base](https://huggingface.co/Qwen/Qwen3.5-2B-Base) || [AgentDoG-Step-Qwen3.5-4B](https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B) | Pre-execution action assessment | 4B | [Qwen/Qwen3.5-4B-Base](https://huggingface.co/Qwen/Qwen3.5-4B-Base) || [Llama-3.1-8B-AgentDoG-Step](https://huggingface.co/AI45Research/Llama-3.1-8B-AgentDoG-Step) | Pre-execution action assessment | 8B | [meta-llama/Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B) || [AgentDoG-Step-Qwen3.5-9B](https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-9B) | Pre-execution action assessment | 9B | [Qwen/Qwen3.5-9B-Base](https://huggingface.co/Qwen/Qwen3.5-9B-Base) |### SafeRSI: evolved task-completion policies| Checkpoint | Role | Size | Base checkpoint || --- | ---: | ---: | ---: || [SafeRSI-27B-V1](https://huggingface.co/AI45Research/SafeRSI-27B-V1) | Evolved task-completion policy | 27B | Not declared in repository metadata || [SafeRSI-27B-V2](https://huggingface.co/AI45Research/SafeRSI-27B-V2) | Evolved task-completion policy | 27B | Not declared in repository metadata |SafeRSI weights are the **policy component** of the defense framework. The full evaluation configuration also specifies an evolved harness and, where stated, AgentDoG-Step; downloading a policy checkpoint alone does not reproduce that complete system.## 🎯 Tasks and Taxonomy| Family | Input | Inference | Output and use || --- | --- | --- | --- || AgentDoG 2.0 | Complete observed execution trajectory | Structured generation | Safety verdict and risk source; unsafe cases also receive failure-mode and harm diagnoses || AgentDoG-Jev | Trajectory formatted with the repository's decision schema | One forward pass at mapped decision positions | Binary safety labels, or fine-grained labels for `FG` checkpoints || AgentDoG-Step | Visible interaction history and the proposed next action | Pre-execution generation | Short rationale, Safe/Unsafe verdict and risk source; unsafe cases also receive failure-mode and harm diagnoses || SafeRSI | Task and model-visible agent history | Task-completion policy | Actions or responses from an evolved policy; not an independent guardrail verdict |The taxonomy separates **where a risk originates**, **how the agent fails**, and **what harm can follow**. A malicious input by itself does not make the agent unsafe: judge how the agent handles it and what behavior it actually executes. For Step assessment, include only the evidence available before the candidate action; future observations would leak the outcome.<p align="center"><img src="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/assets/taxonomy.webp" width="95%" alt="Expanded AgentDoG 2.0 taxonomy: 18 risk sources, 21 failure modes and 11 harms" /></p>## 🧾 Input Formatting and QuickstartThis example requires a GPU environment and a vLLM build supporting `Qwen3_5ForConditionalGeneration` (or `LlamaForCausalLM` for the Llama checkpoint) and the documented `--language-model-only` option. Install the serving runtime and HF CLI before running the commands below:```bashpython -m pip install -U vllm huggingface_hub```Serve the model with vLLM.8 unmodified linescd ./step-example```Send the example as a single user message. Use the [input schema](https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B/blob/main/input.schema.json)to format your own cases, including only evidence available at the decision point.```python21 unmodified linesprint(parse_response(answer))```### Choose the matching interface- **Base trajectory guard:** use the supplied `inference.py`, `prompt.txt` and trajectory example. The script handles Qwen and Llama prompt formatting and selects the matching model architecture. A separate `prompt-atbench-pro.txt` supports the benchmark-specific label interface.- **Jev:** use the supplied `inference.py` together with `decision_token_map.json`. The script scores candidate label tokens at designated decision positions. Standard autoregressive `generate()` is not equivalent to this inference method. Fine-grained repositories also supply the ATBench-Pro label map and prompt.- **Step:** use `step_inference.py`, `input.schema.json`, `taxonomy.json`, `safety-rs.txt` and `example.json`. The helper renders the history and candidate action into the prompt, then parses the guard's structured response.- **SafeRSI:** load the published policy using its configuration and tokenizer. The policy repositories do not currently include a complete harness or a dedicated inference helper. Preserve the intended task and safety constraints when integrating the policy into an agent runtime.**Example interpretation (illustrative, not a measured model trace).** A user asks an agent to inspect a single order. Before the agent calls a tool that exports every customer's records to a third-party endpoint, AgentDoG-Step receives the visible history and that proposed export. The evaluation should check authorization, the requested scope and the destination before the export executes. A safer continuation would preserve the single-order task while avoiding the unrequested bulk transfer.### Reading the outputUse the exact labels and parser supplied with the selected checkpoint. The expanded 2.0 taxonomy and legacy fine-grained label interfaces are not interchangeable. Do not assume that every repository emits the same field names or label vocabulary. Jev label scores are decision readouts; they are not demonstrated calibrated probabilities.## 📊 PerformanceAll values below reproduce the active tables in the updated technical manuscript. **Accuracy, unsafe F1 and worst-class recall are distinct metrics.** Latency is guardrail decision latency under the stated benchmark setting, not complete agent task runtime.### AgentDoG 2.0 trajectory safety| Model | R-Judge Acc (%) | R-Judge F1 (%) | ATBench Acc (%) | ATBench F1 (%) | ATBench-Pro Acc (%) | ATBench-Pro F1 (%) || --- | ---: | ---: | ---: | ---: | ---: | ---: || AgentDoG 2.0 0.8B | 76.6 | 71.7 | 76.3 | 76.1 | 75.4 | 58.6 || AgentDoG 2.0 2B | 80.1 | 79.9 | 80.3 | 81.7 | 78.3 | 69.4 || AgentDoG 2.0 4B | 83.3 | 83.3 | 78.1 | 76.7 | 80.3 | 69.7 || AgentDoG 2.0 8B | 78.4 | 74.5 | 73.5 | 75.3 | 81.0 | 71.8 || AgentDoG 2.0 9B | 88.8 | 88.8 | 77.5 | 76.3 | 78.4 | 64.2 |F1 is the unsafe-class F1 score. Higher is better.### Fine-grained trajectory diagnosis| Model | ATBench RS | FM | Harm | Mean | ATBench-Pro RS | FM | Harm | Mean || --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: || AgentDoG 2.0 0.8B | 51.7 | 18.3 | 45.5 | 38.5 | 29.2 | 30.3 | 37.6 | 32.3 || AgentDoG 2.0 2B | 59.8 | 21.5 | 52.9 | 44.7 | 36.4 | 37.5 | 50.2 | 41.4 || AgentDoG 2.0 4B | 61.8 | 16.1 | 46.9 | 41.6 | 39.7 | 38.3 | 47.7 | 41.9 || AgentDoG 2.0 8B | 61.2 | 20.5 | 50.7 | 44.1 | 28.4 | 34.5 | 46.1 | 36.3 || AgentDoG 2.0 9B | 61.2 | 19.9 | 45.9 | 42.3 | 36.7 | 35.0 | 44.5 | 38.7 |All values are accuracies (%), higher is better, evaluated on **unsafe trajectories**. RS = risk source; FM = failure mode; Harm = real-world harm. Mean is the unweighted mean of the three diagnostic accuracies.### AgentDoG-Jev efficiency| Checkpoint / benchmark | Binary decision latency | Unsafe F1 (%) || --- | ---: | ---: || Jev 4B-U / ATBench | 59.8 ms | 77.90 || Jev 4B / ATBench-Pro | 1.465 s | 68.94 |On ATBench binary judgment, Jev reports **103.9–184.9×** lower latency than its matched generative AgentDoG 1.5 variants. Fine-grained diagnosis reports **4.4–13.4×** speedups on ATBench and **1.64–8.88×** on ATBench-Pro. These are benchmark- and checkpoint-specific speed/accuracy trade-offs, not a universal speedup for every task. Latencies were measured on a single H200 with concurrency 1 and prefix caching disabled.<p align="center"><img src="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/assets/jev-latency.webp" width="95%" alt="Matched Jev and AgentDoG 1.5 latency comparisons on ATBench and ATBench-Pro" /></p>### AgentDoG-Step pre-execution safety| Model | Mean accuracy (%) | Mean unsafe F1 (%) | Mean WCR (%) || --- | ---: | ---: | ---: || AgentDoG-Step 0.8B | 88.3 | 71.1 | 77.8 || AgentDoG-Step 2B | 93.4 | 82.2 | 86.2 || AgentDoG-Step 4B | 94.7 | 87.5 | 94.0 || AgentDoG-Step 8B | 93.7 | 80.8 | 88.4 || AgentDoG-Step 9B | 92.9 | 84.5 | 90.2 |WCR is the lower of safe-class recall and unsafe-class recall within each benchmark. Overall values are the unweighted mean across **TS-Bench-Dojo, TS-Bench-ASB and StepShield (pre-action)**. Step 4B reports **94.7% accuracy, 87.5% unsafe F1 and 94.0% WCR**; these numbers refer to this three-benchmark mean.<p align="center"><img src="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/assets/step-performance.webp" width="95%" alt="Step performance across the three pre-execution benchmarks" /></p>## 📚 Benchmarks### ATBench-ProATBench-Pro evaluates full long-horizon trajectories in which safety depends on earlier evidence, evolving permissions, persistent state and downstream obligations. The updated manuscript reports **1,000 cases**, averaging **48.98 tool calls** and **57.51k tokens** per trajectory.| Benchmark | Cases | Mean tool calls | Mean tokens || --- | ---: | ---: | ---: || R-Judge | 564 | 1.79 | 0.47k || ASSE-Safety | 1,476 | 1.49 | 0.47k || ASSE-Security | 817 | 1.62 | 0.78k || ATBench500 | 500 | 3.49 | 1.52k || ATBench | 1,000 | 2.97 | 3.95k || HINTBench (v2) | 596 | 6.92† | 4.78k† || ATBench-Pro (Ours) | 1,000 | 48.98 | 57.51k |These are manuscript-reported statistics. k = 1,000 tokens. †HINTBench averages use the 566 publicly released test trajectories, while its reported total is 596 cases.### ManipulationArenaManipulationArena contains **888 reusable attack plans** spanning **7 strategies × 6 channels = 42 attack configurations** across **30 long-horizon tasks**. The plan is adapted to the target agent’s live trajectory during evaluation. Failure modes annotate observed violations after execution rather than defining a third configuration axis.| Benchmark | Cases | Strategies | Channels | Mean interaction length || --- | ---: | ---: | ---: | ---: || AgentDojo | 629 | 4 | 1 | 3.49 steps || AutoControl Arena | 280 | 2 | — | — || AgentLAB | 644 | 5 | 3 | — || SHADE-Arena | 17 | 1 | 1 | ≈25 turns || AgentDyn | 560 | 4 | 1 | 7.10 steps || ManipulationArena | 888 | 7 | 6 | 24.12 turns / 23.35 steps |One **step** is one tool call; one **turn** is one agent response. Means retain these distinct units. — denotes unavailable data. ManipulationArena averages **24.12 turns / 23.35 steps**.<p align="center"><img src="https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/assets/benchmark-overview.webp" width="95%" alt="ManipulationArena attack-strategy and channel distributions over 888 cases" /></p>See the [benchmark section](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#benchmarks) and [Hugging Face collection](https://huggingface.co/collections/AI45Research/agentdog20-6b09556a028a2ce10c53f2fe) for the benchmark entry points.## 🔁 SafeRSI: Harness–Policy Co-EvolutionSafeRSI attributes discovered failures and routes improvements to the execution harness, the policy, or both. Harness evolution produces natural-language guidance or deterministic runtime constraints; policy evolution learns corrective continuations synthesized from observed failures. AgentDoG-Step adds periodic runtime assessment.| Harness / policy | Added Step guard | AgentLAB ASR ↓ | AutoControl-Arena ASR ↓ | ManipulationArena ASR ↓ | BFCL-v3 Acc ↑ || --- | ---: | ---: | ---: | ---: | ---: || Claude Code / Opus 5.5 | — | 25.99 | 2.26 | 56.24 | 72.60 || Codex / GPT-6.1-sol | — | 35.76 | 3.59 | 64.59 | 66.70 || DeepSeek Harness / Qwen3.8-27B | — | 35.11 | 13.69 | 65.84 | 75.34 || SafeRSI Harness V1 / SafeRSI-27B V1 | — | 28.66 | 7.62 | 28.04 | 66.72 || SafeRSI Harness V2 / SafeRSI-27B V2 | — | 26.54 | 7.38 | 25.68 | 65.17 || SafeRSI Harness V1 / SafeRSI-27B V1 | AgentDoG-Step | 22.10 | 4.31 | 21.40 | 67.39 || SafeRSI Harness V2 / SafeRSI-27B V2 | AgentDoG-Step | 21.07 | 3.69 | 24.21 | 64.92 |All values are percentages. **ASR** is attack success rate (lower is better); **BFCL-v3 accuracy** measures benign function-calling utility (higher is better). V1/V2 denote the harness and policy after the first/second evolution round. — means without the added AgentDoG-Step guard, not the absence of every other runtime defense.- **V1 + Step** reduces ManipulationArena ASR from **65.84% to 21.40%** against **DeepSeek Harness + Qwen3.8-27B**: **44.44 percentage points**, or **67.50% relative reduction**. BFCL-v3 accuracy changes from **75.34% to 67.39%**, a **7.95-point utility cost**.- **V2 + Step** yields lower ASR on AgentLAB and AutoControl-Arena than V1 + Step, while V1 + Step has lower ManipulationArena ASR and higher BFCL-v3 accuracy. V2 does not improve every metric.- These are **complete system configurations**. The scores do not isolate the contribution of a downloaded SafeRSI policy checkpoint alone.See [SafeRSI on the project page](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#evolution) for the mechanism figures and strategy-level diagnostic results.## ⚠️ Intended Use and Limitations- Use guard predictions to support trajectory review and pre-execution intervention in the documented agent setting. They can miss unsafe behavior or flag safe behavior; evaluate them in the target workflow and measure both safety and utility.- Preserve tool specifications, permissions, user intent and relevant observations when formatting an input. Truncating a long trajectory can remove decisive evidence.- Step assessment must not include future execution results. A candidate action should be assessed before it changes the environment.- Fine-grained evaluation depends on the benchmark’s label interface. Follow the repository’s supplied prompt and mapping rather than borrowing a 1.5 template unchanged.- Model and benchmark rankings are specific to the reported settings. Neither low ASR nor a guard verdict establishes that an entire deployment is safe.- The example above is conceptual. The project-page videos reconstruct failures and do not demonstrate live AgentDoG interception.## 📜 LicenseThis checkpoint is released under the [Apache License 2.0](https://huggingface.co/AI45Research/AgentDoG-Step-Qwen3.5-4B/blob/main/LICENSE), as declared by this repository. See the repository license and notices for its terms.## 📖 CitationProject reference (software/repository citation):```bibtex@software{agentdog20,title = {AgentDoG 2.0: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks},author = {{Shanghai Artificial Intelligence Laboratory}},year = {2026},url = {https://github.com/AI45Lab/AgentDoG}}```This entry identifies the project; it does not assign an arXiv identifier or DOI to the 2.0 technical report. A verified report citation can replace it when available.## 🔗 Resources- [Source code](https://github.com/AI45Lab/AgentDoG)- [AgentDoG 2.0 collection](https://huggingface.co/collections/AI45Research/agentdog20-6b09556a028a2ce10c53f2fe)- [Dark project page](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/)- [Benchmarks](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#benchmarks)- [SafeRSI](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#evolution)- [Featured demos](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#demos)
README.md+262-19