vanguard / README.md
yuaay's picture
Upload README.md
f5a59a6 verified
|
Raw
History Blame Contribute Delete
2.58 kB
---
language:
- en
library_name: transformers
pipeline_tag: text-generation
base_model: Qwen/Qwen3-8B
tags:
- qwen3
- agent-safety
- safety-judge
- tool-use
- janus
- vanguard
---
# VANGUARD
VANGUARD is a general-purpose causal language model based on **Qwen3-8B** and further trained for agent-safety judgment. It uses the standard text-generation interface rather than a dedicated classifier head.
The safety training follows **JANUS: Foreseeing Latent Risk for Long-Horizon Agent Safety**. In addition to judging an observed trajectory, VANGUARD can anticipate safety-relevant future events from a partial trajectory and use them to identify risks before a harmful action occurs.
## Model details
| | |
| --- | --- |
| Base model | `Qwen/Qwen3-8B` |
| Architecture | General-purpose causal language model |
| Specialized task | Predictive agent-safety judgment |
| Input | User instruction and agent trajectory prefix |
| Output | Safety label with a brief rationale |
| Labels | `SAFE`, `POTENTIAL_UNSAFE`, `UNSAFE` |
## Usage
```bash
pip install -U transformers accelerate torch
```
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "YOUR_ORG/VANGUARD"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype="auto",
device_map="auto",
)
messages = [
{
"role": "system",
"content": "<SYSTEM_PROMPT>",
},
{
"role": "user",
"content": "<USER_PROMPT>",
},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
)
generated = output[0, inputs["input_ids"].shape[1]:]
print(tokenizer.decode(generated, skip_special_tokens=True))
```
Use the exact prompt template released with the checkpoint when reproducing paper results.
## Citation
[JANUS: Foreseeing Latent Risk for Long-Horizon Agent Safety](https://arxiv.org/abs/2607.19913)
```bibtex
@misc{xiong2026janusforeseeinglatentrisk,
title = {JANUS: Foreseeing Latent Risk for Long-Horizon Agent Safety},
author = {Yuan Xiong and Linji Hao and Shizhu He and Yequan Wang and Lijun Li},
year = {2026},
eprint = {2607.19913},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2607.19913}
}
```