AgentDoG2 Technical Report

๐Ÿ™ GitHub   |   ๐Ÿค— Models and Datasets   |   ๐Ÿ“„ Technical report [Coming soon]   |   ๐ŸŒ Project Page   |   ๐ŸŽฌ Demos   |   ๐Ÿš€ Getting Started

AgentDoG2: An Efficient Alignment Framework for Emergent Risk in Long-Horizon Agent Tasks

Model Zoo  ยท  Benchmarks  ยท  Results  ยท  SafeRSI

This repository: AI45Research/SafeRSI-27B-V1
Role: Task-completion policy from harnessโ€“policy co-evolution; not a standalone safety classifier.
Published artifacts: model weights, configuration and tokenizer.

Introduction

AgentDoG2 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. AgentDoG2 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.

Model Zoo

The following public repositories contain model weights, configurations and tokenizers. Select the repository for the task you need; the families use different inference interfaces.

AgentDoG2: structured trajectory diagnosis

Checkpoint Role Size Base checkpoint
AgentDoG2-Qwen3.5-0.8B Generative trajectory diagnosis 0.8B Qwen/Qwen3.5-0.8B-Base
AgentDoG2-Qwen3.5-2B Generative trajectory diagnosis 2B Qwen/Qwen3.5-2B-Base
AgentDoG2-Qwen3.5-4B Generative trajectory diagnosis 4B Qwen/Qwen3.5-4B-Base
Llama-3.1-AgentDoG2-8B Generative trajectory diagnosis 8B meta-llama/Llama-3.1-8B
AgentDoG2-Qwen3.5-9B Generative trajectory diagnosis 9B Qwen/Qwen3.5-9B-Base

AgentDoG-Jev: single-pass trajectory evaluation

Checkpoint Role Size Base checkpoint
AgentDoG-Jev-Qwen3.5-0.8B Single-pass binary safety judgment 0.8B AI45Research/AgentDoG1.5-Qwen3.5-0.8B
AgentDoG-Jev-Qwen3.5-4B Single-pass binary safety judgment 4B AI45Research/AgentDoG1.5-Qwen3.5-4B
AgentDoG-Jev-Qwen3.5-4B-U Single-pass binary safety judgment 4B AI45Research/AgentDoG1.5-Unified-Qwen3.5-4B
AgentDoG-Jev-Qwen3.5-2B Single-pass binary safety judgment 2B AI45Research/AgentDoG1.5-Qwen3.5-2B
Llama-3.1-AgentDoG-Jev-8B Single-pass binary safety judgment 8B AI45Research/AgentDoG1.5-Llama-3.1-8B
AgentDoG-Jev-FG-Qwen3.5-0.8B Single-pass fine-grained diagnosis 0.8B AI45Research/AgentDoG1.5-FG-Qwen3.5-0.8B
AgentDoG-Jev-FG-Qwen3.5-2B Single-pass fine-grained diagnosis 2B AI45Research/AgentDoG1.5-FG-Qwen3.5-2B
AgentDoG-Jev-FG-Qwen3.5-4B Single-pass fine-grained diagnosis 4B AI45Research/AgentDoG1.5-FG-Qwen3.5-4B
Llama-3.1-AgentDoG-Jev-FG-8B Single-pass fine-grained diagnosis 8B 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 Pre-execution action assessment 0.8B Qwen/Qwen3.5-0.8B-Base
AgentDoG-Step-Qwen3.5-2B Pre-execution action assessment 2B Qwen/Qwen3.5-2B-Base
AgentDoG-Step-Qwen3.5-4B Pre-execution action assessment 4B Qwen/Qwen3.5-4B-Base
Llama-3.1-8B-AgentDoG-Step Pre-execution action assessment 8B meta-llama/Llama-3.1-8B
AgentDoG-Step-Qwen3.5-9B Pre-execution action assessment 9B Qwen/Qwen3.5-9B-Base

SafeRSI: evolved task-completion policies

Checkpoint Role Size Base checkpoint
SafeRSI-27B-V1 Evolved task-completion policy 27B Not declared in repository metadata
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.

Safety Taxonomy and Tasks

Family Input Inference Output and use
AgentDoG2 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.

