Unit 11 of 11 · about 6 hours · measure
Adaptive attack suites and the utility-security frontier
The earlier fixtures tested individual boundaries. Assemble them into evidence about agentlab's useful behavior under an attacker who knows the defense, and use the failures to revise the same threat model.
You'll be able to
- Adapt a bounded attack set to each disclosed defense, then evaluate held-out variants without tuning on their results.
- Measure benign utility, utility under attack and executed attacker success with independent state checks.
- Compare security gains with refusals, invalid output, intervention, latency and resource cost without rewarding incapability.
Covers
Read
In this order, only the parts listed
0 of 5 done
- Adapt to the defense, arXiv:2503.00061v2Adaptive Attacks Break Defenses Against Indirect Prompt Injection Attacks on LLM Agents
Table 1; Section 4 opening before Greedy Coordinate Gradient; Section 5.2; Sections 6.2 to 6.4; Appendix B and Table 6
Read for evaluation method, not gradient optimization. The above-50% result concerns the tested InjecAgent configurations, not every defended AgentDojo result. Normal-case utility was not measured, and OS-isolation or capability policies were not tested.
- Stateful utility and attack checks, arXiv:2406.13352v3AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
Sections 3.1 to 3.4; Section 4.3 Defenses
Use one banking pair, not the full benchmark or hosted scores. Pin library 0.1.35 separately from benchmark v1.2.2.
- AgentDojo 0.1.35: score semantics and whole-run retriesAgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
TaskSuite.run_task_with_pipeline: environment initialization, three-attempt loop, utility check, clean early return and injection checkThe second returned flag means attack success, despite its name. With no injection task it is always
Trueand must not be scored as security. Whole-run retries may reuse mutated state; record them rather than treating them as independent trials. - AgentDojo 0.1.35: local adapter contractAgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
_message_to_openai;chat_completion_request;OpenAILLM.__init__andOpenAILLM.queryInspect only the role mapping, sampling, request and retry settings. The adapter emits
developermessages, omits a zero temperature and sets no output-token cap; correct or explicitly configure these contracts for the local server. A starting candidate is Qwen/Qwen3-1.7B on vLLM 0.31.0 with thinking enabled, reasoning parserqwen3and tool parserhermesand explicit server sampling. With thinking off, small Qwen3 models may answer in text and never call a tool, and even with it on, clean completions can be unreliable: a capability limit, not a resistance result. Use fakes if no local model establishes useful behavior. - Attack archetypes and invalid outputs, arXiv:2403.02691v3InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated LLM Agents
Section 2 and Table 1; Section 3.1 Experiment Settings: the Output Parsing and Evaluation Metrics paragraphs
Use direct-harm and data-stealing categories to vary existing fixtures. A supplied tool response and issued next call are not evidence of a completed external effect; skip dataset generation and full evaluation.
Focus on
- Freeze the model checkpoint, template, reasoning and tool parsers, decoding, budgets and clean tasks. First establish clean utility; a model that cannot call tools on the benign task supplies no resistance evidence. CPU scripted proposals still test the executor independently.
- Disclose each defense to the attacker, cap adaptation attempts and retain every attempted variant. Separate development payloads from held-out variants and rerun all earlier entry points, persistent-memory cases and unsafe tool chains; varying a prefix alone is not a campaign.
- Enforce caps outside the model: tool-loop iterations, total requests including retries, generated tokens, context size, tool calls and wall time. Set client retries explicitly; an iteration limit alone does not bound repeated suite attempts or server generation.
- For each condition, report clean utility, attacked utility, executed attacker success and useful completion without attacker success, with counts and denominators. Keep reachability, proposed violations, refusals, invalid output, timeouts, human interventions, latency and token use visible. Use matched repeated trials and uncertainty, not a single lucky run; compare nondominated utility-security choices with their cost and oversight burden.
Common mistakes · 3
- Reading the returned
security=Trueas a passed defense, or scoring that flag on clean runs. The attack check is positive for attacker success and the clean early return is a sentinel. - Dropping refusals, invalid outputs or timeouts from the denominator and calling the lower attack rate a win. State the denominator and report useful completion beside it.
- Calling three trials on one pair a benchmark result or treating manual adaptation as reproduction of A100 gradient attacks. The result covers these fixtures, budgets and contracts only.
Try it yourself
Closed-book, before checking anything
user_task_0 and injection_task_7, placing the payload in injection_bill_text after its whole default text. That default holds the bill's payee IBAN, so a payload that replaces it, as the suite's built-in attacks do, leaves the bill unpayable and attacked utility unreachable. Verify separate bill-payment and password-change checks and payload reachability. Compare no defense, one prompt-only baseline and an executor policy limited to the authorized bill action and arguments, including reads needed for the task; its test-only bad variant must expose the forbidden password change. Use fresh state for every condition and independent trial, synthetic data and simulated tools only. Predeclare request, token, loop, tool and deadline caps. If a tool-capable local open model is available, establish clean utility first, then run at least three matched trials per condition with fixed and bounded defense-adapted payloads; use only a loopback endpoint and record the server, parsers, reasoning mode and effective sampling. If clean utility fails or inference is unavailable, report the limit and finish the CPU enforcement comparison, not a model-resistance claim. Combine this pair with the earlier agentlab fixtures in a held-out report of utility, forbidden effects, failure categories, cost and intervention; preserve residual risks even when every tested effect is blocked.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.An attacked run returns
(True, True). What happened?AnswerThe legitimate task and the attack both succeeded. Utility alone would hide the compromise.
2.The model never calls a tool on clean or attacked inputs. Is its zero attack-success rate a defense?Answer
No. It lacks demonstrated task capability under that configuration. Report the failed clean baseline and use fake proposals to test enforcement separately.
3.Why adapt payloads separately to a delimiter baseline and an executor policy?Answer
They constrain different things. A delimiter attack targets model interpretation; a policy attack probes argument, identity, composition or enforcement gaps. Reusing one payload can miss both.
4.Can a configuration with fewer forbidden effects still be a poor operating choice?Answer
Yes. It may refuse legitimate work, need excessive review or exceed resource limits. Compare matched utility, security, cost and intervention rather than minimizing one rate.
5.Why is a four-iteration tool loop not a complete run budget?Answer
Requests can generate many tokens, retry, or be repeated by the suite, and tools can stall. Bound total requests, generation, tools and wall time independently.
You're done when
You can reproduce the separate state checks, explain every failure category and denominator, and defend an operating choice using utility, forbidden effects, cost, intervention and residual risk without claiming general security.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 23 more in the section
- AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM AgentsDebenedetti et al. (NeurIPS 2024 Datasets and Benchmarks) · required
Read Section 3 (stateful environments with utility and security checks; benign utility, utility under attack and targeted attack success are reported separately) and Section 4.3 (defenses). Then run one pair at agentdojo 0.1.35, benchmark v1.2.2: banking
user_task_0(pay a bill) withinjection_task_7(change the password), fresh state per condition, first with a scripted fake model, then with a small local model with and without an executor allowlist. The returnedsecurityflag is True when the attack succeeded. Set your own iteration, token and time caps; the library defaults are loose. Do not run all 629 cases. - Adaptive Attacks Break Defenses Against Indirect Prompt Injection Attacks on LLM AgentsZhan, Fang, Panchal and Kang · required
Read Table 1, the Section 4 opening, Section 5.2, Sections 6.2 to 6.4 and Appendix B, about 25 minutes: all eight defenses tested were bypassed by attacks adapted to each, with attack success above 50% in the paper's setting. Use it as the method for your own suite (adapt each attack to the defense under test); no sandbox or capability-policy defense was tested, and a low attack rate from malformed output is not a defense. Preprint.
- InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated LLM AgentsZhan et al. (Findings of ACL 2024) · support
Read Section 2 and Table 1, about 4 pages, for attack archetypes (direct harm versus data stealing) to vary your fixtures. Its 1,054 cases are a cross product of 17 user and 62 attacker templates, and a syntactically issued call is not a real side effect; report invalid output separately from refusal.
Also in this section
- OWASP Top 10 for Agentic Applications 2026OWASP GenAI Security Project · primary
Read page 7 (Least-Agency: agentic behavior where it is not needed adds attack surface without value) and the page 8 map, then the Description and Prevention and Mitigation Guidelines of all ten entries, ASI01 Agent Goal Hijack (pp. 9 to 11) through ASI10 Rogue Agents (pp. 36 to 38). Build attack fixtures for ASI01, ASI02 Tool Misuse and Exploitation, ASI03 Identity and Privilege Abuse, ASI05 Unexpected Code Execution, ASI06 Memory and Context Poisoning, ASI09 Human-Agent Trust Exploitation and ASI10, and map each to an asset, a trust transition and a control you can test. It is a prioritized checklist, not a threat-model method or a certification: record the residual risk. The link is the official corpus copy of version 1.0 (December 2025); the download on the OWASP site is gated.
- Threat Modeling Cheat SheetOWASP Cheat Sheet Series · required
Read Overview (the four questions: what are we working on, what can go wrong, what are we going to do about it, did we do a good enough job), System Modeling (trust boundaries, data flows, data stores, processes and external entities), Threat Identification (the STRIDE table), Response and Mitigations (mitigate, eliminate, transfer, accept) and Review and Validation ("Can the agreed upon mitigations be tested?"). About 15 minutes. STRIDE is a prompt for finding threats, not a completeness guarantee; skip the cloud and organization sections.
- NIST AI 600-1 Generative AI ProfileNational Institute of Standards and Technology · required
Read risk sections 2.4 Data Privacy, 2.7 Human-AI Configuration, 2.9 Information Security and 2.12 Value Chain and Component Integration, then these suggested actions: GV-3.2-005 (threat modeling), GV-4.3-002 (minimum incident-report fields), GV-6.1-004, GV-6.1-005 and GV-6.1-007 (third parties), MP-2.3-005 (regular adversarial testing), MS-2.7-001 (security assessment), MG-2.4-001 to MG-2.4-004 (deactivation, escalation and remediation) and MG-3.1-002 and MG-3.1-003 (value-chain tests, reassessment after adding retrieval). Keep a compact risk register with actor, control, evidence, owner and residual risk. Most other actions concern organizational process or content provenance; a filled register certifies nothing.
- The Confused Deputy (or why capabilities might have been invented)Norm Hardy (Operating Systems Review, 1988) · required
Read all three pages: a compiler with authority to write a billing file is tricked by a caller-chosen output name into overwriting it. Map it to a tool server acting with its own authority on a model-chosen argument, and name the designation that should have carried the caller's authority. It predates web tokens; RFC 8707 and the MCP pages give the token form of the same rule.
- Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt InjectionGreshake et al. (AISec 2023) · required
Read Section 3 (attack surface; Figure 3 separates planted data, the innocent user's query, retrieval, tool calls and the attacker's callback), one Section 4.2 threat, Section 4.3 (multi-stage and encoded injections) and Sections 5.2 to 5.4, about 5 pages; skip the payload appendices. The attacker never talks to the application. The 2023 product screenshots are demonstrations, not claims about current services, and there is no attack-success rate.
- Design Patterns for Securing LLM Agents against Prompt InjectionsBeurer-Kellner et al. · required
Read Section 3 (six patterns: Action-Selector, Plan-Then-Execute, LLM Map-Reduce, Dual LLM, Code-Then-Execute, Context-Minimization, pp. 4 to 9), then the Section 4 case study closest to your system (4.3 email and calendar, or 4.1 for a file tool). For each pattern, write what untrusted data can still influence: a fixed plan still carries attacker-chosen arguments, and 4.1 shows allowed commands combining into an unsafe effect. "Provable" holds only inside each pattern's constraints. Preprint, no venue.
- MINJA: Memory Injection Attacks on LLM Agents via Query-Only InteractionDong et al. (NeurIPS 2025) · required
Read Section 3 (an attacker acting as a regular user, a shared memory bank, records stored after user feedback) and Section 5.4 (embedding-level sanitization fails because malicious and benign records are entangled; with GPT-4o as detector, a targeted prompt caught almost every record on EHR-MIMIC and none on RAP or the QA agent, while a general prompt caught more but flagged 34 of 50 benign records), with Table 1 for scale. The results come from three research agents; a write rule that requires a trusted verifier lies outside its tested defenses, so test it in your own memory store.
- AI Engineering Handbook: Security and GovernanceHandbook Academy · required
Read 9.0 Prompt injection (direct versus indirect attackers, why delimiters, detector models and stronger models are not fixes, six blast-radius controls) and 9.1 Agent security and the lethal trifecta (private data, untrusted content and external communication; cut egress first; the Rule of Two extends the third leg to any state-changing action). Optional: 7.5 MCP security (tool poisoning, cross-server shadowing, pinned tool descriptions), 9.2 Guardrails, 9.5 Compliance and audit, 9.6 Red-teaming. The incident lists and vendor attack rates are cited, not reverified.
- AlgoMaster - Agent Sandboxing and SecurityAlgoMaster · support
The owned premium lesson is a short overview of agent sandboxing. Reproduce each control it names in your local workflow and attack it with stale permission, indirect injection and compromised-tool cases; check each control against the Bubblewrap reference and your own negative tests, not the lesson alone.
- OWASP Top 10 for LLM Applications 2025OWASP GenAI Security Project · support
Read five entries, about 40 minutes: LLM01 Prompt Injection (types, mitigations), LLM05 Improper Output Handling, LLM06 Excessive Agency (excessive functionality, permissions and autonomy; mitigation 7, complete mediation in downstream systems), LLM07 System Prompt Leakage (a system prompt is not a secret or a security control) and LLM08 Vector and Embedding Weaknesses (permission-aware retrieval, cross-tenant scenario 2). The agentic list stays the main checklist; LLM06 is not ASI06.
- The Lethal Trifecta for AI AgentsSimon Willison · support
A 5-minute orientation before drawing trust boundaries: private data, untrusted content and external communication in one agent let injected text exfiltrate data, and a tool combination is risky even when each tool is reputable. Breaking the trifecta does not stop destructive local actions or false summaries. It is a heuristic, not a measured rate.
- The Instruction Hierarchy: Training LLMs to Prioritize Privileged InstructionsWallace et al. · support
Read Section 3.1 and Section 4, about 3 pages. The hierarchy is trained behavior, not an enforced privilege boundary, and a local open model does not inherit it. Measure benign-task success beside attack refusal, since the paper reports over-refusals. Preprint.
- Defending Against Indirect Prompt Injection Attacks With SpotlightingHines et al. · support
Read Section 3 (delimiting, datamarking, encoding) and Section 4.2 with the result figures, about 15 minutes. Its attack corpus asks for a keyword, not a harmful tool call, and markers tell the model about provenance without enforcing anything. Use it as a cheap baseline to attack, not as a boundary. Preprint.
- RFC 8707: Resource Indicators for OAuth 2.0IETF · support
Read Section 1, Section 2 up to 2.1 (the
resourceparameter; the authorization server SHOULD restrict the token's audience) and Section 3, about 2 pages. MCP's Token Handling turns the audience check into a MUST for the server, so read both. Only needed if your system issues or accepts tokens. - AI Agents in Depth - Security SlicesBojie Li · support
Read 4.6 Execution Tools (layered defense, Proposer-Reviewer, sidecar, sandbox levels), 2.4.7 prompt injection and 5.1.9 security for coding agents. The offline
chapter2/prompt-injectioncampaign (three attacks, four defenses, deterministic judges) is a template for your own attack fixtures. - The Hitchhiker's Guide to Agentic AI - Security SlicesHaggai Roitman · support
Read v3 21.5 Agentic Security and Adversarial Red Teaming (four-layer attack surface, Table 21.4), 21.6 Agent Gateway Infrastructure, 18.4.4, 23.6 (MCP trust and resource-borne injection) and 25.8. Select only controls that apply to the bounded system and verify them independently.
- Durable Tool-Using Workflow - Security GateRoadmap-Final · support
Complete the project authority, confirmation, sandbox, audit and adversarial requirements. Prove the model cannot grant permissions and that denied or ambiguous actions remain recoverable.
- MCP Security Best PracticesModel Context Protocol · reference
Read Confused Deputy Problem, Token Passthrough, State Handle Hijacking, Local MCP Server Compromise and Scope Minimization, plus the Authorization page's "Resource Parameter Implementation" and "Token Handling". The page is about OAuth and local servers; it has no text on prompt injection or tool-description poisoning (use the handbook's 7.5 and MITRE ATLAS for those). Authorization does not apply to a stdio server, which takes credentials from its environment, so most of it is background for a local lab. Capability discovery never grants authority.
- Agentic AI: Threats and Mitigations 1.1OWASP GenAI Security Project · reference
Use the threat table on pp. 16 to 19 (17 threats, T1 Memory Poisoning to T17 Supply Chain Compromise) as a drill-down when an agentic entry is too coarse: T2 is tool misuse within authorized permissions, T10 overwhelming the human in the loop. T ids and ASI ids are different namespaces, and its proposed mitigations are not demonstrated guarantees.
- MITRE ATLAS 2026.09: Agent Techniques and MitigationsMITRE · reference
Name attack fixtures with these technique ids:
AML.T0051LLM Prompt Injection (direct, indirect, triggered),AML.T0053AI Agent Tool Invocation,AML.T0080AI Agent Context Poisoning (memory, thread),AML.T0083Credentials from AI Agent Configuration,AML.T0086Exfiltration via AI Agent Tool Invocation,AML.T0099AI Agent Tool Data Poisoning,AML.T0101Data Destruction via AI Agent Tool Invocation andAML.T0110AI Agent Tool Poisoning (definition, implementation, runtime response). A poisoned implementation needs no model cooperation at all. Read mitigationsAML.M0028toAML.M0030,AML.M0032,AML.M0033,AML.M0037andAML.M0038: authority is fixed before runtime and enforced outside the agent. The link is the pinned machine-readable release; it is a vocabulary, not evidence that a defense works. - Bubblewrap 0.11.1Containers project · reference
Read the README sections "Sandbox security", "Usage", "Sandboxing" and "Limitations", and the manual entries for
--unshare-net,--ro-bind,--clearenv,--new-session,--die-with-parentand--seccomp. It is not a ready-made policy: protection comes only from the arguments you pass,--unshare-allonly tries the user and cgroup namespaces, it shares the host kernel and it sets no resource limits. If your host forbids user namespaces, say so in your results rather than skipping the negative tests silently. - LLM Safety and GuardrailsEngineering Handbook · reference
Read the tool-use safety and defense-in-depth parts of this chapter as an omissions checklist for your architecture. It is built on the OWASP LLM list, not the agentic list. Separate content classification from authorization and side-effect safety; the content-moderation case study is optional.
- Defeating Prompt Injections by Design (CaMeL)Debenedetti et al. · depth
Read Sections 2 to 5 and 7: a privileged model plans from the trusted query, a quarantined model reads untrusted data, and capability tags with policies decide what may flow into a tool argument. It assumes a trusted user prompt and uncompromised memory, and Section 7 admits side channels. Build the small tagged-data exercise, not a CaMeL clone; its interpreter is not an OS sandbox. Preprint.