devpit

Letting an agent drive a page

Off by default, said out loud while it happens, and blind to password fields.

A browser pane can be handed to an agent, so it can type into the page, click through it and read what is on it. It is off for every pane until you turn it on, what it does is said in the pane as it happens, and it never sees what is in a password field.

One thing to know first: the pane's half of this is built — the switch, the acts, the page read and the protections below — but the bridge from an agent CLI to the pane is not, so no agent reaches a page yet. What follows is what the switch governs.

Turning it on

Browser menu → Let an agent drive this page, per pane. A new pane starts off.

State What the menu says
On "On. What it does is said in the pane as it happens."
Off "Off. An agent asking about this page is refused, and hears why."

What an agent can do

Act What it is
Read The page as structure: the role, name and position of each element on screen that can be acted on. Not a screenshot — the window has no way to take one, and structure is steadier and cheaper anyway.
Type Puts text into the element a selector names.
Click Clicks the element a selector names.
Scroll Scrolls the page by a number of screens.

Every value an agent supplies crosses into the page as data, never pasted into script. A selector concatenated into source would be an agent writing JavaScript inside a session you are signed into — which is what a pane with a brought-over login is.

Said in the pane

Each act is drawn in the pane as it arrives, not once the page has already changed: The agent typed into #email, The agent clicked button.submit, The agent scrolled 1 screens.

Password and secret fields

A field's value is never read when the field holds a secret. A field counts as one when it is type=password, or when its autocomplete, name or id mentions pass, secret, token, otp, cvc, cvv, card-number or creditcard — type=password alone misses a one-time code, a CVC and every site that rolls its own.

Such a field reports that it is a secret, and whether it is filled. An agent needs to know there is a password box and whether something is in it. It never needs to know what.

Being refused

An agent asking about a pane nobody gave it is told no rather than told nothing, so the refusal reaches its transcript:

nobody gave an agent the <pane> pane to drive

Switching the pane off takes it back at once.