National Cyber Warfare Foundation (NCWF)login

Dissecting Visco-Attack: how image-driven context injection stress-tests multimodal LLM guardrails


0 user ratings
2026-11-18 11:25:23
milo
Red Team (CNA)
"Dissecting

Visco-Attack is a research pipeline that probes multimodal LLM safety by fabricating image-grounded, multi-turn dialogue contexts, built for red-teaming and alignment evaluation in authorized settings.








ToolDtc7w3PQ/Visco-Attack — official implementation of the EMNLP 2025 visual-contextual jailbreak framework against multimodal LLMs
CategoryLLM red-teaming / adversarial ML research pipeline
Primary UseReproducing and studying jailbreak attack-success rates against MLLMs such as GPT-4o and Gemini 2.0 flash on benchmarks like MM-SafetyBench and HarmBench
Safe UseIntended for authorized AI-safety research, internal red-team evaluations of models you own or are contracted to assess, and alignment benchmarking in lab environments — the README itself restricts it to research and safety purposes
Telemetry NoteThe pipeline generates dense, detectable artifacts — fabricated multi-turn image contexts with templated structures from prompts/*.md, plus SD3.5-rendered imagery; guardrail and moderation researchers can use these signatures to train and evaluate multimodal safety classifiers

Visco-Attack is the official code release for "Visual Contextual Attack: Jailbreaking MLLMs with Image-Driven Context Injection," accepted to EMNLP 2025 Main and published as arXiv:2507.02844. What distinguishes it from the crowd of jailbreak scripts is its core thesis: an image is not a trigger bolted onto a prompt, but the load-bearing element of a fabricated, realistic multi-turn conversation. The framework, written in Python, automatically constructs that spoofed context, weaves in generated imagery, and measures how reliably state-of-the-art multimodal LLMs abandon their guardrails — a capability of direct interest to authorized model-safety teams building better defenses.


The method reports an attack-success rate of 85–91 percent in a fully black-box setting against GPT-4o, Gemini 2.0 flash, and InternVL-2.5, evaluated on MM-SafetyBench, FigStep-SafeBench, and HarmBench, with toxicity scores above 4.7 out of 5 as judged by an LLM evaluator. Those numbers are the headline of the paper, but the repository itself is what matters operationally: it ships the entire six-stage pipeline, the prompt templates, a Hugging Face dataset of prebuilt attack contexts with over 10,000 downloads, and a smoke-test harness that validates the whole chain in roughly five minutes.


Architecturally, the tool is a staged data factory. build_visco_attack.py dispatches six stages, each isolated in src/stages/ as its own module: stage1_extract_t2i_prompt.py pulls text-to-image prompts out of the benchmark questions, stage2_diffusion_core_image.py renders them locally with Stable Diffusion 3.5 via diffusers.StableDiffusion3Pipeline, stage3_build_spoof_context.py fabricates the multi-turn context, stage4_diffusion_extra_images.py renders supplementary images, stage5_attack_target.py queries the model under test, and stage6_evaluate.py runs GPT-4o-as-judge scoring. This modularity is a genuine engineering strength — each stage is independently runnable with RUN_STAGE=N ./run.sh, which makes partial reproduction and component-level study practical in a research lab.


The intellectual heart of the method is stage 3, and the README documents it with unusual clarity. The pipeline operates across four image-centric strategies: Image-Grounded Scenario Simulation (scenario_simulation), Multi-Perspective Analysis (multi_perspective), Iterative Interrogation (iterative_interrogation), and Hallucination Exploitation (image_hallucination), each with its own template in prompts/*.md. Inside the refinement loop — default four rounds — an unaligned wizard model produces a compliant reference reply that acts as a "what success looks like" exemplar, then a generator model compares it against the current attack prompt and emits a JSON verdict with drift_status and revised_attack_prompt. This wizard-and-refine loop is essentially automated prompt evolution, and understanding it is essential for anyone designing defenses against iterative social-engineering-style attacks on assistants.


Configuration is centered on four distinct LLM roles defined in configs/default.yaml: generator, wizard, target, and judge, each pointed at a vLLM OpenAI-compatible endpoint. The role separation is a sensible design — the same infrastructure can evaluate many targets without touching the red-team machinery. The README is candid about model selection: safety-aligned models like GPT-4o and Claude 3.5+ refuse the templated red-team instructions, degrading output to empty or unparseable results, while uncensored derivatives such as qwen-3.5-122B-uncensored-stxt and, notably, the aligned Qwen2.5-72B-Instruct cooperate in constructing fabricated contexts. That last observation is itself a research finding about uneven alignment transfer.


The diffusion side is self-contained rather than API-dependent. src/diffusion/sd35_runner.py is a standalone worker launched via torchrun, sharding a task list across all visible GPUs, with the default configuration tuned for the distilled Turbo variant of SD3.5 at four inference steps. tools/check_diffusion.py provides a five-step preflight — dependencies, CUDA, model path, load, inference — and tools/test_pipeline_diffusion.py exercises stage 2's exact code path over ten images. This local-first approach keeps the entire experimental loop inside a controlled environment, which matters for reproducibility and for keeping evaluation traffic off third-party services.


Getting started is deliberately low-friction. Installation is a single pip install -r requirements.txt, configuration is one YAML file, and tools/run_real_smoke.sh is a one-shot end-to-end wrapper that shrinks the run to three questions, one strategy, and two rounds, printing per-stage file counts and the final ASR. For a full benchmark run, data/extract_questions.py converts MMSafetyBench JSON into flat per-question records, and env vars like SD_MODEL_PATH, NUM_GPUS, and STRATEGIES scale everything up. The repo also bundles a 20-question mini-bench in data/mmsafebench_questions.20.json for mid-sized validation runs.


For defenders, the defensive value here is substantial even though the tool is offensive in orientation. The prebuilt attack contexts on Hugging Face (miaozq/Visco-Attack) constitute a ready-made adversarial evaluation set for multimodal safety filters and content classifiers. Teams building guardrails can run the fabricated contexts against their moderation stack, measure detection rates, and harden against the specific failure mode Visco-Attack exposes: models that treat convincing conversational context as license to comply, especially when a rendered image appears to corroborate the scenario. The multi-turn structure is precisely the pattern that single-turn moderation misses.


The telemetry footprint of running this pipeline is also worth noting. Stage 5 targets are queried through a vLLM-compatible client (src/common/vllm_client.py, an async pool with health checks and automatic Qwen3 thinking-mode disablement), so in an authorized enterprise evaluation all traffic is observable at the gateway — anomalous multi-turn conversations carrying generated imagery are a distinct, classifiable pattern. Everything the pipeline produces lands in structured outputs/ trees keyed by strategy, category, and question ID, making post-run audits and metric derivation straightforward.


Caveats are the usual ones for research code: the license is marked NOASSERTION, so commercial use requires clarification; the star count is modest at 31; and the pipeline assumes nontrivial GPU capacity for the SD3.5 stages. The README carries an explicit warning that the adversarial prompt techniques are for research and safety purposes only, which aligns with how it should be treated — as an evaluation instrument, not an attack tool against systems you do not own or operate.


Taken together, Visco-Attack is one of the more rigorous open releases in the multimodal jailbreak space: peer-reviewed at EMNLP 2025, fully pipeline-ized, reproducible stage by stage, and honest about its own operational constraints. For authorized red teams evaluating multimodal assistants, alignment researchers benchmarking guardrails, and defenders building context-aware moderation, it provides both a standardized attack methodology and a rich corpus of adversarial examples to measure against — the kind of tool whose proper home is the safety lab.



Official project repository for Dtc7w3PQ/Visco-Attack.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/11/dissecting-visco-attack-how-image.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.