Skip to content

Defensive security education

AI Agent Security Range

A reference site and gated self-test range for web-access and MCP-tool agent exploits. Every test attacks only your own agent, using benign canaries — a success is a harmless signal, never real data extraction or a real side-effecting action.

Threat model

Who the attacker is, what they control, and what they're after when an AI agent has web access.

The attacker

Anyone who can place content where the agent will read it — a web page, a search result, a document, an email, or a tool response. They need no access to the user, the model, or the system prompt. Their only requirement is that their content enters the agent's context.

What they control

The content — not your prompt and not the system prompt. Their lever is that the agent cannot reliably tell "data to analyze" from "instructions to follow," so wording in fetched content can borrow the authority of a real instruction.

What they're after

To make the agent act against the user: emit attacker-chosen text, leak data the agent can see, follow attacker-chosen navigation, or invoke the agent's real tools and privileges. Exfiltration and unwanted actions are the end goals.

The trust boundary

User and developer are trusted; everything fetched or returned is untrusted. Every exploit here is the same boundary violation — untrusted content gaining instruction authority. The more the agent can do (tools, memory, credentials), the larger the blast radius.

Root cause: prompt injection

Every exploit on this page shares one root cause: language models process instructions and data through the same channel — natural language — with no hard separation. A retrieved page's text lands in the same context window as your request, and the model has no built-in notion that one is authoritative and the other is inert.

So "prompt injection" isn't a single bug to patch; it is a property of how these systems read. Each card in the Top 10 is a variation on one move: smuggling instruction-authority into content the agent is only supposed to analyze.

Honesty note: Because the payload is just language, you cannot fully "sanitize away" injection. The defenses below reduce the odds and contain the blast radius — they do not make a model immune. Prompt injection remains an open problem.

Top 10 web-access exploits

The ten web-access exploit classes covered by this range. Each card gives the mechanism, detection signals, and mitigations from the defender's perspective. Example payloads are defanged and illustrative — they show the shape of an attack, never a working chain. Expand "Technical detail" on any card for the full breakdown.

Exploit 01

Indirect prompt injection

High

What it is: The simplest form of indirect injection — malicious instructions sitting in the visible body text of a page the agent reads, hoping the agent treats page content as commands.

Exploit 02

Data exfiltration via agent actions

Critical

What it is: The agent is manipulated into using its own legitimate actions — fetching URLs, sending messages, calling tools — to move sensitive data out of its trust boundary to an attacker-controlled destination. This is the high-impact end-goal that many other injections drive toward.

Exploit 03

Hidden / invisible text

High

What it is: A real injection concealed from human view — white-on-white text, zero-size fonts, HTML comments, off-screen elements, or alt/ARIA attributes — but still present in the content the agent ingests.

Exploit 04

Tool / function-call hijacking

Critical

What it is: Page content that steers which tool the agent invokes and with what arguments.

Exploit 05

Markdown image exfiltration

Critical

What it is: Instructing the agent to render a Markdown image whose URL encodes data, causing automatic exfiltration when the client fetches the image.

Exploit 06

Confused deputy / over-broad permissions

Critical

What it is: A plausible-looking request that exploits the agent's legitimate privileges to act against the user's interest — the agent becomes a "confused deputy" wielding real access.

Exploit 07

Delayed / multi-step injections

Critical

What it is: A payload split across steps — an instruction planted early (page 1) that activates later (page 2), evading single-page inspection.

Exploit 08

Role / system-prompt spoofing

High

What it is: Page text disguised as a system or developer message, exploiting the authority a model assigns to those roles.

Exploit 09

Redirect & link-trap chains

Medium

What it is: A labeled link or chained navigation that bounces the agent through hops toward attacker content, obscuring the true destination — including simple "click this link to continue" traps.

Exploit 10

Untrusted structured data as instructions

Medium

What it is: A JSON/structured block whose fields carry instructions, exploiting the tendency to trust structured data as clean input.

