9.2 Indirect Prompt Injection, Tool Hijacking & MCP Supply-Chain Security
Key Takeaways
Distinguish direct user-message injection from indirect injection arriving through untrusted documents, tool results or external content. Neither can be solved by prompt wording alone.
Review output rendering as a separate security boundary; restrict unauthorized external requests and validate content before display.
MCP tool metadata, plugin dependencies and Agent Skills are part of the trust boundary. Review versions and provenance, including runtime changes.
Combine separate trusted instructions and structured untrusted tool results with least-privilege authorization, approved dependencies, sandboxing and output controls.
9.2 Indirect Prompt Injection, Tool Hijacking & MCP Supply-Chain Security
The December 7 blueprint explicitly includes prompt-injection defense. Agents can read third-party content and use enterprise tools, so external data must not acquire the authority of a user or administrator.
Direct vs. Indirect Prompt Injection
Direct prompt injection originates in a request directed to the assistant. Indirect prompt injection originates in external data the assistant reads while serving a user, such as a customer ticket, document, email, webpage or tool response. A perfectly legitimate user can unknowingly encounter malicious content.
Separate trusted policy from third-party tool results. In a tool-based workflow, deliver third-party text as structured, escaped data in tool_result blocks and explain its source and purpose. Keep system instructions separate; tell the assistant to report suspicious instructions as content rather than follow them. XML delimiters alone are not authorization. Screen untrusted input, but expect imperfect detection and preserve legitimate content.
Controlling Disclosure and Unauthorized Effects
A session combining sensitive data, untrusted external content and external communication or mutation deserves particular scrutiny. Restrict access to secrets and data to what the task requires, and separately enforce action and recipient permissions. Generated content is untrusted too: a web client may make unintended external requests when rendering generated content. Prevent unauthorized resource loads and navigation and validate output for disclosure before release.
| Risk surface | Defensive control |
|---|---|
| External ticket, email or document | Structured untrusted tool results, source labeling, screening, and independent authorization |
| Outbound communications or mutations | Explicit user intent, verified recipient/resource scope, pre-execution checks and approval where required |
| Generated rich text | Safe rendering, restricted external resource loading and disclosure checks |
| Third-party tool metadata | Approved server identity and permitted capabilities; review material changes |
| Shared skills and plugins | Trusted artifact registry, review scripts and instructions, restricted runtime permissions |
Third-Party MCP Servers and Skills
MCP tool descriptions and schemas help the model choose capabilities, but metadata from a server is not a source of trusted organizational instructions. Tool annotations such as a read-only hint are not a substitute for enforcement. A server's available tools or descriptions can change; an approved initial review does not automatically approve every subsequent change.
A Skill adds instructions and may include executable code or other resources. A repository skill that loads automatically is therefore part of the agent's trust boundary, just as a dependency selected at runtime is.
Apply risk-appropriate supply-chain and runtime controls:
- Provenance and pinning: Use vetted dependencies and approved artifact versions or digests; verify provenance, signatures where available, and dependency inventory. Review upgrades before promotion. Maintain a security patch process rather than indefinitely freezing a vulnerable version.
- Runtime metadata review: Track approved tool inventory, schemas and descriptions. Reject or quarantine unreviewed changes according to policy and test before enabling new capabilities. Remote servers may change even when the client version is pinned.
- Isolation: Run local servers and untrusted code with minimal filesystem, process and network access and without unnecessary host secrets. A read-only filesystem is only one layer; it does not itself prevent disclosure.
- Scoped identity and egress: Issue narrowly scoped credentials and verify permissions at the backend. Restrict authorized network destinations and minimize access to sensitive data across tools; never assume a trusted description grants permission.
- Managed distribution: Approve project MCP configurations, skills and plugins through organizational review. Do not place credentials in committed configuration. Configure supported managed restrictions, track versions and audit use.
Worked Defensive Design: An Internal Ticket Summarizer
A support team needs an assistant to summarize customer tickets, reference the relevant order, and prepare a suggested reply. It does not need to send messages, modify orders, or browse arbitrary sites. Begin by mapping each input and output boundary:
- The ticket and order records are untrusted data even when the API request is authenticated. Retrieve them with a narrowly scoped read tool, bind the lookup to the verified user and permitted record, and return only the fields needed for the summary.
- The model receives a structured tool result with source information. Keep the policy governing its task in trusted instructions. If a screening step finds suspicious third-party instructions or cannot produce a valid verdict, withhold the flagged material or send a safely reviewed summary; a refusal from the screening model is not a clear verdict.
- The draft is returned to an authorized support specialist. The application checks references and disclosure policy before displaying it. Its renderer does not authorize new external resource requests merely because text resembles a link. A separate, approved workflow can send a reply after review.
If a later feature needs external research or order changes, revisit the threat model first. Prefer distinct sessions with independently scoped environments/credentials for stronger separation between reading untrusted material and performing high-impact actions. A subagent's separate context does not imply a separate filesystem or credential boundary; for example, agents in one Managed Agents multiagent session share sandbox files and vault credentials.
Acceptance Evidence and Operational Review
Test representative legitimate tickets, missing records, permission changes, suspicious untrusted content and unexpected tool metadata using synthetic records and isolated tools. Check the actual backend and rendering outcomes: permitted records are available, prohibited actions are denied, sensitive data remains within authorized boundaries, and legitimate work is not needlessly refused. Track the version of the model, integration catalog and policy under test. Reassess whenever an integration changes, rather than relying on an old artifact review.
Before deploying, evaluate authorized and unauthorized outcomes in an isolated defensive test harness. Neither a passed screening test nor signed metadata demonstrates that every runtime action is safe.
A research assistant has no outbound communication tools, but its web UI renders generated rich text and may load unapproved external resources. Which defense addresses the separate rendering risk?
Trust all generated text if the user is authenticated
Use the widest available database permissions
Sanitize generated content, restrict external resource loading and validate disclosure before rendering
Allow all external resource loads because model tools are read-only
An approved third-party MCP server changes its tool metadata during an unreviewed upstream update. What architecture best reduces supply-chain and unauthorized-action risk?
Pin vetted dependency artifacts where possible, review runtime metadata changes, isolate the server and enforce independent backend authorization
Wrap the user's prompt in XML tags and raise the temperature parameter to 0.7
Allow npx @latest updates only during off-peak weekend hours and trust semantic versioning
Instruct Claude in the system prompt to ignore any MCP tool whose name starts with format_
A customer-service triage agent summarizes incoming emails wrapped in <untrusted_email> tags and has access to lookup_order and send_external_email tools. Why does relying solely on XML delimiters fail as a complete defense against indirect prompt injection?
XML delimiters double API token billing and trigger automatic gateway timeouts
XML delimiters strip legitimate JSON formatting from lookup_order responses
Because lookup_order runs synchronously, XML tags cannot be parsed by HTTP proxies
Delimiters help distinguish source text but do not enforce authorization; use structured untrusted tool results and independent pre-execution controls
Before approving a third-party MCP server for production use inside an enterprise VPC, which network and identity posture should the security architecture mandate?
Grant the MCP container the host VM's broad IAM instance profile so it never prompts for credentials
Run the MCP server in a non-root container with read-only root filesystem, blocked cloud metadata access, minimal scoped OAuth tokens, and a strict outbound egress allowlist
Permit outbound HTTP traffic to any port 443 destination so third-party telemetry plugins continue working
Store all enterprise tenant API keys inside the shared .mcp.json configuration file checked into the main repository
Sections you finish are checked off in the contents.