
Indirect prompt injection hides malicious instructions in external content that an AI agent reads as context. The attacker never talks to your agent; they leave a note where it will look. If the system doesn't keep data and control apart, those instructions can push the model into unauthorized actions, leaks of confidential session context, or secondary API calls nobody asked for.
Picture what the agent is doing at that moment: reading an email, a web page, a document or a customer ticket, while holding credentials and access to enterprise tools.
We treat this as an infrastructure problem first and a model problem second.
What is indirect prompt injection, and how does an attack occur?
Delivery is the whole trick. A direct attack gets typed into a chat box. With indirect prompt injection, the hostile text turns up in something the agent fetches: a document, message, website, search result or connected data source.
Most indirect prompt injection examples run in four stages:
- An attacker plants hidden or misleading instructions in external content.
- An agent pulls that content in to summarize it, analyze it or make a decision.
- The model receives trusted instructions and untrusted data in the same context.
- The agent obeys the planted instruction, which might mean calling a tool, leaking context or changing a workflow.
Notice how far the security boundary reaches past the prompt. It takes in the agent's identity, permissions, credentials and network access, plus its tools, APIs, data sources and approval steps.
Once the surrounding system lets model output trigger something consequential, a model-level failure is an infrastructure incident.

How does prompt injection become a supply chain risk?
Every feed an agent trusts is a door. Agents depend on external feeds, connectors, websites, documents, vendor APIs and ingestion pipelines, and that's where this turns into a supply chain problem. A trusted integration can still deliver hostile content if its source, account, parser or upstream system is compromised.
So manage the risk along the whole path, from where content starts to what the agent does with it:
- Verify who owns each integration and how it authenticates.
- Record provenance and restrict connector scopes.
- Review transformations, and validate data before it reaches models or tools.
- Put changes to feeds, parsers, permissions and pipeline components through review.
Continuous behavioral security auditing can then surface unusual retrievals, unexpected tool calls, strange data movement or repeated policy failures. An operational AI audit checklist helps teams tie those runtime records to ownership, review and remediation.

How can agent architecture contain prompt injection?
Start from one assumption: external text is data, never authority. Containment that works pairs structural separation with controls that still hold when the model returns a manipulated answer.
What would we put in place? Prompt isolation comes first, with system instructions, trusted application state, retrieved content and tool results kept clearly apart. Then least privilege, so each agent gets only the data and actions its task needs. Then checks on both sides of the model: sanitize suspicious input, limit accepted formats and validate generated arguments before any tool sees them.
Action boundaries matter just as much. A deterministic policy check or a human approves sensitive writes, payments, disclosures and infrastructure changes before they run. And behavioral auditing records retrievals, model decisions, tool calls, policy outcomes and odd execution patterns.
Input sanitization helps, but it won't save you alone. Attackers can tuck instructions into ordinary prose, markup, encoded text or data fields. Go for layered enterprise AI guardrails and don't lean on one filter that supposedly spots every malicious instruction in advance.
Why are dual-LLM patterns useful?
They keep the model that reads untrusted content away from the model that acts. One model reads or extracts information from external data; a second works on a constrained version of it and never receives the original content.
A quick example: the first model turns a customer ticket into validated fields such as category, urgency and requested action. The main executor gets those fields and none of the ticket's free-form instructions.
That reduces instruction contamination. It doesn't remove the risk.
Malicious content can survive inside summaries or structured fields, so you still need schemas, validation, narrowly scoped tools, policy enforcement and logging. And the model that processes the data shouldn't hold the same operational privileges as the one that executes.
How Hyperlake helps
Hyperlake provides shared controls for identity, network isolation, scoped secrets, access policy, audit and lifecycle management around agent applications and data services. Its identity-to-data pattern can use OAuth/OIDC sign-in, validated JWT identity, OPA policy decisions, and enforcement and logging at integrated access points. Those capabilities help contain an affected model by limiting what its workload can reach or execute; specific integrations and automations depend on the deployment. To discuss an agent environment and its security boundaries, talk to our team.
Frequently asked questions
Can input filtering completely prevent indirect prompt injection?
No. Filtering removes known patterns, dangerous markup or disallowed fields, but malicious instructions come in endless forms and can look like ordinary business text. Good defenses assume some hostile content will reach the model, then limit its influence with isolation, constrained formats, policy checks, least-privilege tools and monitored execution.
What permissions should an autonomous AI agent receive?
Only the minimum data and tool permissions its current task needs. Split read from write access where you can, scope credentials to the workload, and send consequential actions through deterministic authorization checks. Wherever policy wants a review before an action can have significant impact, put a human approval there.
Does retrieval-augmented generation protect against prompt injection?
Not by itself, since retrieved documents become part of the model's context. The retrieval layer should enforce access policy and provenance, and the application should keep retrieved text apart from system instructions. Outputs still need validating before they reach tools, APIs or downstream agents.
Why should external data integrations get supply chain reviews?
Integrations can change without the agent changing, and they can inherit risk from suppliers, compromised accounts, upstream sources or pipeline updates. A supply chain review looks at ownership, authentication, permissions, provenance, transformation steps and change controls. Keep runtime monitoring running anyway, because a source you approved last month can deliver malicious content tomorrow.