MCP-tool exploits

Web-access exploits are about untrusted content entering the context. MCP exploits are about untrusted tools and tool output entering the agent's action loop — the agent isn't just reading attacker text, it's calling attacker-influenced tools and acting on what they return. Blast radius is larger because MCP tools often hold real credentials and do things.

Taxonomy re-verified July 2026 against the OWASP MCP Security Cheat Sheet and the OWASP MCP Top 10 (beta). These eight are the behavioral, client-side classes; infrastructure risks (secret exposure, supply chain, command injection, auth, telemetry) are real but out of scope for a benign-canary behavioral range.

MCP exploit 01

Tool poisoning (malicious tool descriptions)

Critical

What it is: Instructions embedded in a tool's metadata — its name, description, or parameter docs — which MCP clients place directly into the agent's context as if trusted.

MCP exploit 02

Tool-response injection

High

What it is: The output a tool returns carries instructions disguised as data, which flow back into context — indirect prompt injection via tool results.

MCP exploit 03

Rug pull (description mutation)

High

What it is: A tool presents a benign description at approval time, then silently changes it later — the user approved something different from what now runs.

MCP exploit 04

Tool shadowing / name collision

High

What it is: A malicious server registers a tool with the same or a confusingly similar name to a trusted tool, intercepting calls meant for the legitimate one.

MCP exploit 05

Cross-server data exfiltration

Critical

What it is: With multiple servers connected, one server manipulates the agent into taking data obtained from a different, trusted server and sending it to the malicious one.

MCP exploit 06

Confused deputy with real credentials

Critical

What it is: A hijacked tool call wields the agent's genuine OAuth tokens / API keys — the same confused-deputy class as web Level 9, but with real privilege and larger blast radius.

MCP exploit 07

Parameter / argument injection

High

What it is: Manipulating what arguments the agent passes to an otherwise-legitimate tool.

MCP exploit 08

Excessive / over-broad permissions

High

What it is: A tool is granted more access than the task needs, and loosely-defined permissions expand over time — amplifying the impact of every other exploit here.

Defense in depth

No single control stops prompt injection, so defenses stack across five layers — from the system prompt down to the architecture. Each layer catches what the layer above it missed; the same five layers organize the fix recommendations in the self-test range.

Layer 1 · System prompt & provenance

Establish the trust boundary

  • Treat all fetched content as untrusted data that can never issue commands.
  • Provenance-tag retrieved content and wrap it in labeled boundaries so the model knows what is data vs. instruction.

Layer 2 · Content processing

Clean input before the model sees it

  • Strip non-visible content (comments, hidden/off-screen nodes, alt/ARIA); prefer rendered text over raw DOM.
  • Neutralize role-marker patterns (SYSTEM:, fake tags) in fetched text.
  • Validate structured responses against an expected schema; use only the fields you expect.

Layer 3 · Tool & permission

Constrain what the agent can do

  • Least-privilege tool scoping — grant the narrowest capability the task needs.
  • Human-in-the-loop for sensitive or irreversible actions.
  • Domain allow-listing for outbound fetches and navigation.
  • Tool-call logging and monitoring.

Layer 4 · Output

Control what leaves the agent

  • Output & URL sanitization.
  • Disable auto-render of untrusted images and links.
  • Filter outbound requests to non-allow-listed hosts (closes the image-exfil channel).

Layer 5 · Architecture

Isolate untrusted flows

  • Content isolation / dual-LLM / quarantine patterns.
  • Keep untrusted content off the tool-selection and instruction paths — the strongest defense against confused-deputy and multi-step attacks.

Reality check

Reduces, not eliminates

Stacking these layers meaningfully lowers risk and shrinks blast radius, but none of them — alone or together — makes an agent provably immune. Design as if some injection will get through, and limit what it can reach.

Resources

Primary references for going deeper. Links open in a new tab.