Image-Text-to-Text
Transformers
Safetensors
qwen3_vl
vision-language
mobile-gui-agent
gui-safety
world-model
safety-guardrail
action-risk-assessment
semantic-next-state-prediction
qwen3-vl
conversational
Instructions to use xue-26/SAWM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xue-26/SAWM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="xue-26/SAWM") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("xue-26/SAWM") model = AutoModelForMultimodalLM.from_pretrained("xue-26/SAWM", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xue-26/SAWM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xue-26/SAWM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xue-26/SAWM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/xue-26/SAWM
- SGLang
How to use xue-26/SAWM 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 "xue-26/SAWM" \ --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": "xue-26/SAWM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "xue-26/SAWM" \ --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": "xue-26/SAWM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use xue-26/SAWM with Docker Model Runner:
docker model run hf.co/xue-26/SAWM
File size: 9,679 Bytes
1c12c1c 35fbfce e8d388d 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce 15bb86c 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 5761ec8 d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce 1715bda d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce 1715bda 35fbfce 1715bda 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce 1715bda 35fbfce d8e25ce 35fbfce 1715bda d8e25ce 35fbfce 1715bda 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 9a71991 d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 9a71991 d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce 358d465 cc1895b 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce d8e25ce 35fbfce | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | ---
license: apache-2.0
pipeline_tag: image-text-to-text
library_name: transformers
tags:
- vision-language
- mobile-gui-agent
- gui-safety
- world-model
- safety-guardrail
- action-risk-assessment
- semantic-next-state-prediction
- qwen3-vl
datasets:
- MobileWorld
- MobileSafetyBench
- MobileRisk
metrics:
- safety-utility-score
- risk-cost-score
- accuracy
- f1
---
# SeerGuard: A Safety Framework for Mobile GUI Agents via World Model Prediction
**A plug-and-play, consequence-aware safety framework for securing mobile GUI agents before execution.**
[Project Website](https://seerguard.github.io/) | [Evaluation Code and Benchmarks](https://github.com/Autonomous-Agent-Team/SeerGuard.git)
SeerGuard protects mobile GUI agents before risky operations reach a real device. It introduces two pre-execution safeguards:
1. **Instruction-level screening** blocks explicitly malicious or unauthorized requests before task execution begins.
2. **Action-level risk assessment** predicts the consequence of each candidate action and blocks unsafe operations before they are executed.
At the core of SeerGuard is **SAWM**, a Safety-Augmented World Model built on Qwen3-VL-8B-Instruct. Given a mobile GUI screenshot, the user instruction, and a candidate action, SAWM predicts the semantic next state, evaluates the resulting risk, and returns a concise rationale.
This repository provides the **SAWM model weights**.
## Model Positioning
SeerGuard is designed as an **external guard model**, not as a replacement for the mobile GUI agent.
- **Plug-and-play integration:** SeerGuard can be inserted between an agent's planner and action executor as an independent safety checkpoint.
- **No fine-tuning of the protected agent:** Existing GUI-agent weights, planning policies, and action-generation logic do not need to be retrained or modified.
- **Agent-agnostic protection:** The same guardrail can be paired with different open- or closed-source GUI-agent backbones.
- **Pre-execution intervention:** Unsafe instructions and candidate actions are intercepted before they change the device state.
- **Low-friction deployment:** Integration only requires forwarding the instruction, current screenshot, and candidate action to the guard model before execution.
> **Clarification:** SAWM itself is fine-tuned from Qwen3-VL-8B-Instruct. "No fine-tuning" means that deploying SeerGuard does not require additional training or weight updates for the GUI agent being protected.
<a href="https://chat.qwenlm.ai/" target="_blank" style="margin: 2px;">
<img alt="Chat" src="assets/overview.png" style="display: inline-block; vertical-align: middle;"/>
</a>
## Why SeerGuard
Mobile GUI agents interact with live applications, accounts, data, and device settings. A single incorrect tap may trigger an unauthorized payment, expose private information, send harmful content, delete data, or change a security-sensitive configuration.
Conventional post-hoc safety checkers review an interaction after the action has already occurred. SeerGuard instead performs **proactive consequence auditing**:
```text
GUI agent proposes an action
|
v
SeerGuard predicts the semantic consequence
|
v
Safety decision: safe or unsafe
```
This design enables the host agent to retain its original task-completion capabilities while SeerGuard independently handles safety assessment.
## Core Capabilities
### 1. Instruction-Level Screening
Before the GUI agent interacts with the device, SAWM determines whether the user request is explicitly malicious, unauthorized, or in conflict with core safety policies.
```text
Input:
- User instruction
Output:
- safety-judge: safe or unsafe,
- safety-reason: Brief explanation
```
Unsafe instructions are rejected before planning and execution.
### 2. Semantic Next-State Prediction
For each candidate action, SAWM predicts the likely functional consequence in natural language. It focuses on the semantic state transition rather than generating the next screen at the pixel level.
Examples include:
- a payment confirmation will be submitted;
- a message will be sent to a specific recipient;
- full-photo-library access will be granted;
- user data will be deleted;
- a security-sensitive setting will be changed.
### 3. Action-Level Risk Assessment
SAWM evaluates whether the predicted consequence is safe and provides a rationale for the decision.
```text
Input:
- Current mobile GUI screenshot
- User instruction
- Candidate action
Output:
- Current screen analysis
- Predicted semantic next state
- Safety rationale
- Action safety label: safe | unsafe
```
If the action is unsafe, SeerGuard blocks it before execution. Otherwise, the host agent proceeds normally.
The GUI agent remains responsible for perception, planning, and task completion. SeerGuard only decides whether a request or candidate action should be allowed to proceed.
## Model Architecture
SAWM uses **Qwen3-VL-8B-Instruct** as its backbone and is trained under a unified autoregressive formulation. It jointly learns:
- visual GUI understanding;
- malicious-instruction detection;
- semantic state-transition prediction;
- action-risk classification;
- natural-language safety rationale generation.
For action-level assessment, the model returns a structured response:
```json
{
"ui_context_analysis": "...",
"action_consequence_prediction": "...",
"risk_evaluation": "...",
"safety_judgment": "SAFE" | "UNSAFE"
}
```
## Training Data
SAWM is trained with a multi-task corpus that combines mobile world-modeling data with safety-augmentation data:
1. **General Textual Safety Data**
- Provides broad safety alignment and malicious-instruction detection.
2. **Multimodal Mobile Risk Data**
- Contains GUI trajectories with safety labels, semantic next-state descriptions, and rationales
3. **MobileWorld Next-State QA Data**
- Provides mobile GUI state-transition and action-consequence prediction capability.
4. **Synthetic Textual Mobile Risk Data**
- Bridges general text-only safety concepts and visually grounded mobile GUI risks.
The final training corpus contains approximately **148K instances**. SAWM is fine-tuned for **1 epoch** with a learning rate of **1e-6**.
## Evaluation
Full evaluation code and benchmark instructions are available in the [SeerGuard GitHub repository](https://github.com/Autonomous-Agent-Team/SeerGuard.git).
### Framework-Level Evaluation
On **MobileSafetyBench**, SeerGuard improves the safety-utility trade-off across Qwen3-VL, GPT-5.1, and Gemini-3.1 GUI-agent backbones.
For Qwen3-VL at a safety-priority setting of 0.8:
- Risk-Cost Score decreases from **0.347** to **0.130**.
- Safety-Utility Score increases from **0.191** to **0.596**.
[](https://github.com/Autonomous-Agent-Team/SeerGuard.git)
### Instruction-Level Screening
SAWM is evaluated on Agent-SafetyBench and Prompt Injection benchmarks. On the Prompt Injection benchmark, SAWM achieves an F1 score of **0.922**, demonstrating strong risk detection while limiting unnecessary refusal of safe requests.
[](https://github.com/Autonomous-Agent-Team/SeerGuard.git)
### Action-Level Risk Assessment
On **MobileRisk**, SAWM achieves:
- **F1: 0.723**
- **Step Score: 0.361**
Both are the best results among the compared methods, showing that SAWM can identify unsafe trajectories and locate the onset of risk.
[](https://github.com/Autonomous-Agent-Team/SeerGuard.git)
### Semantic Next-State Prediction
On Next-State-QA, SAWM reaches an accuracy of **0.762**, providing the predictive grounding required for consequence-aware action auditing.
## Intended Use
SAWM is intended for research and development of safety guardrails for mobile GUI agents.
Typical use cases include:
- proactive safety monitoring for mobile GUI agents;
- malicious-instruction filtering;
- pre-execution action-risk assessment;
- semantic next-state prediction;
- safety evaluation across different GUI-agent backbones;
- safety-utility trade-off analysis for autonomous mobile agents.
## Resources
- **Project Website:** https://seerguard.github.io/
- **Evaluation Code and Benchmarks:** https://github.com/Autonomous-Agent-Team/SeerGuard.git
- **Backbone Model:** Qwen3-VL-8B-Instruct
## Citation
If you find this model useful, please cite the SeerGuard paper:
```bibtex
@misc{yu2026seerguardsafetyframeworkmobile,
title={SeerGuard: A Safety Framework for Mobile GUI Agents via World Model Prediction},
author={Xue Yu and Bo Yuan and Pengshuai Yang and Kailin Zhao and Hong Hu and Junlan Feng},
year={2026},
eprint={2607.15550},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2607.15550},
}
```
```bibtex
@inproceedings{seerguard2026,
title = {SeerGuard: A Safety Framework for Mobile GUI Agents via World Model Prediction},
author = {Xue Yu and Bo Yuan and Pengshuai Yang and Kailin Zhao and Hong Hu and Junlan Feng},
booktitle = {Proceedings of the ACM Multimedia Conference},
year = {2026},
note = {To appear}
}
```
SAWM is built on Qwen3-VL-8B-Instruct. Please also cite the corresponding Qwen-VL technical report when using this model.
```bibtex
@misc{qwen3technicalreport,
title = {Qwen3 Technical Report},
author = {Qwen Team},
year = {2025},
eprint = {2505.09388},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2505.09388}
}
```
|