Making a browser agent ask before it acts
I built a two-layer check for an open-source browser agent, so it stops and asks before it sends, follows, or RSVPs for you.
- Built for
- Hermes Browser Extension, an open-source project I do not run
- Test
- 51 sample actions I wrote and labeled
- Right
- 47 of 51 with both layers, up from 30
- Status
- On my own branch, not sent upstream
Hermes Browser Extension is an open-source side panel that brings the Hermes Agent, made by Nous Research, into Chrome and Edge. It is someone else's project. One of its settings lets the agent click and type in your tabs, and a list of rules decides which of those actions need your approval first.
That list matched a handful of words, such as Send, Post and Delete. I wrote 51 sample actions and labeled each one. The old rules let 20 of them run without asking even though they needed approval. Ctrl+Enter sends an email in Outlook and Gmail, and it ran silently. So did Like, Follow, Unsubscribe and a calendar RSVP.
I added two layers on a branch of my own copy of the code. The first is a longer word list and a check for send shortcuts. It is careful with words that are also folder or tab names, so opening the Archive folder still runs. The second is optional and off by default. It asks a small decision model whether another person will see the action or whether it can be undone. The model gets the site, the page title and the button's label, and never what you type.
Neither layer can remove a prompt the old rules would show. If the model is slow or down, the old answer stands. On my 51 actions, the old rules got 30 right. Adding the first layer made it 39, and both layers made it 47. Nothing that needed approval slipped through. The 4 left over are extra prompts, like asking before Mark as read. This is a small test I wrote myself, and it is not a benchmark.
I have not sent it to the project yet. It is on a branch on my computer.
Picking the model
Before I picked a default for the second layer, I ran nine decision models on the same 51 actions with the same rule. The two versions of Jev tied for first, so the newer one became the default. Each model here is working alone. In the real gate it only sees what the first layer let through.
Swipe the table to see more columns.
| Model | Right | Needed a prompt but ran | Asked when it did not need to |
|---|---|---|---|
| typesafe/jev-1.14 | 50 | 0 | 1 |
| typesafe/jev-1.13 | 50 | 0 | 1 |
| liquid/d1 | 48 | 1 | 2 |
| cloudflare/clef | 48 | 2 | 1 |
| inception/mercury-decide | 46 | 0 | 5 |
| cloudflare/clef-flash | 41 | 3 | 7 |
| upstage/solar-decide | 38 | 1 | 12 |
| jaredpalmer/kev-4b | 37 | 9 | 5 |
| togethercomputer/tev1-4b-experimental | 37 | 0 | 14 |
