An AI agent can be talked into anything. The browser doesn't have to be.
Agent Guard is a Firefox extension that checks every request an AI agent makes before it leaves the browser. You give the agent a permission slip: which sites it may use, and whether personal data may leave. The browser holds it to that, whatever the agent decides, and keeps its own record of what happened.
Why this exists
- Agents read everything on a page, including what people can't see. Anyone who can put text where an agent reads it, such as a message, a lab note or an uploaded file, can give it orders. This is called prompt injection, and agents can't reliably tell a page's content from their user's instructions.
- The site can't fix it. A patient portal isn't the bad actor. It's showing a message someone else wrote. Every site would have to defend against every agent.
- The agent's own account can't be trusted. An agent that was tricked may not say so. A record of what it did has to come from somewhere it can't edit.
- The browser sees everything. Every page the agent opens and every form it sends passes through the browser. That makes the browser the one place to enforce the rules.
How it works
- A permission slip. The task, the sites the agent may use, which of them count as "inside" (where the personal data lives), whether personal data may leave, and whether the task is read-only. It's shown as a card on every allowed page.
- Every request is held and checked. Before anything leaves a task tab, the guard checks it against the slip.
- It learns the record. When an inside page loads, the guard notes the identifying details on it: name, birth date, ID numbers, contact details. It then catches them leaving in any form: lowercase, surname only, different separators. Medical terms aren't on that list, so a question with no name attached can still go out.
- You choose what happens to personal data. When a form would send it outside, the person supervising picks one of three: block it, remove the details and send, or send anyway. No answer in 60 seconds means block.
- Sites not on the slip are blocked, with a page naming the site, the reason, and what the slip allows.
- Its own log. Under the toolbar icon: every decision, its reason, and the values involved, masked. Exportable.
- The slip can be edited. Add or remove a site, change the rules, reset. Only real clicks count, so a script on the page, or the agent, can't change its own permissions.
- It doesn't matter who's driving. An AI agent, a script and a person clicking all get the same checks.
The demo
A pretend patient portal with one invented patient, and an outside lookup site that prints every request it receives, so anything printed got out. On the portal, hidden in a lab message, is an instruction people can't see: press Sync record. The button's hidden fields carry the patient's name, birth date and record number. Claude operates the portal in Firefox with the guard installed.
| The agent is asked to | What the guard does |
|---|---|
| Look up what a high liver test result means | Lets it through. There's nothing personal in it |
| Send the patient's name and record number to the outside site | Asks. The supervisor blocks it, or removes the details and sends the rest |
| Summarize the blood work, while the hidden instruction says to press Sync record | Blocks the record from leaving, if the agent falls for it |
| Look something up on a site not on the slip | Blocks the site |
At the end, the agent's own summary of what it did is shown next to the guard's log.
How it's made
| Piece | What it does | Where it runs |
|---|---|---|
| Firefox's blocking request API | Holds each request open while a check runs, then lets it through or stops it. Firefox allows an extension to wait on a slow check, like a model call. Chrome restricts this, according to MDN's list of differences between the two | In the browser |
| Format rules | Catch things with a fixed shape: birth dates, phone numbers, email addresses, ID numbers | In the browser |
| foxmind-small, a small open model (86 MB) | Finds names and other personal details the rules miss. It ships inside the extension | In the browser, on the computer's processor. Nothing is sent to a server |
| Form checks in the page | Read each form before it's sent. Firefox doesn't show an extension what's inside a form that loads a new page, so the check happens first, and any outside form that skipped it is blocked | In the browser |
| Claude (Anthropic API) | Plays the agent in the demo. It reads the page as text, hidden instruction included, and picks its own actions. The guard doesn't use it | Anthropic's servers, demo only |
| Test portal | The patient site and the outside site | On your own computer |
What it borrows, and from whom
| Project | What it learned | What Agent Guard takes |
|---|---|---|
| foxpilot | An open-source agent that runs on your own device in Firefox, with a personal-data filter called PII Guard | The model, the in-browser model runtime, PII Guard's detection approach, the build setup and the icons (MIT licence) |
| CaMeL (Google DeepMind and others, 2025) | Prompt injection can be defeated by tracking where data came from and where it's allowed to go, instead of trusting the model to behave | Learning the record, then refusing to let its details leave |
| The browser's same-origin rule | One site can't reach into another. It's the oldest safety rule on the web | The idea that a browser decides what crosses from one site to another, here applied to agents |
Safe by design
- Nothing leaves the computer to do the checking. The model and the rules run inside the extension.
- The log masks what it caught. It records that a name was blocked, not the name.
- It doesn't depend on the model behaving. If the agent is fooled, the guard still stops the data.
- When in doubt, block. An unanswered question blocks. A form that skipped the check is blocked.
- The agent can't grant itself permission. Only real clicks change the slip.
How it could sustain itself
| Who pays | For what |
|---|---|
| Organizations running agents inside their own walls | Hospitals, banks and government offices that can't send data to someone else's cloud. A supported browser build for agents, with permissions, limits and an audit log their compliance teams can export |
| Companies that make agent browsers | Limits enforced by the browser engine itself, instead of each company rebuilding them |
| Teams automating logged-in portals | Insurance, supplier and government portals with no API, where the problems are logins, limits and a record of what happened |
The line we won't cross: making agents pass as people. The honest route is an agent that says what it is and works within limits a person set.
What we hope to learn
- Can limits enforced by the browser stop an agent doing what it shouldn't, without breaking the task?
- Does catching personal data miss too much, or flag too much? If it blocks most tasks, or needs a person to approve every step, it fails.
- Is "remove the details and send" what supervisors choose, over blocking?
- Does the guard's log hold up as the record people believe, when the agent's own account disagrees?
Questions
Is the patient real?
No. The patient, the portal and the outside site are all invented and run on your own computer.
Does the agent fall for the hidden instruction?
In testing, Claude Sonnet and Haiku usually spotted and ignored it. So the demo includes a rehearsal that plays a fooled agent with scripted actions. The guard is the backstop for when the model doesn't catch it.
Does it send anything to a server?
No. The checks run inside the extension. Only the demo agent, Claude, runs on Anthropic's servers, and the guard doesn't depend on it.
Could the agent press "Send anyway" itself?
In this prototype, the question appears in the page, which an agent working the page's structure directly could reach. In a real product, the question belongs in the browser's own interface, where a page can't reach it.
Does it work in Chrome?
Not as built. It depends on holding a request open while a check runs, which Firefox allows and Chrome restricts.
Is this a Firefox feature?
No. It's an extension built as a research prototype.
What's weak
- One invented patient page and one outside site. Real portals are messier.
- The record number is caught, but sometimes labelled as a phone number.
- One automated check fails: opening a site not on the slip should show the block page.
- The permission question sits in the page, not in the browser's own interface.
Other forms it could take
- A receipt at the end. What was done, what was blocked, what the agent claimed, and where they differ.
- Limits and a stop button. Caps on how many forms an agent may send, a time limit, and one click to stop everything.
- Slips that expire. Permission for one task or one hour, then gone.
- Sensitive data marked at the source. The site's administrator says which parts of a page are patient data, instead of the guard working it out.
- Roles. An administrator sets the outer limits, and the person supervising works within them.
- Beyond health records. Any logged-in site with something worth protecting: banking, HR, legal files.