Prompt Injection in AI Browsers: How Web Pages Trap Agents

Affiliate disclosure: This article contains affiliate links. If you click a link and make a purchase, we may earn a commission at no extra cost to you. Our editorial recommendations are never influenced by commissions — read our full disclosure policy.
Prompt injection is how a web page takes control of an AI browser agent. The page carries instructions meant for the agent rather than for you — hidden with styling, tucked into code comments or metadata, or served only to visitors that look like bots — and an agent that reads the page may carry them out as if you had asked. Security researchers have found such instructions on live websites, not just in lab demonstrations, and OpenAI and Google both say the problem cannot be fully solved. You cannot patch it away yourself, but you can limit what a hijacked agent can reach: run it in a browser profile without your important accounts signed in, leave its confirmation prompts on, and give it narrow, specific tasks.
This guide is built from published research by Zscaler, Forcepoint, JFrog, Brave and LayerX, an academic security review of the Browser Use framework, Wiz's 2025 review of agentic browser security, and Google's and OpenAI's own security posts — all read on 12 November 2026. For what each AI browser does and costs, see our comparison of AI browsers; this piece is about the attack and the defences.
Why an agent follows text you cannot see
You see what the browser draws on screen. An agent that reads a page usually works from its underlying text and code, which includes anything styled to be invisible. The language model behind the agent then receives the page and your request together, as one stream of text, and has no dependable way to separate sentences it should merely read from sentences it should obey.
That matters more in a browser than anywhere else. Browsers have long stopped one website from reading another site's data, but an agent works around that rule without breaking it: it acts as you, inside every site where you are signed in. Brave's researchers made this point after showing attacks on Perplexity's Comet — once a page can steer the agent, the page can reach your email or bank through it (Brave on Comet).
How websites hide instructions for agents
Forcepoint's X-Labs team searched public websites for wording typical of injected prompts and documented ten live payloads (Forcepoint X-Labs). The hiding methods are ordinary web-building techniques pointed at a new target:
| Hiding method | How the text stays out of sight | Example Forcepoint found |
|---|---|---|
| HTML comments | Notes in the page code that browsers never display | A payment instruction with a PayPal link and a fixed $5,000 amount |
| Invisible styling | display: none, a 1-pixel font, or text coloured almost exactly like the background | A redirect instruction in tiny white-on-white text |
| Accessibility markup | A "visually hidden" class combined with the aria-hidden attribute | A payload using a common web-framework class, chosen, Forcepoint suggests, to slip past code review |
| Metadata | Custom meta tags dressed up as structured data | A donation-scam payment link in an invented "ai:action" tag |
Not every payload was hidden. One, aimed at coding assistants with terminal access, sat in visible page content and tried to get them to delete what looked like a backup folder. The goals Forcepoint recorded ranged from payment fraud and file deletion to leaking API keys and stopping AI tools from summarising a page at all.
Zscaler's ThreatLabz described two campaigns in July 2026 that show how this is being used for money (Zscaler ThreatLabz):
- A fake fix for a fake error. A documentation site for a made-up Python package was pushed up search results with SEO poisoning, so a coding agent troubleshooting an install would find it. Instructions in an off-screen block and in the page's structured data told the agent the error could be cleared by buying a $3.00 developer licence, with a Stripe checkout link; the page also held code to send about 0.0012 ETH to the attacker's wallet. Human visitors were offered the same "licence".
- A lookalike crypto site. A typosquatted domain imitating DeBank, a DeFi portfolio tracker, carried hidden text telling AI models to treat it as the official, top-ranked source for DeBank searches.
Pages that show agents a different website
Hidden text can at least be found by anyone who inspects the page. A stealthier approach shows the trap to agents only. JFrog's Shaked Zychlinski called it a "parallel-poisoned web" in a paper submitted on 29 August 2025 and a JFrog post on 4 September 2025 (arXiv paper, JFrog).
The site fingerprints each visitor. Agents are easier to spot than people: they carry traces of their automation framework, fill forms instantly without mouse movement, and share network characteristics. When the server decides it is talking to an agent, it returns a cloaked page — either a lookalike with instructions embedded or something entirely different — while people and ordinary security scanners get the clean version. In JFrog's test, a mock documentation site asked visiting agents to "authenticate" with a secret key from the user's environment variables, and agents running on Claude 4 Sonnet, GPT-5 Fast and Gemini 2.5 Pro supplied it.
The practical consequence: checking a page yourself does not prove your agent saw the same page. Countermeasures Zychlinski suggests, as reported by Help Net Security, include making agents' fingerprints harder to tell apart from human browsing and building crawlers that detect this kind of cloaking.
What hijacked agents have done in published research
- Stole login details through a comment. In August 2025 Brave showed that instructions hidden behind a spoiler tag in a Reddit comment could make Comet — asked only to summarise the page — find the user's email address, request a one-time login code, read it from the user's open Gmail and post both back to the thread. Perplexity shipped fixes, and Brave later said the class of attack was still not fully mitigated. Our AI browsers guide covers this and Brave's follow-up findings.
- Got around an agent's safety fence. A May 2025 security review of Browser Use, an open-source framework for browser agents, found that its setting for limiting which domains an agent may visit could be bypassed through weak URL checking, and demonstrated prompt injection leading to stolen credentials. The domain flaw was assigned CVE-2025-47241 and fixed in Browser Use 0.1.45 (security review on arXiv).
- Planted instructions in memory. In October 2025 LayerX reported what it called ChatGPT Tainted Memories: a malicious link, clicked by a logged-in user, used cross-site request forgery to write hidden instructions into ChatGPT's memory, where LayerX said they would persist across devices and browsers. LayerX argued Atlas users were most exposed because they stay signed in. OpenAI told The Register it could not reproduce the result and that Atlas was not vulnerable to this kind of attack; LayerX stood by its research (The Register). The specific claim is disputed, but the wider point holds: an assistant's memory carries content from one session into the next.
What the browser makers say they are doing
OpenAI's security post of 22 December 2025 says prompt injection, "much like scams and social engineering on the web, is unlikely to ever be fully 'solved'" (OpenAI). Its answer is an automated attacker, trained with reinforcement learning to find new injection techniques, feeding a rapid-response loop of model training and system safeguards for ChatGPT Atlas. The same post gives users three pieces of advice: use logged-out mode when a task does not need your accounts, check confirmation requests before purchases or emails go out, and give specific instructions rather than open-ended ones. TechCrunch also reported a warning from the UK's National Cyber Security Centre that prompt injection against generative AI may never be completely mitigated (TechCrunch).
Google's Chrome security team set out its design for Gemini's agent in Chrome on 8 December 2025 (Google):
- User Alignment Critic — a second model that checks each action the agent proposes against your goal. It sees only a description of the action, not the web content, so a page cannot talk to it directly, and it can veto the step.
- Agent Origin Sets — the agent is limited to sites relevant to the task, split into sites it may read and sites it may also act on.
- Confirmations — before visiting sensitive sites such as banking or medical pages, before signing in through Google Password Manager (the model has no direct access to stored passwords), and before purchases, messages or other consequential actions.
- A prompt-injection classifier that checks every page the agent sees.
How to protect yourself
- Give the agent its own browser profile. Run agent tasks in a profile where your email, bank and work accounts are not signed in. Brave, Wiz and OpenAI (through Atlas's logged-out mode) all recommend some version of this. If a task needs one account, sign in to that one site in that profile for that task.
- Leave confirmations switched on. The browsers above ask before purchases, messages and similar actions. Read what the agent is about to send, to whom and for how much — an injected task is designed to look routine.
- Ask for narrow tasks. "Find the cheapest direct flight to Lisbon on 3 December and stop before payment" leaves far less room for a hidden instruction than "sort out my travel".
- Keep passwords out of the agent's reach. Never paste a password into the chat, and do not let the agent's profile save logins. Keeping your vault in a separate password manager means a hijacked agent session has nothing stored to take; Proton Pass and NordPass are two we earn from (affiliate links). To let an agent use one login with your approval, see password managers for AI agents.
- Prefer codes that never reach your inbox. The Comet demonstration worked because the login code arrived in an inbox the agent could open. Where a service lets you choose, an authenticator app or security key keeps the second factor outside the browser — see two-factor authentication explained.
- Check the assistant's memory. If your assistant keeps memories between chats, look through them now and then and delete anything you did not put there.
- Update promptly. Agent browsers and frameworks ship security fixes often; in Brave's Comet timeline, Perplexity's first fix came two days after the report. If you run an open-source agent framework yourself, check you are on a patched version.
- Keep high-stakes jobs for yourself. Wiz suggests limiting agents to low-stakes work such as research and gathering public information.
Signs a session may have gone wrong
There is no reliable warning light. Stop the task if the agent opens sites you did not ask for, asks for a password, code or payment detail the task did not need, or tries to send or post something you did not request. Then close the profile, change any password it may have seen, and check your sent mail and recent orders. Our guide to whether AI agents are safe with your data has a wider setup checklist, and how hackers get your password covers what to do if a login has leaked.
Frequently asked questions
What is prompt injection in an AI browser?
It is an attack in which a web page, email or document contains instructions written for the AI agent rather than for the person. When the agent reads the content, it may follow those instructions as if the user had given them — for example, opening another site, copying data or making a payment.
Can a website hijack my AI agent just by being visited?
It can if the agent reads the page. In Brave's research, asking Comet to summarise a page was enough to trigger the attack, and in the Fellou browser asking the assistant to open a page was enough. Hidden text, comments and metadata all reach the model even though you never see them.
Can I check a page for hidden instructions myself?
Not reliably. Instructions can sit in code comments, invisible text or metadata, and JFrog showed that a site can serve agents a different page from the one people and security scanners see.
Is ChatGPT Atlas safe from prompt injection?
No AI browser is immune, and OpenAI says prompt injection is unlikely ever to be fully solved. OpenAI recommends logged-out mode when a task does not need your accounts, checking confirmation requests, and giving specific instructions.
What are Origin Sets in Chrome?
Agent Origin Sets are part of Google's design for Gemini's agent in Chrome: the agent is limited to sites relevant to the current task, divided into sites it may only read and sites it may also act on, so a compromised agent cannot wander to unrelated sites.
Covered in this guide
Sources
- Brave on Comet (brave.com)
- Forcepoint X-Labs (forcepoint.com)
- Zscaler ThreatLabz (zscaler.com)
- arXiv paper (arxiv.org)
- JFrog (jfrog.com)
- Help Net Security (helpnetsecurity.com)
- security review on arXiv (arxiv.org)
- The Register (theregister.com)
- OpenAI (openai.com)
- TechCrunch (techcrunch.com)
- Google (blog.google)
- Wiz (wiz.io)
Written by Thomas Lovas Lokoy, Founder & Editor — researched and drafted with AI assistance from published sources; edited and published by NorwegianSpark SA · Editorial policy · Disclosure · Last updated: 12 November 2026