Expanded AgentDoG2 taxonomy: 18 risk sources, 21 failure modes and 11 harms

AgentDoG2 Guardrails

Building Pipeline

  • AgentDoG2 first learns the expanded taxonomy and structured output format through supervised fine-tuning (SFT), then uses Group Reward-Decoupled Normalization Policy Optimization (GDPO) to refine verdicts and diagnostic fields.
  • AgentDoG-Jev scores allowed labels at mapped decision positions in one forward pass. Binary and fine-grained exports use their own decision schemas.
  • AgentDoG-Step trains on the interaction history and pending action using SFT and GDPO. Its judgment is made before the action's outcome becomes visible.

AgentDoG2, AgentDoG-Jev and AgentDoG-Step family overview

Getting Started

Download and load this policy

Install PyTorch, Accelerate, the HF CLI and a Transformers build that supports Qwen3_5ForConditionalGeneration:

python -m pip install -U torch accelerate transformers huggingface_hub
hf download AI45Research/SafeRSI-27B-V1 --local-dir ./model

The published configuration declares Qwen3_5ForConditionalGeneration and records Transformers 5.8.0. Use a Transformers version that supports this architecture; the configuration's saved version is not a separately verified minimum dependency version.

from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration

model_id = "AI45Research/SafeRSI-27B-V1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
    model_id,
    device_map="auto",
    dtype="auto",
)

This is a loading example, not a reproduction of the SafeRSI evaluation system. The repository publishes policy weights, tokenizer and configuration, but no dedicated inference.py, evolved harness package or step-guard integration. Use the tokenizer's chat template and supply the intended agent task, tool specifications and model-visible history when integrating the policy into a runtime.

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 output

Use 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.

Evaluation

All 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.

AgentDoG2 trajectory safety

Model R-Judge Acc (%) R-Judge F1 (%) ATBench Acc (%) ATBench F1 (%) ATBench-Pro Acc (%) ATBench-Pro F1 (%)
AgentDoG2 0.8B 76.6 71.7 76.3 76.1 75.4 58.6
AgentDoG2 2B 80.1 79.9 80.3 81.7 78.3 69.4
AgentDoG2 4B 83.3 83.3 78.1 76.7 80.3 69.7
AgentDoG2 8B 78.4 74.5 73.5 75.3 81.0 71.8
AgentDoG2 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
AgentDoG2 0.8B 51.7 18.3 45.5 38.5 29.2 30.3 37.6 32.3
AgentDoG2 2B 59.8 21.5 52.9 44.7 36.4 37.5 50.2 41.4
AgentDoG2 4B 61.8 16.1 46.9 41.6 39.7 38.3 47.7 41.9
AgentDoG2 8B 61.2 20.5 50.7 44.1 28.4 34.5 46.1 36.3
AgentDoG2 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. 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.

Matched Jev and AgentDoG 1.5 latency comparisons on ATBench and ATBench-Pro

For fine-grained Jev evaluation on ATBench-Pro, the reported scores use 319 unsafe trajectories with reference labels for all three diagnostic dimensions.

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.

Step performance across the three pre-execution benchmarks

Benchmarks

ATBench-Pro

ATBench-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.

ManipulationArena

ManipulationArena 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.

ManipulationArena attack-strategy and channel distributions over 888 cases

See the benchmark section and Hugging Face collection for the benchmark entry points.

SafeRSI

SafeRSI 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 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.

๐Ÿ“œ License

A checkpoint-specific license is not currently declared in this repository. This model card does not establish a license for the weights; obtain the applicable terms from the model publisher before redistribution.

๐Ÿ“– Citation

Project reference (software/repository citation):

@software{agentdog2,
  title = {AgentDoG2: 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 AgentDoG2 technical report. A verified report citation can replace it when available.

๐Ÿค Acknowledgements

We thank the trajectory-safety benchmark contributors and the Jev project, whose structured-decision approach underlies AgentDoG-Jev. This work builds on prior research in agent safety, trajectory evaluation and risk-aware AI systems.

๐Ÿ”— Resources

Downloads last month
-
Safetensors
Model size
27B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including AI45Research/SafeRSI-27B-V1