SaFeR-ToolKit: Structured Reasoning via Virtual Tool Calling for Multimodal Safety

Zixuan Xu, Tiancheng He, Huahui Yi, Kun Wang, Xi Chen, Gongli Xi, Qiankun Li, Kang Li, Yang Liu, Zhigang ZengarXiv 2026

TL;DR

SaFeR-ToolKit formalizes vision-language model (VLM) safety alignment as an explicit, auditable decision-making protocol using virtual tool calling. By structuring intermediate reasoning into a constrained Perception $\to$ Reasoning $\to$ Decision pipeline and training it via a progressive three-stage curriculum (SFT $\to$ DPO $\to$ GRPO), the framework drastically reduces jailbreak vulnerabilities and over-refusal while fully preserving general multimodal capabilities.

What Problem Does This Paper Address?

While vision-language models are increasingly deployed as real-world assistants, they remain highly susceptible to multimodal jailbreaks (where adversarial images trick the model into bypassing safety rules) and over-refusal (where benign requests are rejected out of caution).

A core structural issue is that standard safety alignment treats safety as a black box, optimizing only the final response. When an image contains a prompt injection, the model lacks an explicit step to verify if the text instruction aligns with the visual evidence. Because this decision process remains implicit, auditing failures or applying targeted fixes is incredibly difficult. The authors aim to bridge this deployment gap by turning safety into an inspectable, verifiable, and structured protocol.

Methods

The authors introduce SaFeR-ToolKit, a framework that inserts a structured decision process defined by virtual safety tools before generating a final answer.

Figure 1. Overview of SaFeR-ToolKit. (a) Motivating Example: Unlike baseline refusals, SaFeR-ToolKit uses dynamic ToolKit thinking (Perception →Reasoning →Decision) to generate safe and educational responses. (b) Data Statistics: Dataset distribution across training stages (SFT, DPO, GRPO) and tool categories. (c) Evaluation: Ablation studies demonstrating stage-wise improvements (left) and performance comparisons with SOTA baselines (right).

The architecture splits the task between two components:

  1. The Planner: Evaluates the input risk category and selects a responder persona, a subset of virtual tools, and a constrained topology template (e.g., linear, tree, mesh, shield, or loop) that dictates how tools can transition.
  2. The Responder: Executes the tools sequentially under the topology constraints, outputting a typed key-value tool trace across three distinct layers:
  3. Perception ($T^P$): Grounding visual evidence (e.g., [VISUAL-VERIFY], [OCR-EXTRACT]).
  4. Reasoning ($T^R$): Analyzing intent and policy violations (e.g., [INTENT-CLASSIFIER], [HARM-PREDICTOR]).
  5. Decision ($T^D$): Determining the final action or safety intervention (e.g., [BOUNDARY-GATE], [EDUCATION-PIVOT]).

To ensure the model reliably follows this protocol, they implement a three-stage training curriculum:

  • Stage 1: SFT (Supervised Fine-Tuning): Teaches the model basic tool execution and schema adherence.
  • Stage 2: DPO (Direct Preference Optimization): Refines tool selection by contrasting correct traces against structurally degraded ones (e.g., omitting steps or introducing logical contradictions), suppressing logical hallucinations.
  • Stage 3: GRPO (Group Relative Policy Optimization): Uses reinforcement learning with a compound reward function (evaluating format compliance, tool-calling depth, and semantic correctness) to help the model dynamically scale its reasoning depth based on input complexity.
Figure 2. SaFeR-ToolKit overview and training pipeline. Given an image-question input, a planner selects a persona, a virtual tool subset, and a topology (linear/tree/mesh/shield/loop); the responder then produces a structured tool trace and final answer. SFT learns the trace format and basic tool usage, DPO improves tool selection and execution, and GRPO refines deeper tool-based reasoning.

Datasets

The paper introduces the first tool-based safety reasoning dataset, containing 31,654 examples split into:

  • 6,000 SFT demonstrations
  • 18,654 DPO preference pairs
  • 6,000 GRPO queries
  • 1,000 held-out evaluation samples called ToolkitBench

The dataset balances safety-critical data synthesized from existing benchmarks—such as BeaverTails-V, JailBreakV-28k, Hateful Memes, and SPA-VL—with general reasoning tasks from ALLaVA-4V and Geometry3K.

Key Insights and Ideas

  • Process over Outcome: Instead of just grading the final answer, forcing the model to generate a checkable, protocolized intermediate trace makes safety "safe by design."
  • Complementary Rewards: The combination of a logarithmic depth reward (penalizing shallow traces) and a tool-quality semantic reward prevents the model from taking shortcuts or outputting redundant, repetitive tool calls.
  • Dynamic Adaptation: Rather than rigidly mimicking a fixed chain of thought, the GRPO stage allows the model to act as an active agent, adjusting its reasoning depth dynamically depending on whether a prompt is benign, ambiguous, or a complex jailbreak.

Key Results

The framework was evaluated on Qwen2.5-VL (3B and 7B variants) across five safety benchmarks, measuring percentages for Safety, Helpfulness, and Reasoning Rigor:

  • Qwen2.5-VL-3B: Safety/Helpfulness/Reasoning Rigor surged from 29.39 / 45.04 / 4.98 to 84.40 / 71.13 / 78.87.
  • Qwen2.5-VL-7B: Improved from 53.21 / 52.92 / 19.26 to 86.34 / 80.79 / 85.34.

Crucially, while traditional guard-based baselines drastically hurt a model's helpfulness due to over-refusal, SaFeR-ToolKit actually improves helpfulness by safely pivoting to educational or alternative context when a request involves benign objects in safe contexts (e.g., a historical bomb in a museum). Furthermore, general multimodal capabilities were completely preserved, even showing slight average improvements (3B: 58.67 $\to$ 59.21; 7B: 66.39 $\to$ 66.81).

Limitations and Future Work

The authors note that while the 60 predefined tools cover standard safety scenarios, novel attack patterns will inevitably emerge. To mitigate this, SaFeR-ToolKit supports dynamic tool extension on-the-fly, allowing planners to define new tools without architectural changes. However, a dedicated, standalone limitations section detailing the computational overhead or latency introduced by generating these long virtual tool traces was not explicitly discussed in the paper.

Summary updated

BibTeX
@misc{xu2026safer,
  author = {Zixuan Xu and Tiancheng He and Huahui Yi and Kun Wang and Xi Chen and Gongli Xi and Qiankun Li and Kang Li and Yang Liu and Zhigang Zeng},
  title = {{SaFeR-ToolKit: Structured Reasoning via Virtual Tool Calling for Multimodal Safety}},
  year = {2026},
  eprint = {2603.02635},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.02635},
}

Loading related content...

Figure