Skip to main content

Module browser_site_permissions

Module browser_site_permissions 

Source
Expand description

The person’s “always on this site” for a page’s camera, microphone, location or notifications in a pane an agent drives (docs/reports/REPORT_AGENTS_AND_OS_PROMPTS_2026_11_07.md §4.5, medium level).

A row names one agent, one site and the kinds it may use there. It is a setting: it lives in a file in the config folder, survives restarts, is listed in Settings and revoked there. It is not an Auto-approve grant (browser_standing): those lift the wait for committing clicks, and a camera must not bring that along, so these rows are a list of their own.

Only the person writes rows: from the Settings window (app_api/browser_grants.rs checks that), or by answering “Always” on an agent’s account prompt (add_kind). With a row, browser_permission allows the page’s request at once, with no countdown, and writes one Audit row flagged standing for the first use in a pane.

Structs§

Row 🔒
Store 🔒
The rows, and where they are kept (None: nowhere, for tests).

Constants§

ACCOUNTS 🔒
The kind of “may make an account here”.
FILE_NAME 🔒
The file the rows are kept in, in the config folder.
KINDS 🔒
What a row can carry: what a page may use (the words browser_permission names them in), and accounts, which is not the page’s: the agent may make an account on the site with a password the Vault makes (browser_account), the person’s “Always for this agent on this site”.
MAX_ROWS 🔒
Most rows kept: a list this long is a mistake, not a use.

Functions§

add_kind 🔒
The person’s “Always” on an agent’s account prompt: kind is added to the row for agent on site (made if there is none), keeping what the row already carries. The person answered in the Vault’s own prompt, a window no agent’s click reaches, so this is their write as much as one from Settings.
allowed 🔒
Whether the person has allowed agent all of kinds on site for good.
covering 🔒
The row that lets agent use all of kinds on site, if one does.
first_use 🔒
Whether this is the first use of the permission in target since AgentMux started, which is the one that earns an Audit row: a page asking again adds none. Kept small: it forgets all when it fills.
list 🔒
may_make_accounts 🔒
Whether the person has let agent make accounts on site (the origin the host found the sign-up form on).
parse_kinds 🔒
kinds checked: at least one, each a known kind, listed once in the fixed order.
parse_site 🔒
The one site, in normal form. A wildcard is refused: a row names one site.
revoke 🔒
Remove row id. Returns whether it was there; an error when the file could not be written, in which case the row stays (it would be back after a restart anyway). The next request from the page asks again.
store 🔒
upsert 🔒
Add a row, or change the kinds of the one for this agent and site. The caller has checked that the person is the one asking.
upsert_in 🔒
Add the row for agent on site, or replace its kinds.