Text Generation
Transformers
Safetensors
qwen3_5
image-text-to-text
agent-safety
trajectory-classification
agentdog
long-horizon
conversational
Instructions to use AI45Research/AgentDoG2-Qwen3.5-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI45Research/AgentDoG2-Qwen3.5-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AI45Research/AgentDoG2-Qwen3.5-2B") 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/AgentDoG2-Qwen3.5-2B") model = AutoModelForMultimodalLM.from_pretrained("AI45Research/AgentDoG2-Qwen3.5-2B", 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/AgentDoG2-Qwen3.5-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI45Research/AgentDoG2-Qwen3.5-2B" # 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/AgentDoG2-Qwen3.5-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AI45Research/AgentDoG2-Qwen3.5-2B
- SGLang
How to use AI45Research/AgentDoG2-Qwen3.5-2B 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/AgentDoG2-Qwen3.5-2B" \ --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/AgentDoG2-Qwen3.5-2B", "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/AgentDoG2-Qwen3.5-2B" \ --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/AgentDoG2-Qwen3.5-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AI45Research/AgentDoG2-Qwen3.5-2B with Docker Model Runner:
docker model run hf.co/AI45Research/AgentDoG2-Qwen3.5-2B
Complete AgentDoG2 cards with manuscript main figure, methods, results and usage examples
Browse files- .gitattributes +15 -0
- README.md +251 -13
- figs/abstract.pdf +3 -0
- figs/abstract.png +3 -0
- figs/base-latency.png +3 -0
- figs/base-pareto-binary.png +3 -0
- figs/base-pareto-fine.png +3 -0
- figs/benchmark-overview.png +3 -0
- figs/data-engine.png +3 -0
- figs/family-agentdog2.png +3 -0
- figs/harness-evolution.png +3 -0
- figs/jev-inference.png +3 -0
- figs/jev-latency.png +3 -0
- figs/policy-evolution.png +3 -0
- figs/step-performance.png +3 -0
- figs/step-pipeline.png +3 -0
- figs/taxonomy.png +3 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,18 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
figs/abstract.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
figs/base-latency.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
figs/base-pareto-binary.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
figs/base-pareto-fine.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
figs/benchmark-overview.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
figs/data-engine.png filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
figs/family-agentdog2.png filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
figs/harness-evolution.png filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
figs/jev-inference.png filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
figs/jev-latency.png filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
figs/policy-evolution.png filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
figs/step-performance.png filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
figs/step-pipeline.png filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
figs/taxonomy.png filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
figs/abstract.pdf filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -28,7 +28,7 @@ tags:
|
|
| 28 |
|
| 29 |
# AgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks
|
| 30 |
|
| 31 |
-
<p align="center"><a href="#model-zoo">Model Zoo</a> · <a href="#benchmarks">Benchmarks</a> · <a href="#evaluation">Results</a> · <a href="#safersi">SafeRSI</a></p>
|
| 32 |
|
| 33 |
**This repository:** [`AI45Research/AgentDoG2-Qwen3.5-2B`](https://huggingface.co/AI45Research/AgentDoG2-Qwen3.5-2B)<br>
|
| 34 |
**Role:** Generative trajectory-level guard with safety verdict and structured risk diagnosis.<br>
|
|
@@ -44,6 +44,16 @@ tags:
|
|
| 44 |
- 🛡️ **A family of efficient guardrails.** **AgentDoG2** generates structured trajectory judgments; **AgentDoG-Jev** reads decisions in one forward pass; **AgentDoG-Step** evaluates the next action before execution.
|
| 45 |
- 🔁 **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.
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
## Model Zoo
|
| 48 |
|
| 49 |
The following public repositories contain model weights, configurations and tokenizers. Select the repository for the task you need; the families use different inference interfaces.
|
|
@@ -105,19 +115,43 @@ SafeRSI weights are the **policy component** of the defense framework. The full
|
|
| 105 |
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.
|
| 106 |
|
| 107 |
<p align="center">
|
| 108 |
-
<img src="
|
| 109 |
</p>
|
| 110 |
|
| 111 |
## AgentDoG2 Guardrails
|
| 112 |
|
| 113 |
### Building Pipeline
|
| 114 |
|
| 115 |
-
|
| 116 |
-
-
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
<p align="center">
|
| 120 |
-
<img src="
|
| 121 |
</p>
|
| 122 |
|
| 123 |
## Getting Started
|
|
@@ -131,6 +165,26 @@ python ./model/inference.py --trajectory ./model/example_trajectory.txt
|
|
| 131 |
Replace the example with a text file containing your trajectory. The script uses [the judgment template](https://huggingface.co/AI45Research/AgentDoG2-Qwen3.5-2B/blob/main/prompt.txt) by default.
|
| 132 |
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
### Choose the matching interface
|
| 135 |
|
| 136 |
- **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.
|
|
@@ -142,7 +196,7 @@ Replace the example with a text file containing your trajectory. The script uses
|
|
| 142 |
|
| 143 |
### Reading the output
|
| 144 |
|
| 145 |
-
Use the exact labels and parser supplied with the selected checkpoint. The
|
| 146 |
|
| 147 |
## Evaluation
|
| 148 |
|
|
@@ -160,6 +214,41 @@ All values below reproduce the active tables in the updated technical manuscript
|
|
| 160 |
|
| 161 |
F1 is the unsafe-class F1 score. Higher is better.
|
| 162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
### Fine-grained trajectory diagnosis
|
| 164 |
|
| 165 |
| Model | ATBench RS | FM | Harm | Mean | ATBench-Pro RS | FM | Harm | Mean |
|
|
@@ -172,6 +261,133 @@ F1 is the unsafe-class F1 score. Higher is better.
|
|
| 172 |
|
| 173 |
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.
|
| 174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
### AgentDoG-Jev efficiency
|
| 176 |
|
| 177 |
| Checkpoint / benchmark | Binary decision latency | Unsafe F1 (%) |
|
|
@@ -182,7 +398,7 @@ All values are accuracies (%), higher is better, evaluated on **unsafe trajector
|
|
| 182 |
On ATBench binary judgment, Jev reports **103.9–184.9×** lower latency than its matched generative AgentDoG 1.5 variants. The corresponding binary-decision speedup on ATBench-Pro is **3.68–20.90×**. 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.
|
| 183 |
|
| 184 |
<p align="center">
|
| 185 |
-
<img src="
|
| 186 |
</p>
|
| 187 |
|
| 188 |
For fine-grained Jev evaluation on ATBench-Pro, the reported scores use **319 unsafe trajectories** with reference labels for all three diagnostic dimensions.
|
|
@@ -200,7 +416,7 @@ For fine-grained Jev evaluation on ATBench-Pro, the reported scores use **319 un
|
|
| 200 |
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.
|
| 201 |
|
| 202 |
<p align="center">
|
| 203 |
-
<img src="
|
| 204 |
</p>
|
| 205 |
|
| 206 |
## Benchmarks
|
|
@@ -237,14 +453,36 @@ ManipulationArena contains **888 reusable attack plans** spanning **7 strategies
|
|
| 237 |
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**.
|
| 238 |
|
| 239 |
<p align="center">
|
| 240 |
-
<img src="
|
| 241 |
</p>
|
| 242 |
|
| 243 |
See the [benchmark section](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#benchmarks) and [Hugging Face collection](https://huggingface.co/collections/AI45Research/agentdog2-6b09556a028a2ce10c53f2fe) for the benchmark entry points.
|
| 244 |
|
| 245 |
## SafeRSI
|
| 246 |
|
| 247 |
-
SafeRSI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
|
| 249 |
| Harness / policy | Added Step guard | AgentLAB ASR ↓ | AutoControl-Arena ASR ↓ | ManipulationArena ASR ↓ | BFCL-v3 Acc ↑ |
|
| 250 |
| --- | ---: | ---: | ---: | ---: | ---: |
|
|
@@ -256,13 +494,13 @@ SafeRSI attributes discovered failures and routes improvements to the execution
|
|
| 256 |
| SafeRSI Harness V1 / SafeRSI-27B V1 | AgentDoG-Step | 22.10 | 4.31 | 21.40 | 67.39 |
|
| 257 |
| SafeRSI Harness V2 / SafeRSI-27B V2 | AgentDoG-Step | 21.07 | 3.69 | 24.21 | 64.92 |
|
| 258 |
|
| 259 |
-
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
|
| 260 |
|
| 261 |
- **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**.
|
| 262 |
- **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.
|
| 263 |
- These are **complete system configurations**. The scores do not isolate the contribution of a downloaded SafeRSI policy checkpoint alone.
|
| 264 |
|
| 265 |
-
See [SafeRSI on the project page](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#evolution) for
|
| 266 |
|
| 267 |
## ⚠️ Intended Use and Limitations
|
| 268 |
|
|
|
|
| 28 |
|
| 29 |
# AgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks
|
| 30 |
|
| 31 |
+
<p align="center"><a href="#performance-overview">Performance</a> · <a href="#model-zoo">Model Zoo</a> · <a href="#benchmarks">Benchmarks</a> · <a href="#evaluation">Results</a> · <a href="#safersi">SafeRSI</a></p>
|
| 32 |
|
| 33 |
**This repository:** [`AI45Research/AgentDoG2-Qwen3.5-2B`](https://huggingface.co/AI45Research/AgentDoG2-Qwen3.5-2B)<br>
|
| 34 |
**Role:** Generative trajectory-level guard with safety verdict and structured risk diagnosis.<br>
|
|
|
|
| 44 |
- 🛡️ **A family of efficient guardrails.** **AgentDoG2** generates structured trajectory judgments; **AgentDoG-Jev** reads decisions in one forward pass; **AgentDoG-Step** evaluates the next action before execution.
|
| 45 |
- 🔁 **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.
|
| 46 |
|
| 47 |
+
## Performance Overview
|
| 48 |
+
|
| 49 |
+
<p align="center">
|
| 50 |
+
<img src="./figs/abstract.png" width="95%" alt="AgentDoG2 performance overview: ATBench unsafe F1 versus API cost, binary-decision latency, and fine-grained diagnosis accuracy" />
|
| 51 |
+
</p>
|
| 52 |
+
|
| 53 |
+
[Full-resolution main figure (PDF)](./figs/abstract.pdf)
|
| 54 |
+
|
| 55 |
+
**Average inference cost, efficiency and performance.** The manuscript's main figure compares (a) unsafe-class F1 versus API cost on **ATBench**, (b) binary safety-decision latency and matched speedups on **ATBench**, and (c) fine-grained diagnosis accuracy on **ATBench**. API costs follow the manuscript's stated official/provider pricing. Speedups belong to the particular models and settings shown; they are not a single speedup applicable to every benchmark.
|
| 56 |
+
|
| 57 |
## Model Zoo
|
| 58 |
|
| 59 |
The following public repositories contain model weights, configurations and tokenizers. Select the repository for the task you need; the families use different inference interfaces.
|
|
|
|
| 115 |
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.
|
| 116 |
|
| 117 |
<p align="center">
|
| 118 |
+
<img src="./figs/taxonomy.png" width="95%" alt="Expanded AgentDoG2 taxonomy: 18 risk sources, 21 failure modes and 11 harms" />
|
| 119 |
</p>
|
| 120 |
|
| 121 |
## AgentDoG2 Guardrails
|
| 122 |
|
| 123 |
### Building Pipeline
|
| 124 |
|
| 125 |
+
<p align="center">
|
| 126 |
+
<img src="./figs/family-agentdog2.png" width="95%" alt="AgentDoG2, AgentDoG-Jev and AgentDoG-Step family overview" />
|
| 127 |
+
</p>
|
| 128 |
+
|
| 129 |
+
#### AgentDoG2: long-horizon synthesis and structured diagnosis
|
| 130 |
+
|
| 131 |
+
**Trajectory-guided data synthesis** begins with real benign workflows. A planner selects a fork point and inserts a task-grounded risk trigger, then generates an unsafe continuation and safe alternatives from the same prefix. Safe alternatives may refuse or escalate the risk, complete authorized work while handling it safely, or ignore the distracting trigger. This contrast separates **risk exposure** from **unsafe execution**.
|
| 132 |
+
|
| 133 |
+
A **verifier-driven agentic loop** coordinates the planner, user, agent, tool and summary roles. It checks format, execution consistency and target labels, sends targeted repair feedback, and re-verifies within a bounded retry budget. A contrastive group is retained when its unsafe trajectory and at least one safe trajectory pass verification.
|
| 134 |
+
|
| 135 |
+
<p align="center">
|
| 136 |
+
<img src="./figs/data-engine.png" width="95%" alt="AgentDoG2 data engine: trajectory-guided contrastive synthesis and verifier-driven targeted repair" />
|
| 137 |
+
</p>
|
| 138 |
+
|
| 139 |
+
**Taxonomy internalization reduces inference overhead.** The base trajectory guard directly outputs structured labels without a long chain-of-thought rationale or repeating the complete category definitions in each prompt. Supervised fine-tuning (SFT) teaches this format; Group Reward-Decoupled Normalization Policy Optimization (GDPO) then applies verifiable rewards to the applicable fields. Safe trajectories also receive Risk Source supervision (`None` when no risk is present), while Failure Mode and Real-World Harm are reserved for unsafe outcomes.
|
| 140 |
+
|
| 141 |
+
#### AgentDoG-Jev: decisions in one forward pass
|
| 142 |
+
|
| 143 |
+
AgentDoG-Jev retains trajectory inputs and supervision from AgentDoG 1.5, rewrites the outputs as structured decision schemas, and reads candidate-label logits at mapped decision positions. Binary judgment uses one decision field; fine-grained diagnosis uses three. The helper formats the selected labels as JSON without autoregressive decoding. Each checkpoint's own prompt and decision map define its label interface.
|
| 144 |
+
|
| 145 |
+
<p align="center">
|
| 146 |
+
<img src="./figs/jev-inference.png" width="95%" alt="AgentDoG-Jev single-pass decision readout from a trajectory and structured decision schema" />
|
| 147 |
+
</p>
|
| 148 |
+
|
| 149 |
+
#### AgentDoG-Step: judge the pending action before execution
|
| 150 |
+
|
| 151 |
+
AgentDoG-Step adapts the StepGen data engine to build groups of unsafe, safely handled and benign continuations. Each training item contains the **visible history and the proposed next action**, and is filtered for tool-call format, trajectory coherence and label consistency. SFT followed by GDPO teaches a short analysis and structured verdict. Supervising Risk Source on safe steps helps distinguish safely handled risky contexts from unsafe actions; future observations must not enter the pre-execution input.
|
| 152 |
|
| 153 |
<p align="center">
|
| 154 |
+
<img src="./figs/step-pipeline.png" width="95%" alt="AgentDoG-Step data preparation pipeline for pre-execution safety and risk-source diagnosis" />
|
| 155 |
</p>
|
| 156 |
|
| 157 |
## Getting Started
|
|
|
|
| 165 |
Replace the example with a text file containing your trajectory. The script uses [the judgment template](https://huggingface.co/AI45Research/AgentDoG2-Qwen3.5-2B/blob/main/prompt.txt) by default.
|
| 166 |
|
| 167 |
|
| 168 |
+
### Trajectory input and output format
|
| 169 |
+
|
| 170 |
+
The supplied helper inserts your trajectory into `prompt.txt`. Preserve the user request, available tools, observations and executed actions. The following is an **illustrative benign input**, not a measured model run:
|
| 171 |
+
|
| 172 |
+
```text
|
| 173 |
+
[USER]: Look up stock for item A123.
|
| 174 |
+
[AGENT]: lookup_stock(item_id="A123")
|
| 175 |
+
[TOOL]: {"item_id": "A123", "stock": 12}
|
| 176 |
+
[AGENT]: Item A123 has 12 units in stock.
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
The corresponding **expected safe-label format** is:
|
| 180 |
+
|
| 181 |
+
```text
|
| 182 |
+
Safety: safe
|
| 183 |
+
Risk Source: None
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
For an unsafe verdict the published prompt instead requires `Safety`, `Failure Mode`, `Risk Consequence` and `Risk Source`, in that order, using canonical labels. Safe handling of a risky input may still have a non-`None` Risk Source. The base guard does not require an `<Analysis>` block.
|
| 187 |
+
|
| 188 |
### Choose the matching interface
|
| 189 |
|
| 190 |
- **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.
|
|
|
|
| 196 |
|
| 197 |
### Reading the output
|
| 198 |
|
| 199 |
+
Use the exact labels and parser supplied with the selected checkpoint. The AgentDoG2 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.
|
| 200 |
|
| 201 |
## Evaluation
|
| 202 |
|
|
|
|
| 214 |
|
| 215 |
F1 is the unsafe-class F1 score. Higher is better.
|
| 216 |
|
| 217 |
+
<details>
|
| 218 |
+
<summary>Full trajectory-safety comparison with frontier models, guardrails and AgentDoG 1.5</summary>
|
| 219 |
+
|
| 220 |
+
All values are percentages. F1 is unsafe-class F1. Overall is the unweighted mean across R-Judge, ATBench and ATBench-Pro. This is the manuscript's base-guard comparison, whose AgentDoG 1.5-U evaluation is distinct from the matched baselines in the Jev experiment.
|
| 221 |
+
|
| 222 |
+
| Model | R-Judge Acc | R-Judge F1 | ATBench Acc | ATBench F1 | ATBench-Pro Acc | ATBench-Pro F1 | Overall Acc | Overall F1 |
|
| 223 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 224 |
+
| GPT-6.1-Sol | 94.9 | 95.0 | 78.0 | 77.5 | 62.7 | 67.8 | 78.5 | 80.1 |
|
| 225 |
+
| Gemini-3.8-Flash | 91.7 | 92.6 | 59.2 | 53.1 | 76.3 | 66.8 | 75.7 | 70.8 |
|
| 226 |
+
| DeepSeek-V4.1-Flash | 81.4 | 80.9 | 66.1 | 63.7 | 82.2 | 79.2 | 76.6 | 74.6 |
|
| 227 |
+
| GLM-5.3 | 87.9 | 88.2 | 76.6 | 71.5 | 83.4 | 75.1 | 82.6 | 78.3 |
|
| 228 |
+
| Qwen3.5-397B | 85.6 | 87.4 | 66.8 | 67.8 | 68.6 | 37.1 | 73.7 | 64.1 |
|
| 229 |
+
| Qwen3.8-27B | 93.4 | 93.5 | 71.3 | 61.8 | 77.1 | 61.6 | 80.6 | 72.3 |
|
| 230 |
+
| Qwen3.5-9B | 77.0 | 80.3 | 62.7 | 53.9 | 61.8 | 17.2 | 67.2 | 50.5 |
|
| 231 |
+
| Llama-3.1-8B | 53.7 | 69.5 | 45.3 | 61.9 | 39.5 | 27.1 | 46.2 | 52.8 |
|
| 232 |
+
| Qwen3.5-4B | 81.0 | 82.0 | 45.9 | 27.6 | 57.6 | 12.1 | 61.5 | 40.6 |
|
| 233 |
+
| LlamaGuard3-8B | 61.2 | 56.7 | 53.1 | 7.3 | 59.9 | 0.0 | 58.1 | 21.3 |
|
| 234 |
+
| Qwen3-Guard | 40.6 | 9.0 | 51.5 | 0.8 | 59.6 | 0.0 | 50.6 | 3.3 |
|
| 235 |
+
| ShieldAgent | 81.0 | 84.6 | 62.5 | 67.7 | 17.9 | 7.5 | 53.8 | 53.3 |
|
| 236 |
+
| StepGuard-4B | 87.1 | 87.9 | 77.7 | 76.8 | 67.3 | 60.1 | 77.4 | 74.9 |
|
| 237 |
+
| StepSafe-4B | 84.6 | 85.2 | 69.9 | 59.7 | 61.1 | 13.4 | 71.9 | 52.8 |
|
| 238 |
+
| BraveGuard-4B | 75.5 | 75.5 | 55.0 | 22.5 | 59.9 | 0.5 | 63.5 | 32.8 |
|
| 239 |
+
| AgentDoG 1.5-U 0.8B | 81.2 | 80.2 | 61.0 | 62.6 | 65.6 | 61.0 | 69.3 | 67.9 |
|
| 240 |
+
| AgentDoG 1.5-U 2B | 78.4 | 80.9 | 76.8 | 76.9 | 53.0 | 57.6 | 69.4 | 71.8 |
|
| 241 |
+
| AgentDoG 1.5-U 4B | 90.4 | 90.6 | 78.4 | 76.1 | 72.1 | 66.9 | 80.3 | 77.9 |
|
| 242 |
+
| AgentDoG 1.5-U 8B | 86.9 | 86.3 | 77.3 | 75.6 | 66.9 | 62.2 | 77.0 | 74.7 |
|
| 243 |
+
| AgentDoG 1.5-U 9B | 81.4 | 83.4 | 78.1 | 78.0 | 72.9 | 71.4 | 77.5 | 77.6 |
|
| 244 |
+
| AgentDoG2 0.8B | 76.6 | 71.7 | 76.3 | 76.1 | 75.4 | 58.6 | 76.1 | 68.8 |
|
| 245 |
+
| AgentDoG2 2B | 80.1 | 79.9 | 80.3 | 81.7 | 78.3 | 69.4 | 79.6 | 77.0 |
|
| 246 |
+
| AgentDoG2 4B | 83.3 | 83.3 | 78.1 | 76.7 | 80.3 | 69.7 | 80.6 | 76.6 |
|
| 247 |
+
| AgentDoG2 8B | 78.4 | 74.5 | 73.5 | 75.3 | 81.0 | 71.8 | 77.6 | 73.9 |
|
| 248 |
+
| AgentDoG2 9B | 88.8 | 88.8 | 77.5 | 76.3 | 78.4 | 64.2 | 81.6 | 76.4 |
|
| 249 |
+
|
| 250 |
+
</details>
|
| 251 |
+
|
| 252 |
### Fine-grained trajectory diagnosis
|
| 253 |
|
| 254 |
| Model | ATBench RS | FM | Harm | Mean | ATBench-Pro RS | FM | Harm | Mean |
|
|
|
|
| 261 |
|
| 262 |
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.
|
| 263 |
|
| 264 |
+
<details>
|
| 265 |
+
<summary>Full fine-grained diagnosis comparison</summary>
|
| 266 |
+
|
| 267 |
+
Accuracy (%) on unsafe trajectories; Mean is the unweighted average of Risk Source, Failure Mode and Real-World Harm. These are base-guard results, separate from the Jev decision-model experiment.
|
| 268 |
+
|
| 269 |
+
| Model | ATBench RS | ATBench FM | ATBench Harm | ATBench Mean | ATBench-Pro RS | ATBench-Pro FM | ATBench-Pro Harm | ATBench-Pro Mean |
|
| 270 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 271 |
+
| GPT-6.1-Sol | 38.0 | 14.1 | 37.6 | 29.9 | 45.7 | 40.8 | 47.0 | 44.5 |
|
| 272 |
+
| Gemini-3.8-Flash | 22.1 | 10.3 | 21.3 | 17.9 | 38.4 | 40.0 | 47.0 | 41.8 |
|
| 273 |
+
| DeepSeek-V4.1-Flash | 23.5 | 11.3 | 22.5 | 19.1 | 26.9 | 33.8 | 37.0 | 32.5 |
|
| 274 |
+
| GLM-5.3 | 34.2 | 13.3 | 29.8 | 25.8 | 16.3 | 15.5 | 20.4 | 17.4 |
|
| 275 |
+
| Qwen3.5-397B | 7.7 | 3.6 | 6.8 | 6.0 | 4.8 | 5.5 | 9.1 | 6.5 |
|
| 276 |
+
| Qwen3.8-27B | 28.4 | 10.7 | 23.1 | 20.7 | 2.5 | 2.8 | 3.1 | 2.8 |
|
| 277 |
+
| Qwen3.5-9B | 16.5 | 8.5 | 16.7 | 13.9 | 0.3 | 0.3 | 0.3 | 0.3 |
|
| 278 |
+
| Llama-3.1-8B | 6.2 | 5.8 | 15.5 | 9.2 | 0.5 | 1.3 | 2.8 | 1.5 |
|
| 279 |
+
| Qwen3.5-4B | 6.6 | 3.0 | 8.2 | 5.9 | 1.3 | 0.0 | 2.5 | 1.3 |
|
| 280 |
+
| StepGuard-4B | 20.1 | 8.5 | 16.1 | 14.9 | 0.8 | 0.8 | 0.6 | 0.7 |
|
| 281 |
+
| StepSafe-4B | 10.9 | 6.4 | 11.5 | 9.6 | 0.0 | 0.8 | 0.9 | 0.6 |
|
| 282 |
+
| BraveGuard-4B | 1.0 | 1.0 | 0.6 | 0.9 | 0.0 | 0.0 | 0.0 | 0.0 |
|
| 283 |
+
| AgentDoG 1.5-U 0.8B | 37.4 | 14.3 | 34.0 | 28.6 | 11.1 | 2.5 | 15.0 | 9.5 |
|
| 284 |
+
| AgentDoG 1.5-U 2B | 42.7 | 18.5 | 43.5 | 34.9 | 8.0 | 2.8 | 4.1 | 5.0 |
|
| 285 |
+
| AgentDoG 1.5-U 4B | 46.7 | 14.5 | 45.1 | 35.4 | 21.6 | 10.8 | 26.6 | 19.7 |
|
| 286 |
+
| AgentDoG 1.5-U 8B | 48.5 | 16.5 | 43.1 | 36.0 | 11.6 | 5.5 | 18.8 | 12.0 |
|
| 287 |
+
| AgentDoG 1.5-U 9B | 53.5 | 17.7 | 50.3 | 40.5 | 31.4 | 10.0 | 36.1 | 25.8 |
|
| 288 |
+
| AgentDoG2 0.8B | 51.7 | 18.3 | 45.5 | 38.5 | 29.2 | 30.3 | 37.6 | 32.3 |
|
| 289 |
+
| AgentDoG2 2B | 59.8 | 21.5 | 52.9 | 44.7 | 36.4 | 37.5 | 50.2 | 41.4 |
|
| 290 |
+
| AgentDoG2 4B | 61.8 | 16.1 | 46.9 | 41.6 | 39.7 | 38.3 | 47.7 | 41.9 |
|
| 291 |
+
| AgentDoG2 8B | 61.2 | 20.5 | 50.7 | 44.1 | 28.4 | 34.5 | 46.1 | 36.3 |
|
| 292 |
+
| AgentDoG2 9B | 61.2 | 19.9 | 45.9 | 42.3 | 36.7 | 35.0 | 44.5 | 38.7 |
|
| 293 |
+
|
| 294 |
+
</details>
|
| 295 |
+
|
| 296 |
+
### AgentDoG2 inference cost and latency
|
| 297 |
+
|
| 298 |
+
Internalizing the taxonomy shortens prompts, and direct structured outputs reduce decoding overhead. Against matched AgentDoG 1.5-U checkpoints, the manuscript reports **13.0–18.6×** speedups on **R-Judge**, **7.9–15.5×** on **ATBench**, and **1.9–10.8×** on **ATBench-Pro**. These are end-to-end guard-decision latency comparisons under the paper's timing protocol, not complete task-runtime speedups.
|
| 299 |
+
|
| 300 |
+
<p align="center">
|
| 301 |
+
<img src="./figs/base-latency.png" width="95%" alt="Matched end-to-end latency and speedups of AgentDoG2 versus AgentDoG 1.5-U across R-Judge, ATBench and ATBench-Pro" />
|
| 302 |
+
</p>
|
| 303 |
+
|
| 304 |
+
<details>
|
| 305 |
+
<summary>Cost–effectiveness comparisons across the trajectory benchmarks</summary>
|
| 306 |
+
|
| 307 |
+
<p align="center">
|
| 308 |
+
<img src="./figs/base-pareto-binary.png" width="95%" alt="Unsafe F1 versus inference cost on R-Judge, ATBench and ATBench-Pro" />
|
| 309 |
+
</p>
|
| 310 |
+
|
| 311 |
+
<p align="center">
|
| 312 |
+
<img src="./figs/base-pareto-fine.png" width="95%" alt="Fine-grained mean diagnosis accuracy versus inference cost on ATBench and ATBench-Pro" />
|
| 313 |
+
</p>
|
| 314 |
+
|
| 315 |
+
The first plot compares binary unsafe-class F1 with inference cost; the second compares mean diagnosis accuracy on unsafe trajectories with inference cost. Cost follows the manuscript's stated provider pricing and token accounting.
|
| 316 |
+
|
| 317 |
+
</details>
|
| 318 |
+
|
| 319 |
+
### AgentDoG-Jev trajectory results
|
| 320 |
+
|
| 321 |
+
The following tables separate **binary safety judgment** from **fine-grained diagnosis**. A checkpoint's inference interface and label map determine which task it supports.
|
| 322 |
+
|
| 323 |
+
| Model | R-Judge Acc | R-Judge F1 | ATBench Acc | ATBench F1 | ATBench-Pro Acc | ATBench-Pro F1 | Overall Acc | Overall F1 |
|
| 324 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 325 |
+
| AgentDoG-Jev 0.8B | 80.3 | 81.3 | 51.2 | 64.9 | 40.7 | 52.4 | 57.4 | 66.2 |
|
| 326 |
+
| AgentDoG-Jev 2B | 85.5 | 86.2 | 63.7 | 70.4 | 54.9 | 53.9 | 68.0 | 70.2 |
|
| 327 |
+
| AgentDoG-Jev 4B | 86.4 | 87.6 | 69.0 | 70.9 | 71.7 | 68.9 | 75.7 | 75.8 |
|
| 328 |
+
| AgentDoG-Jev 4B-U | 81.9 | 84.3 | 77.1 | 77.9 | 71.9 | 58.5 | 77.0 | 73.6 |
|
| 329 |
+
| AgentDoG-Jev 8B | 75.4 | 80.2 | 66.2 | 72.6 | 44.7 | 57.4 | 62.1 | 70.1 |
|
| 330 |
+
|
| 331 |
+
All scores are percentages; F1 is unsafe-class F1. Overall is the unweighted mean across the three benchmarks. The paper's `4B-U` decision model is the binary export derived from the unified AgentDoG 1.5 checkpoint.
|
| 332 |
+
|
| 333 |
+
<details>
|
| 334 |
+
<summary>Full Jev binary comparison with decision models, guards and matched AgentDoG 1.5 baselines</summary>
|
| 335 |
+
|
| 336 |
+
| Model | R-Judge Acc | R-Judge F1 | ATBench Acc | ATBench F1 | ATBench-Pro Acc | ATBench-Pro F1 | Overall Acc | Overall F1 |
|
| 337 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 338 |
+
| ShieldAgent-7B | 79.8 | 83.8 | 66.5 | 71.8 | 68.1 | 49.3 | 71.5 | 68.3 |
|
| 339 |
+
| Qwen3Guard-Gen-8B | 52.7 | 25.6 | 54.5 | 23.3 | 59.7 | 0.0 | 55.6 | 16.3 |
|
| 340 |
+
| GuardReasoner-8B | 64.5 | 65.4 | 49.9 | 45.3 | 59.1 | 3.3 | 57.8 | 38.0 |
|
| 341 |
+
| Intern-Decision-4B | 81.4 | 84.1 | 56.0 | 62.1 | 60.7 | 3.9 | 66.0 | 50.0 |
|
| 342 |
+
| Kev-4B | 77.1 | 79.9 | 59.3 | 50.4 | 60.5 | 4.4 | 65.6 | 44.9 |
|
| 343 |
+
| JevK5-4B | 86.0 | 87.8 | 59.3 | 61.9 | 61.9 | 12.0 | 69.1 | 53.9 |
|
| 344 |
+
| Decider-4B | 75.9 | 73.6 | 51.7 | 26.7 | 59.6 | 4.7 | 62.4 | 35.0 |
|
| 345 |
+
| Clef-Flash 9B | 84.8 | 84.5 | 53.2 | 34.3 | 60.6 | 3.0 | 66.2 | 40.6 |
|
| 346 |
+
| AgentDoG 1.5 0.8B | 78.6 | 75.0 | 62.9 | 55.1 | 61.5 | 46.4 | 67.7 | 58.8 |
|
| 347 |
+
| AgentDoG 1.5 2B | 87.2 | 86.7 | 63.7 | 54.0 | 64.6 | 42.5 | 71.8 | 61.1 |
|
| 348 |
+
| AgentDoG 1.5 4B | 88.8 | 89.6 | 69.3 | 71.5 | 66.4 | 52.4 | 74.8 | 71.2 |
|
| 349 |
+
| AgentDoG 1.5 4B-U | 90.8 | 90.8 | 78.1 | 75.4 | 67.4 | 40.1 | 78.8 | 68.8 |
|
| 350 |
+
| AgentDoG 1.5 8B | 86.4 | 87.6 | 64.9 | 69.3 | 59.8 | 63.3 | 70.4 | 73.4 |
|
| 351 |
+
| AgentDoG-Jev 0.8B | 80.3 | 81.3 | 51.2 | 64.9 | 40.7 | 52.4 | 57.4 | 66.2 |
|
| 352 |
+
| AgentDoG-Jev 2B | 85.5 | 86.2 | 63.7 | 70.4 | 54.9 | 53.9 | 68.0 | 70.2 |
|
| 353 |
+
| AgentDoG-Jev 4B | 86.4 | 87.6 | 69.0 | 70.9 | 71.7 | 68.9 | 75.7 | 75.8 |
|
| 354 |
+
| AgentDoG-Jev 4B-U | 81.9 | 84.3 | 77.1 | 77.9 | 71.9 | 58.5 | 77.0 | 73.6 |
|
| 355 |
+
| AgentDoG-Jev 8B | 75.4 | 80.2 | 66.2 | 72.6 | 44.7 | 57.4 | 62.1 | 70.1 |
|
| 356 |
+
|
| 357 |
+
</details>
|
| 358 |
+
|
| 359 |
+
**Fine-grained Jev diagnosis** (accuracy, %):
|
| 360 |
+
|
| 361 |
+
| Model | ATBench RS | ATBench FM | ATBench Harm | ATBench Mean | ATBench-Pro RS | ATBench-Pro FM | ATBench-Pro Harm | ATBench-Pro Mean |
|
| 362 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 363 |
+
| AgentDoG-Jev 0.8B | 56.1 | 20.3 | 51.3 | 42.6 | 16.9 | 34.2 | 5.6 | 18.9 |
|
| 364 |
+
| AgentDoG-Jev 2B | 61.6 | 23.1 | 56.5 | 47.1 | 46.4 | 37.0 | 43.6 | 42.3 |
|
| 365 |
+
| AgentDoG-Jev 4B | 63.4 | 28.8 | 60.0 | 50.7 | 43.0 | 32.9 | 30.4 | 35.4 |
|
| 366 |
+
| AgentDoG-Jev 8B | 63.4 | 28.4 | 56.7 | 49.5 | 22.9 | 18.2 | 45.1 | 28.7 |
|
| 367 |
+
|
| 368 |
+
These rows correspond to the `FG` checkpoints. RS = Risk Source; FM = Failure Mode; Harm = Real-World Harm. Mean is the unweighted average of those three dimensions. ATBench-Pro values use **319 unsafe v3 trajectories** with reference labels in all three dimensions; this is not the full 1,000-case binary benchmark denominator.
|
| 369 |
+
|
| 370 |
+
<details>
|
| 371 |
+
<summary>Full Jev fine-grained comparison</summary>
|
| 372 |
+
|
| 373 |
+
| Model | ATBench RS | ATBench FM | ATBench Harm | ATBench Mean | ATBench-Pro RS | ATBench-Pro FM | ATBench-Pro Harm | ATBench-Pro Mean |
|
| 374 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 375 |
+
| Intern-Decision-4B | 44.3 | 19.1 | 37.4 | 33.6 | 45.1 | 7.8 | 19.8 | 24.2 |
|
| 376 |
+
| Kev-4B | 40.9 | 16.1 | 43.1 | 33.3 | 45.1 | 11.0 | 44.5 | 33.5 |
|
| 377 |
+
| JevK5-4B | 54.3 | 18.5 | 47.1 | 40.0 | 41.1 | 13.5 | 14.4 | 23.0 |
|
| 378 |
+
| Decider-4B | 41.7 | 15.5 | 36.8 | 31.3 | 44.5 | 8.2 | 26.0 | 26.2 |
|
| 379 |
+
| Clef-Flash 9B | 45.5 | 20.9 | 44.7 | 37.0 | 45.5 | 26.3 | 51.4 | 41.1 |
|
| 380 |
+
| AgentDoG 1.5 0.8B | 61.6 | 21.3 | 48.7 | 43.9 | 14.7 | 17.2 | 35.1 | 22.4 |
|
| 381 |
+
| AgentDoG 1.5 2B | 67.8 | 24.1 | 53.9 | 48.6 | 33.2 | 22.9 | 25.7 | 27.3 |
|
| 382 |
+
| AgentDoG 1.5 4B | 71.4 | 27.2 | 62.6 | 53.7 | 21.3 | 37.0 | 34.2 | 30.8 |
|
| 383 |
+
| AgentDoG 1.5 8B | 67.4 | 21.5 | 50.3 | 46.4 | 19.1 | 6.0 | 40.8 | 21.9 |
|
| 384 |
+
| AgentDoG-Jev 0.8B | 56.1 | 20.3 | 51.3 | 42.6 | 16.9 | 34.2 | 5.6 | 18.9 |
|
| 385 |
+
| AgentDoG-Jev 2B | 61.6 | 23.1 | 56.5 | 47.1 | 46.4 | 37.0 | 43.6 | 42.3 |
|
| 386 |
+
| AgentDoG-Jev 4B | 63.4 | 28.8 | 60.0 | 50.7 | 43.0 | 32.9 | 30.4 | 35.4 |
|
| 387 |
+
| AgentDoG-Jev 8B | 63.4 | 28.4 | 56.7 | 49.5 | 22.9 | 18.2 | 45.1 | 28.7 |
|
| 388 |
+
|
| 389 |
+
</details>
|
| 390 |
+
|
| 391 |
### AgentDoG-Jev efficiency
|
| 392 |
|
| 393 |
| Checkpoint / benchmark | Binary decision latency | Unsafe F1 (%) |
|
|
|
|
| 398 |
On ATBench binary judgment, Jev reports **103.9–184.9×** lower latency than its matched generative AgentDoG 1.5 variants. The corresponding binary-decision speedup on ATBench-Pro is **3.68–20.90×**. 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.
|
| 399 |
|
| 400 |
<p align="center">
|
| 401 |
+
<img src="./figs/jev-latency.png" width="95%" alt="Matched Jev and AgentDoG 1.5 latency comparisons on ATBench and ATBench-Pro" />
|
| 402 |
</p>
|
| 403 |
|
| 404 |
For fine-grained Jev evaluation on ATBench-Pro, the reported scores use **319 unsafe trajectories** with reference labels for all three diagnostic dimensions.
|
|
|
|
| 416 |
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.
|
| 417 |
|
| 418 |
<p align="center">
|
| 419 |
+
<img src="./figs/step-performance.png" width="95%" alt="Step performance across the three pre-execution benchmarks" />
|
| 420 |
</p>
|
| 421 |
|
| 422 |
## Benchmarks
|
|
|
|
| 453 |
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**.
|
| 454 |
|
| 455 |
<p align="center">
|
| 456 |
+
<img src="./figs/benchmark-overview.png" width="95%" alt="ManipulationArena attack-strategy and channel distributions over 888 cases" />
|
| 457 |
</p>
|
| 458 |
|
| 459 |
See the [benchmark section](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#benchmarks) and [Hugging Face collection](https://huggingface.co/collections/AI45Research/agentdog2-6b09556a028a2ce10c53f2fe) for the benchmark entry points.
|
| 460 |
|
| 461 |
## SafeRSI
|
| 462 |
|
| 463 |
+
SafeRSI combines **harness–policy co-evolution** with **AgentDoG-Step runtime assessment**. Failure attribution identifies whether an unsafe outcome comes from a structural execution gap, a semantic alignment failure, or both, and routes the corrective update accordingly.
|
| 464 |
+
|
| 465 |
+
### Harness evolution
|
| 466 |
+
|
| 467 |
+
1. **Attribute failures:** identify the violated norm, data flow and genuine authorization, then map the failure to natural-language policy guidance or execution-code enforcement.
|
| 468 |
+
2. **Generate patches:** consolidate related failures into principle groups and produce behavioral policies or deterministic runtime constraints. Admission checks reject shortcuts such as hardcoded task identifiers and record missing runtime capabilities.
|
| 469 |
+
3. **Validate:** compare candidate patches with a byte-identical baseline on a frozen holdout, measuring both safety and utility. Accepted patches become versioned harness artifacts; rejected patches and capability gaps feed further improvement.
|
| 470 |
+
|
| 471 |
+
<p align="center">
|
| 472 |
+
<img src="./figs/harness-evolution.png" width="95%" alt="SafeRSI harness evolution through failure attribution, policy or code patches, and paired holdout validation" />
|
| 473 |
+
</p>
|
| 474 |
+
|
| 475 |
+
### Policy evolution
|
| 476 |
+
|
| 477 |
+
A **Failure Analyst** locates the correction point in a recorded failure. A **Trajectory Synthesizer** preserves the legitimate task and risk-bearing prefix while constructing a safer continuation, and a **Trajectory Critic** checks safety, prefix consistency and task preservation. Accepted corrective demonstrations support SFT of the task-completion policy. This environment-free synthesis operates in text space, avoiding candidate execution and environment resets during demonstration generation.
|
| 478 |
+
|
| 479 |
+
<p align="center">
|
| 480 |
+
<img src="./figs/policy-evolution.png" width="95%" alt="SafeRSI policy improvement through failure analysis, safer continuation synthesis, critique and supervised fine-tuning" />
|
| 481 |
+
</p>
|
| 482 |
+
|
| 483 |
+
The policy-evolution figure illustrates **one completed SFT round** and a proposed feedback loop for further adversarial testing. It does not establish repeated policy-improvement gains. V1/V2 below identify the reported harness–policy evaluation configurations; AgentDoG-Step is an additional runtime component where stated.
|
| 484 |
+
|
| 485 |
+
### Safety and utility results
|
| 486 |
|
| 487 |
| Harness / policy | Added Step guard | AgentLAB ASR ↓ | AutoControl-Arena ASR ↓ | ManipulationArena ASR ↓ | BFCL-v3 Acc ↑ |
|
| 488 |
| --- | ---: | ---: | ---: | ---: | ---: |
|
|
|
|
| 494 |
| SafeRSI Harness V1 / SafeRSI-27B V1 | AgentDoG-Step | 22.10 | 4.31 | 21.40 | 67.39 |
|
| 495 |
| SafeRSI Harness V2 / SafeRSI-27B V2 | AgentDoG-Step | 21.07 | 3.69 | 24.21 | 64.92 |
|
| 496 |
|
| 497 |
+
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 label the two reported harness–policy configurations. — means without the added AgentDoG-Step guard, not the absence of every other runtime defense.
|
| 498 |
|
| 499 |
- **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**.
|
| 500 |
- **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.
|
| 501 |
- These are **complete system configurations**. The scores do not isolate the contribution of a downloaded SafeRSI policy checkpoint alone.
|
| 502 |
|
| 503 |
+
See [SafeRSI on the project page](https://mjc-ma-01.github.io/AgentDoG/v2_0_dark/#evolution) for further strategy-level diagnostic results.
|
| 504 |
|
| 505 |
## ⚠️ Intended Use and Limitations
|
| 506 |
|
figs/abstract.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5ee23692c76f3a24c0914d970178c86c9cd86ceca93951f60d34b5971954db69
|
| 3 |
+
size 544043
|
figs/abstract.png
ADDED
|
Git LFS Details
|
figs/base-latency.png
ADDED
|
Git LFS Details
|
figs/base-pareto-binary.png
ADDED
|
Git LFS Details
|
figs/base-pareto-fine.png
ADDED
|
Git LFS Details
|
figs/benchmark-overview.png
ADDED
|
Git LFS Details
|
figs/data-engine.png
ADDED
|
Git LFS Details
|
figs/family-agentdog2.png
ADDED
|
Git LFS Details
|
figs/harness-evolution.png
ADDED
|
Git LFS Details
|
figs/jev-inference.png
ADDED
|
Git LFS Details
|
figs/jev-latency.png
ADDED
|
Git LFS Details
|
figs/policy-evolution.png
ADDED
|
Git LFS Details
|
figs/step-performance.png
ADDED
|
Git LFS Details
|
figs/step-pipeline.png
ADDED
|
Git LFS Details
|
figs/taxonomy.png
ADDED
|
Git LFS Details
|