Indirect prompt injection targets browser agents
Indirect prompt injection hides commands inside content a browser agent retrieves. See why filters miss them and how to narrow the browser boundary.

Indirect prompt injection hides instructions in content an agent reads. Pages, emails, documents, and tool results can all carry them. The user never typed those instructions. The agent may follow them anyway.
Filters catch some attempts. None separates instructions from data reliably. So plan for the miss. Shrink a fooled agent's privileges, tools, exits, and session lifetime.
How hidden instructions reach a browser agent
Picture a browser agent summarizing a vendor's product update. The visible article is ordinary. Text buried in the page addresses automated readers. It tells them to drop the summary. It says to open another tab and copy session data. The person who assigned the task never sees it.
The agent does see the hidden text. The text arrives beside the article. The model must decide: content or command? Now give that agent email access and an outbound tool. One malicious page can turn reading into unauthorized action. The attacker never touched the prompt box.
People and browser agents experience a page differently. The person notices the headline, the chart, and the button. The agent may receive extracted text or the rendered DOM. It may get an accessibility tree, images, or tool output. Minor visual text can stand out in the model's context.
The risk begins with the agent's job. A useful browser agent must read untrusted material. It must also decide what to do next. Summaries, links, downloads, and drafts all need both steps. That capability makes the workflow useful. It also creates the control surface.
Hidden instructions do not always use invisible CSS. The instruction might sit in an HTML comment. Faint, low-contrast text works too. Long comment threads and collapsed panels also work. So do document metadata, image text, and quoted emails. It only needs to reach a representation the agent processes. Once there, it competes with the actual task.
The attacker also gets more chances than the user. The user writes one request. The agent may visit several pages and read attachments. It may inspect search results and pass outputs between tools. Every retrieved artifact is another place for instructions to hide.
Content an agent acts on belongs to its control plane. Treat every page as input from an unknown operator.
Direct vs indirect prompt injection
Direct prompt injection comes through input sent to the model. A user asks the system to ignore its rules. Or the user seeks restricted data or off-task actions. The application can identify the sender and the input field. It also knows when the instruction entered.
Indirect prompt injection arrives inside retrieved content. The user asks for a legitimate task. Summarize this page, or review this email. The malicious instruction already sits in that page or message. The agent fetches it as part of the approved task.
Indirect injection expands the attack surface. Direct injection needs access to the agent's user channel. Indirect injection can wait anywhere the agent might read. A public page can target unknown future agents. A poisoned document can wait until a workflow opens it.
Greshake and colleagues described the attack in 2023. Their paper showed prompts planted in data an application retrieves. NIST's 2025 attack taxonomy gives it a separate entry. NIST notes that a third party mounts it. Often the model's own user is the one harmed.
OWASP's Top 10 for LLM applications lists prompt injection first. Its entry, LLM01:2025, covers the indirect form. The input comes from outside sources, like websites or files. OWASP calls fool-proof prevention an open question.
Current models enforce no boundary between instructions and data. That is the UK NCSC's December 2025 assessment. It warns prompt injection may never be totally mitigated. The realistic goal is lower likelihood and lower impact. No classifier gets the final word on every page.
Direct injection reads as a user-input problem. Indirect injection is a web-trust problem. Your application never chose the instruction. Its agent still fetched it, interpreted it, and acted. The broader prompt injection guide covers chat tools and copilots.
Anatomy of a browser-agent hijack
A browser-agent hijack does not require a dramatic exploit. It needs untrusted content, useful permissions, and an action path. The following chain stays at the mechanism level. It omits payload language and operational details.
- The agent receives a normal task. It might compare prices or summarize a support thread.
- The browser retrieves malicious content. A page or document addresses an automated reader. It frames an unrelated instruction as part of the task.
- The model accepts the new objective. It treats the embedded instruction as authoritative. Its plan changes without the user's approval.
- An allowed tool supplies reach. The agent uses a signed-in tab or file access. Clipboard access and other workflow tools also work.
- An outbound action carries the result. The agent places data in a request, form, or message. Any channel the environment permits will do.
The malicious page did not break the browser sandbox. It redirected the agent inside the permissions it already had. That distinction matters. Traditional browser defenses focus on code crossing a technical boundary. Prompt injection focuses on the model misusing an approved path.
The impact depends on what surrounds the session. An agent in a daily profile may inherit live cookies. It may also inherit saved logins, history, and extensions. Internal applications may be one click away. Redirect the plan, and those conveniences become reachable assets.
Exfiltration is only one outcome. A hijacked agent could submit forms or edit records. It could also send messages or download files. Disposal cannot reverse an action that reached an external system. Remove unnecessary authority before a page can steer it.
Why model-level defenses are not enough
Model instructions still matter. Tell the agent to treat retrieved content as untrusted. Delimit external text. Require confirmation before sensitive actions. Scan inputs for instruction-like language. These controls reduce easy failures. They also make the policy explicit.
Model-level controls do not create a hard boundary. The model weighs the task and the page together. A legitimate page can contain imperative language. A malicious page can phrase its objective as ordinary data. A classifier must infer intent from context. The attack lives in that ambiguity.
Placement creates another gap. A filter that runs before navigation misses client-rendered content. A text-only guard cannot read instructions in an image. A page-text guard may miss later tool output. Each control sees only the representation it receives. The agent may process others next.
Even a correctly detected injection leaves an execution question. What happens if the model follows it anyway? What can the browser read? Which destinations can it contact? Which state survives? Model behavior can lower the chance of compromise. It cannot define the blast radius after compromise.
Alignment and filtering are necessary but insufficient. They operate at the decision layer. The durable boundary belongs beneath that layer. Files, credentials, network reach, and tool permissions get enforced there. So does session lifetime, whatever the model decides.
NIST's taxonomy reaches the same conclusion. Current mitigations do not offer full protection, it says. It suggests assuming injection is possible with untrusted input.
Containment: the execution-layer answer
Containment starts from a harder assumption. One page will eventually fool the agent. The design should hold up when that happens. The question stops being whether detection worked. It becomes what a hijacked session can touch.
Use a fresh browser for the task. Carry in no daily-profile cookies. Mount no local files by default. Add only the credentials the task requires. Restrict tools to the smallest useful set. Limit outbound destinations where the workflow allows it. Destroy the environment when the job ends.
OWASP's mitigations point the same way. They include least privilege and human approval for risky actions. They also include adversarial testing.
Containment does not make prompt injection disappear. It makes a successful injection less valuable. The attacker reaches a short-lived browser, not a workstation. The session holds less history and fewer systems to call. Less state survives the close.
| Defense layer | What it stops | What slips through |
|---|---|---|
| Content filtering | Known or obvious instruction patterns | Novel wording and ambiguous page content |
| Model rules | Clear conflicts with the assigned task | Instructions that resemble legitimate context |
| Tool permissions | Calls outside the approved capability set | Misuse of a tool the task genuinely needs |
| Network policy | Requests to blocked destinations | Abuse of an allowed destination |
| Human approval | Silent execution of selected high-risk actions | Rushed approval and unclear consequences |
| Disposable browser | Host access, carried-in state, and post-session persistence | Data or authority deliberately placed inside the session |
Defense layers answer different failure modes. Filtering lowers exposure. Permissions narrow available actions. Network policy limits exits. Human approval adds friction at chosen boundaries. A disposable browser keeps the agent off the durable endpoint. It also removes session residue after close.
Tool protocols such as MCP need their own permission controls. The guide to MCP server security risks covers that layer. This guide stays on the browser execution boundary.
Isolation has limits worth stating plainly. It cannot recover data already sent. It cannot undo a submitted form. It cannot protect a credential you hand the session. An allowed action can still expose it. Containment works when isolation, least privilege, and egress control combine.
Are AI browsers safe yet?
Not yet, for sensitive accounts. That is where current research and Anthropic's own guidance land. AI browsers put an agent where your sessions live. That often means email, banking, and work accounts.
UW researchers tested 7 agentic browsers in early 2026. UW's summary says 4 weakened the same-origin policy. That rule keeps one site from reading another site's data. The paper shows a full attack on ChatGPT Atlas. A malicious page used injection to steal cross-origin data.
The UW researchers drew a blunt conclusion. Same-origin protection becomes only as strong as injection defenses. Browsers with fewer agent permissions generally fared better. Vendors may have changed their products since.
Anthropic's guidance for Claude in Chrome is similarly cautious. It says the risk of attack is not zero. It recommends a profile without banking, health, or government accounts. It advises against using the agent on sensitive sites.
The UW findings and Anthropic's guidance suggest a few habits.
- Use a separate profile. Leave banking, health, and government accounts out.
- Approve actions by hand. Start on sites you already trust.
- Stop odd behavior fast. End the task if the agent acts unexpectedly.
- Treat every page as untrusted. Assume page text can try to steer the agent.
Running agents with a smaller blast radius
Start by separating the agent from your normal browser profile. Agents connect to Legba from their existing tools. The agent skill provides routing and isolated browser sessions. Your daily browser does not become the execution environment.
Computer-use agents need explicit limits beyond the browser. Isolation covers the browser session. Filesystem tools, credentials, and other connections need separate controls. Untrusted page text can still influence the agent.
Policy must follow the environment. Decide which credentials enter each session. Separate read tasks from write tasks. Require approval for messages, purchases, uploads, and record changes. Record tool activity outside the agent's control. End the session when its declared job ends.
- Spawn a fresh browser. Do not inherit a daily browser profile.
- Scope the task. Give the agent one job and the tools it needs.
- Keep authority separate. Put reading and state-changing actions on different approval paths.
- Control the exits. Allow only the destinations required by the workflow.
- Close the browser session. Verify what storage and logs remain.
Separate sessions also limit risk from unsanctioned agent use. The shadow AI guide covers unapproved AI tools at work. Browser agents add autonomous action to the same governance problem.
The web will keep mixing instructions with information. A browser agent cannot avoid untrusted content and still browse. You will not classify every malicious sentence correctly.
Build for the miss. Cut durable state, ambient authority, and exits. Then make the browser disposable.
Limits of this guide
We explain mechanisms here, not test results. The guide includes no attack payloads. We read the OWASP, NIST, and NCSC guidance directly. We also read the UW paper and Anthropic's safety page. Sources were checked on October 30, 2026.
FAQs.
Why is it called indirect prompt injection?
Does indirect injection require a jailbreak?
Can prompt injection be fully prevented?
Does browser isolation stop prompt injection?
Do only AI agents face indirect injection?
What should a browser agent never reach?
Continue the deep dive
Related reading on agent isolation, shadow AI, and disposable browser execution.
How to run OpenClaw safely without giving an AI agent your laptop
OpenClaw permissions define its real blast radius. Review tools, files, credentials, browser data, network access, logs, and retention.
What is shadow AI? Why the browser tab matters
Shadow AI is unauthorized workplace use of AI tools. See the risks, governance gaps, and where browser isolation changes one boundary.
How Legba browser isolation works
Shield runs the page in an isolated browser. That browser is off your device. See what happens when you open the tab. See what ends when you close it.
Free for 30 days. No card required.
Try it on the next page you do not trust
Legba is a Chrome extension with two modes. Ghost gives you a private browser route. Shield opens a page in an isolated browser off your device.