A practical threat model and mitigation pipeline for agentic AI systems
William Caban
Press F for full screen. S opens speaker notes. ? lists shortcuts.
Your chatbot red-teaming checklist does not cover this.
A benign-looking call to a real tool, chained toward an unintended effect.
Delegated actions accumulate access the agent was never meant to hold alone.
State carried across turns gets corrupted mid-task, not caught at the input gate.
Each step can look fine in isolation. Only the trajectory is the attack.
| Model alignment | Guardrails | |
|---|---|---|
| When it applies | Unanticipated situations needing judgment | Known failure modes: least privilege, isolation, policy |
| Scope | General, broad | Domain-specific, your own policy |
| Update cadence | Tied to model retraining | Independent, no retraining required |
| Enforceability | Best-effort, reduces risk | Auditable, deterministic, logged |
| Customization | None, baked into weights | Full, threshold tuning, domain rules |
A well-aligned model still needs engineered, auditable controls for the three threat surfaces on the last slide. Neither tool substitutes for the other.
Simon Willison named the combination the lethal trifecta (June 2025). Meta's Agents Rule of Two (October 2025) turns it into a design constraint.
Pattern from CaMeL (Google DeepMind, 2025). Untrusted text can change a plan's values, never the plan. Example policy: a value from an email cannot become the recipient of a send action.
Four questions, each answered by one part of this pipeline:
Each tool answers a different question, and all of their findings converge into one record. PyRIT: Microsoft, MIT, github.com/microsoft/PyRIT.
| Layer under test | Tool | Question it answers | Typical output |
|---|---|---|---|
| Model endpoint, guardrails included | garak | Which known attack classes get through? | Per-probe pass or fail, attack success rate |
| Application: prompts, RAG, policies | promptfoo | Does the app hold under generated attacks and assertions on every change? | Test matrix with pass or fail per case |
| Models and agents on benchmarks | inspect-ai | How does it score on safety, security, and agentic tasks, inside a sandbox? | Logs, scores, transcripts per sample |
| Agent with real tools | MiDojo | Does the real agent resist payloads in the data and tools it reads? | Utility and security scores per task pair |
| Behavior under pressure | Petri | Does the model deceive, flatter, or help a harmful user across many turns? | Judge-scored transcripts for human review |
garak: NVIDIA, Apache 2.0. promptfoo: MIT, joined OpenAI in March 2026 and stayed open source. Inspect: UK AI Security Institute, with a community catalog in inspect_evals. One tool is not a program. Each answers one question, and the record has to hold results from all of them.
Regex-based. Catches predictable data: SSNs, credit cards, account numbers. Instant redaction.
Code-based logic: JSON schema validation, token limits, output structure checks.
Small classifiers alongside the main model. Catch jailbreaks, toxic content, prompt injections.
Converts input to embeddings, measures semantic distance from unsafe topics. Keeps a domain system on-topic.
Layer more than one type. No single type catches everything on its own.
Tool checkpoint catches tool misuse · Infrastructure sandbox catches privilege escalation · Retrieval and Input catch context poisoning.
Same shape as IAM boundaries and network policy: an explicit deny higher up wins.
All four types from the last slide, placed by how easily you can audit them. LLM-as-judge is one way to run a guardian model. Programmable, rule-based policy (e.g. Colang / NeMo Guardrails) is one open-source example of the deterministic end.
The trace loop back to Finding is itself evidence that feeds future findings.
Attack success rate = share of probes that bypass the guardrail. Lower is stronger. Each stage runs only if the prior one was blocked, so the ladder shows exactly where coverage actually ends.
One classifier scores every response the same way, so strategies stay comparable. The last rung uses a challenger model that rewrites the prompt from the target's refusals. garak (atkgen, TAP-style probes) and promptfoo (iterative and tree strategies) implement this family.
OWASP, NIST, and ATLAS tell you where to start. Your policies tell you what matters in your environment.
| Kind | Examples | How to treat it |
|---|---|---|
| Direct measurement | Attack success rate, block rate, false positive rate, latency overhead | Computed from guardrail decisions and probe results. Safe to gate a release on. |
| Outcome proxy | Re-prompt rate, session completion, tool failure correlation | Advisory only. Correlation in traces is not proof of causation. |
A defense that blocks attacks by making the agent useless is not a defense. Report utility next to security.
Thresholds are set per environment with a named owner. The package author cannot be the only approver. Adapting a definition creates a new package, which needs fresh evidence.
Three questions to ask about any agent harness:
Claude Code, Codex, OpenCode, OpenClaw, and Hermes Agent differ in the details. They share this profile.
Source: Snyk and TechSpot reporting on jqwik 1.10.0, published May 25, 2026.
Credentials should never live inside the sandbox. Inject them at the network boundary so a hijacked agent has nothing to exfiltrate. The third mode is the cheapest to adopt and the weakest.
| Harness | Default posture | What enforces it | Check this |
|---|---|---|---|
| Claude Code | Permission prompts. Optional OS sandbox for Bash and its child processes. | Seatbelt on macOS, bubblewrap on Linux. File limits plus a proxy with a domain allowlist. | Is the unsandboxed retry disabled? What can MCP servers and hooks reach? |
| Codex | Sandbox mode plus approval policy: read-only, workspace-write, or danger-full-access. | Seatbelt on macOS, Landlock and seccomp on Linux. .git stays read-only. | Which mode do scripts and CI use? |
| OpenCode | allow, ask, or deny rules per tool. Most default to allow. | Policy layer. The docs describe no sandbox, so add a container or VM. | Can bash read what a deny rule blocks? |
| OpenClaw | Docker sandbox for tools. Modes: off, non-main, all. | Container per session, agent, or shared. Separate tool policy and an elevated escape hatch. | Which sessions are sandboxed? Who can use elevated? |
| Hermes Agent | Approval for dangerous commands. Container backends. | Docker, Singularity, Modal. Approvals are skipped in containers because the container is the boundary. | Which backend runs in production? Are MCP credentials filtered? |
Defaults change fast. Read each project's current documentation, then test the boundary itself, not the config file.
| Attack | Kernel only | App sandbox only | Both |
|---|---|---|---|
| Prompt-injection exfiltration | Leaked | Blocked | Blocked |
| Kernel exploit, container escape | Blocked | Host compromised | Blocked |
Source: published test of OpenCode with an open-weight model on Kubernetes, using OpenShell and Kata Containers (Red Hat Developer, July 23, 2026). One agent, one test. Treat it as a pattern, not a benchmark.
The agent does not change and does not know. You test the real harness and model, not a copy. Open-source examples: MiDojo (MCP and other agent protocols) and AgentDojo (rebuilds the environment inside the framework).
| Compromised tool to agent | Hijacked agent to tool | |
|---|---|---|
| Question | What does the harness do with hostile tool content? | What does the tool do with a hijacked caller? |
| What the proxy does | Splices payloads into descriptions, results, and tool lists. Changes a definition after approval. | Sends the calls an injected agent would make. Captures side effects instead of running them. |
| Failure looks like | The agent follows instructions found in tool output, or keeps using a changed tool without re-approval. | The server accepts the call because the caller is "the agent": wrong audience, broad scope, no per-user check. |
| The fix lives in | Harness permissions, sandbox, gateway guardrails. | The tool server: scoped tokens, per-call authorization, argument validation. |
Attack classes on the left: tool poisoning, rug pull, tool shadowing. On the right: confused deputy, token passthrough, over-broad scopes, as covered in the MCP security best practices.
Vary what the attacker controls
| Attacker knowledge | Payload enters through |
|---|---|
| Black box | The user prompt |
| Gray box | A data source the agent reads |
| White box | A tool response the attacker controls |
The output is a risk profile: for this model, harness, sandbox, and tool set, these vectors succeeded at this rate, and this control moved it.
Hash or drop content you cannot retain. Record provenance on every case: source trace, transformation, reviewer.
Run cheap suites on every change. Run expensive adaptive campaigns on a schedule. Keep the suite itself versioned, or a trend line means nothing.
This field is younger than it looks. Most of what "good" looks like is still being figured out in public.
Open this deck
williamcaban.github.io/261001-red-teaming-agents
Connect on LinkedIn
linkedin.com/in/williamcaban
Swipe or use the arrow keys on your own device. Mention Mass Open when you connect.