Expand description
credential service — the paired CEF host’s browser-pane Basic-Auth
credential broker calls this, host→srv, to resolve an identity for a
pane and to look up / save / delete / fill a stored site credential.
Fill is the only method here that ever returns a plaintext
password, and it’s called exactly once per approved use, at the
moment the host is about to hand the credential to CEF’s
AuthCallback::cont(). Lookup deliberately returns only a masked
username — the credential-approval window (agentmux-cef,
open_subwindow-based, see credential_broker there) uses Lookup
to decide what to display, and must never receive the real password
even transiently.
The sign-ins are Vault login entries kept per browser profile
(crate::backend::vault::signins, spec
SPEC_VAULT_GENERATE_CAPTURE_AND_BROWSER_SIGNINS_2026_10_28.md §5.4, §9.3).
The host still calls the pane’s key identity_id; it is now the tab’s
profile, personal or profile:<id>, and the host passes it back unread.
This module is the /agentmux/service RPC surface over them, in the same
shape as super::host_ipc (the other host→srv service module).
§Auth: host-only, NOT the shared X-AuthKey
Every method on this service requires args[1] to be this srv
instance’s AGENTMUX_HOST_REG_SECRET, the same host-only credential
host_ipc.Register proves (see that module’s doc comment and
Config::host_reg_secret).
An earlier cut of this module gated on the instance-wide X-AuthKey
alone, reasoning that — unlike host_ipc.Register’s
“session-hijack-shaped” port+token — every method here only touches data
scoped to a caller-supplied identity_id. That reasoning was wrong,
and it defeated this feature’s entire stated security goal (reagent P0
on PR #2824). X-AuthKey is deliberately re-injected into every spawned
agent’s own environment as AGENTMUX_AUTH_KEY
(server/agent_handlers/input.rs), and AGENTMUX_BLOCKID is injected
alongside it. So any agent could, with a plain curl from its own Shell
tool:
credential.ResolveIdentitywith its own knownblock_id→identity_idcredential.Fillwith thatidentity_idplus the origin/realm it already knows (it is, after all, the thing browsing that site) → the plaintext password
…with no human approval window anywhere in the path. Fill uniquely
returns a raw password, which is exactly the class of secret that needed
host_ipc.Register’s treatment, not a weaker one.
The gate is applied to the whole service rather than to Fill alone:
ResolveIdentity leaks identity_ids, Lookup confirms which sites have
saved credentials, and Save/Delete let an agent plant or destroy
them. None of those are things an agent should reach either, and a
uniform gate cannot be defeated by finding the one method someone forgot
to cover.
Note this proves caller is the host, not a human approved this exact use. That is the boundary the threat model needs — the host is the process that runs the approval window, so a capability token it mints for itself would add no defence against the attacker in question (an agent), only an internal consistency check within the host.
Structs§
- Field
Args 🔒 - Form
Args 🔒 - Offer
Args 🔒 - Protection
Space 🔒Args - Resolve
Identity 🔒Args - Save
Args 🔒 - Settled
Args 🔒 - Signup
Args 🔒
Functions§
- field_
args 🔒 - handle_
change_ 🔒sent - A password-change form a page in pane
block_idsent: the password an agent made for it becomes the saved sign-in’s, or the password is offered “Update password?”. Never logged. - handle_
credential_ 🔒service - handle_
delete 🔒 - The site turned down a sign-in just filled: the Vault keeps it, marked, and
stops offering it (see
signins::refused); nothing is deleted. - handle_
field_ 🔒close - The person pressed elsewhere on the page in pane
block_id. - handle_
field_ 🔒key - A key the list took in pane
block_id. - handle_
field_ 🔒open - The person clicked, or pressed Up or Down, in a login field in pane
block_id: the list of saved sign-ins (crate::server::browser_signin_list). The answer tells the host what the page’s listener is to be told. - handle_
fill 🔒 - The one method that returns a real, unmasked password. Called exactly once per approved credential use — see this module’s own doc comment.
- handle_
form 🔒 - A frame of pane
block_idoforiginshows a sign-in form. - handle_
lookup 🔒 - handle_
navigated 🔒 - Pane
block_id’s main frame loaded a new page: a held sign-in learns it went through, and the old page’s sign-in forms are gone. - handle_
offer 🔒 - A sign-in a page in pane
block_idsent: held for “Save to Vault?” (crate::server::browser_signin_offer), never logged. - handle_
resolve_ 🔒identity block_id→ the profile its sign-ins are kept under:personalfor a tab with nobrowser:identity,profile:<id>for a named profile’s tab.- handle_
save 🔒 - handle_
settled 🔒 - Pane
block_id’s page moved on after a sign-in. - handle_
signup 🔒 - The person focused a field for a new password in pane
block_id: its key button offers a strong password (crate::server::browser_signup). - handle_
signup_ 🔒sent - A sign-up form a page in pane
block_idsent: it confirms the password made for it, or is offered “Save to Vault?”. Never logged. - host_
caller_ 🔒allowed Some(error)when the caller failed to prove it’s the paired host — checked for EVERY method before dispatch, so a new method added later is gated by construction rather than by remembering to gate it.- lookup_
shared 🔒 - The profile holds no sign-in of its own for
space: in an agent’s own profile, the login the person shared with that agent answers (crate::server::vault_prompt_share). The answer then also saysshared, theagent, andapproval:grantedwhen the person already said yes to this use (the host answers the prompt without asking),askwhen the host asks them as it does for the profile’s own. - mask_
username 🔒 us***@example.com/ab***style masking for the approval window’s display — enough for a human to recognize which saved login is being offered, not enough to be useful if somehow logged or screenshotted wrong. Keeps at most the first 2 characters before any masking.- reject_
unless_ 🔒host_ caller