Observatory research catalog · ATO.T24040001 · High severity
LLM Jailbreak: Many-shot jailbreaking (research family)
Many-shot jailbreaking exploits long context windows (100k+ tokens) by stuffing dozens to hundreds of synthetic compliant dialogue turns ahead of a restricted request (Anthropic, 2024). As shot count increases, standard in-context learning dynamics override post-training safety refusals across text and multimodal models.
Technique dossier overview
- Category
- Prompt and context integrity
- Severity
- High
- Attack surface
- LLM / Prompt Layer · Inference API & Hosting
- Platforms
- Generative AI
- Tactics
- Defense Evasion, Privilege Escalation
- Aliases
- Long-context safety robustness, Many-shot
- Catalog entry modified
- Earliest cited research
- · Many-shot jailbreaking · Anthropic
How the mechanism works
- An adversary constructs a single oversized prompt containing a long sequence of simulated Q&A turns demonstrating compliant answers to sensitive or policy-violating topics.
- A final target query is appended at the end of the synthetic dialogue inside the extended context window.
- Because transformer attention follows the strong in-context pattern established across hundreds of preceding demonstrations, safety refusal weights weaken smoothly with context length.
Detection & telemetry signals
- Single-turn API prompts approaching maximum context length populated heavily with repetitive synthetic `User:` / `Assistant:` dialogue formatting.
- Elevated token-cost spikes coupled with sudden guardrail risk-score escalation concentrated in the final 5% of an ultra-long prompt.
- Sliding-window classifier scans flagging repeated policy-adjacent demonstrations embedded across early prompt chunks.
- Disproportionate refusal degradation observed during long-context stress benchmarks compared to short-context baselines.
Architectural defensive countermeasures
- Deploy sliding-window and full-context input classifiers (such as Constitutional Classifiers) trained specifically on long-context multi-demonstration attack patterns rather than short-prefix guards alone.
- Enforce explicit context-length budgets (`AML.M0036`) and reject unauthenticated prompts stuffed with forged multi-turn `Assistant:` role tags inside user text.
- Include long-context in-context override examples during post-training alignment (RLHF/DPO) and measure safety retention across full context lengths (e.g., 8k, 64k, 128k+).
- Pair model-layer defenses with deterministic application authorization so even compliant long-context text cannot trigger restricted tools.
Framework crosswalk (OWASP LLM Top 10 & NIST AI RMF)
- OWASP LLM Top 10 (2025)
- OWASP rationale
- Long-context demonstration stuffing executes Prompt Injection/alignment override (LLM01) while driving high per-request token consumption (LLM10).
- NIST AI RMF functions
- NIST AI RMF guidance
- Benchmark refusal robustness as a function of context window size under MEASURE, and enforce full-window classifiers, role-tag sanitization, and token budgets under MANAGE.
Mapped defensive controls
- Validate AI Model AML.M0008
Run independent pre-release and post-fine-tuning assurance suites covering safety regressions, backdoor activation, alignment drift, and privacy leakage before promotion.
- Generative AI Guardrails AML.M0020
Deploy layered input and output classifiers, constitutional/topic rails, and structural validators with measured benign over-refusal rates—never relying on classifiers as the sole authorization boundary.
- Generative AI Model Alignment AML.M0022
Harden model weights via SFT, RLHF/DPO, deliberative alignment, and instruction-hierarchy training across base and fine-tuned revisions while monitoring residual safety drift.
- AI Telemetry Logging and Monitoring AML.M0024
Emit structured, PII-redacted OpenTelemetry GenAI security traces covering auth, guardrail verdicts, token bursts, and agent tool calls without creating a toxic raw-prompt honeypot.
- Limit AI Workload Resource Consumption AML.M0036
Enforce hard ceilings on context length, reasoning/output tokens, max agent loop steps, tool call concurrency, wall-clock timeouts, and dollar spend per task.
Test with Refract
Refract is Silvauren's Apache-2.0 defensive LLM evaluation harness. Its 2x2 Detect-vs-Complete matrix crosses whether a detector flagged each probe with whether the model complied, so silent breaches are counted with Wilson 95% confidence intervals. Replace <model-id> with an OpenRouter route ID; each model page lists a ready-to-run command for its own route.
refract scan \
--target "openai_compat:<model-id>" \
--base-url https://openrouter.ai/api/v1 \
--api-key "$OPENROUTER_API_KEY" \
--battery many_shot
refract reportmany_shotmany-shot prompts that pack examples into long contexts
Export OPENROUTER_API_KEY first. Passing --api-key keeps Refract from using an unrelated OPENAI_API_KEY, which it would otherwise read first. Scans send real requests billed to your key. Add --max-probes or --budget-tokens to cap spend, and only scan endpoints you are authorized to test.
Published empirical measurements (2)
- Attack success rate · 61%
Vendor-reported single example. Model/version, denominator, complete dataset and protocol are unspecified. Not eligible for cross-technique ranking or a confidence interval.
- Model
- Undisclosed Claude frontier snapshot (Anthropic 2024 many-shot study)
- Evaluation
- Vendor blog illustrative example
- Reported
- Source and location
- Many-shot jailbreaking · Anthropic · Mitigating many-shot jailbreaking
- Evidence provenance
- Primary-source checked
- Attack success rate · 2%
Vendor-reported residual attack success, NOT a general defense success rate. Exact counts and full evaluation context are absent.
- Model
- Undisclosed Claude frontier snapshot (Anthropic 2024 many-shot study)
- Evaluation
- Vendor blog illustrative example
- Defense
- Prompt-based mitigation described by the vendor
- Reported
- Source and location
- Many-shot jailbreaking · Anthropic · Mitigating many-shot jailbreaking
- Evidence provenance
- Primary-source checked
Related technique records
Documented incidents & exercises (1)
- Many-Shot Long-Context Jailbreaking Evaluation OBS.EX0004 · Exercise · Apr 2, 2024 · Long-Context Frontier LLMs · In-Context Conditioning Scaling Study
Anthropic (2024) evaluated how expanding context windows up to hundreds of simulated dialogue demonstrations affects safety refusal stability in frontier LLMs. By filling long prompts with many synthetic question-answer turns before a final restricted query, attack compliance…
Source citation records
- Many-shot jailbreaking · Anthropic ·
- Constitutional Classifiers · Anthropic ·
Common questions
- What is LLM Jailbreak: Many-shot jailbreaking (research family) (ATO.T24040001)?
- Many-shot jailbreaking exploits long context windows (100k+ tokens) by stuffing dozens to hundreds of synthetic compliant dialogue turns ahead of a restricted request (Anthropic, 2024). As shot count increases, standard in-context learning dynamics override post-training safety refusals across text and multimodal models.
- How do you mitigate LLM Jailbreak: Many-shot jailbreaking (research family)?
- MITRE ATLAS maps 5 mitigations to ATO.T24040001: Validate AI Model, Generative AI Guardrails, Generative AI Model Alignment, AI Telemetry Logging and Monitoring, and Limit AI Workload Resource Consumption. Deploy sliding-window and full-context input classifiers (such as Constitutional Classifiers) trained specifically on long-context multi-demonstration attack patterns rather than short-prefix guards alone.
- How can I test a model for LLM Jailbreak: Many-shot jailbreaking (research family)?
- Run the Refract
many_shotpack:refract scan --target "openai_compat:<model-id>" --base-url https://openrouter.ai/api/v1 --api-key "$OPENROUTER_API_KEY" --battery many_shot, then refract report. Scans send real requests billed to your key. Add --max-probes or --budget-tokens to cap spend, and only scan endpoints you are authorized to test.