Indirect prompt injection occurs when untrusted content contains instructions that manipulate a model or agent. Defend in layers: minimize tools and permissions, separate read from write paths, require confirmation for consequences, filter and sandbox content, monitor behavior and test adversarial documents. No single prompt makes a connected agent immune.
How the attack crosses layers
attacker-controlled page or document
↓ retrieval
malicious instruction enters context
↓ model
tool call, disclosure or manipulationThe document needs no executable code—only language persuasive enough for the model to treat data as instruction. Anthropic notes that browser and computer-use agents are not immune, so architectural controls matter.
Reduce the blast radius
- Give the agent only tools and scopes needed now.
- Separate read-only and mutating tools.
- Require approval for sending, publishing, purchasing or deleting.
- Prevent content from selecting credentials or changing authorization.
- Limit network destinations and returned data.
- Keep secrets out of model-visible context.
A compromised reasoning step should encounter independent barriers before causing harm.
Treat sources according to trust
Record connector and source identity. A company policy, public web page and email attachment should not receive identical trust automatically. Use allowlists, scanning and stricter tool access for uncontrolled material.
Source-aware results also help investigations by showing which passage preceded suspicious behavior.
Test the system
Seed evaluation documents with requests to reveal secrets, ignore policy, call unrelated tools or send data externally. Vary wording and placement. Verify the model behavior and the enforcement layer’s refusal.
NIST provides a broader risk frame; the MCP security checklist turns several concerns into deployment controls.
Built for the next step
Connect data without flattening trust
SPYN3 keeps workspace, source and permission context attached to the agent-facing layer.
Run the security checklistSPYN3 is AI-ready data infrastructure for technical solopreneurs and AI builders. It connects business data into a workspace-isolated knowledge layer and exposes it through a unified REST API and hosted MCP server, with permission-scoped access and source-aware returns. SPYN3 is currently in private beta; current capabilities and product direction are documented on the product facts page.
Sources
- Anthropic: prompt injection defenses — indirect prompt-injection risk and layered defenses. Verified 13 Sep 2026
- NIST AI 600-1: Generative AI Profile — generative-AI risk-management guidance. Verified 13 Sep 2026
- MCP specification: tools — tool discovery, invocation and security considerations. Verified 13 Sep 2026
