Repository navigation
Description
What happened (2026-11-15, Windows desktop, helper 1.4.33)
An agent on a GitHub "Confirm access" page (emailed code) ran verify-code <tabId> github.com and got:
{"ok": false, "error": "not_allowed", "reason": "not_apple_site"}
The owner has chosen Allow every site (*) for agents and wants the code reader to serve every site, not only Apple.
Why it was Apple-only
verify_code (src/agent.js:307-351, host check :327 isCodeHost) has one code source: Apple's own trusted-device prompt ("Sign in requested" > Allow > 6 digits), read by native/code-reader/ (Mac) or native/windows/code-reader.ps1. That prompt only ever shows Apple Account codes. Scope was set in #320 (D1 = A). On github.com that source would approve an Apple sign-in and type an Apple Account code into GitHub: no GitHub code, and an Apple code handed to another site. So the host check stays for that source.
Decision: widen by adding a second code source for every other site
- Apple sign-in hosts: unchanged, the Apple prompt reader.
- Every other site (on the agent allowlist, or any site when Allow every site (*) is on, with the every-site rules): the one-time codes Apple Passwords already offers for that tab, the same list the person sees in the inline code menu (
listOtpEntries,src/session/otp-list.js):totp: authenticator codes saved in Apple Passwords for the site (Mac and Windows);- codes from Messages/Mail that macOS offers (Mac only).
- The Apple prompt reader is never started on a non-Apple host.
- What PassBridge still can not serve: an emailed or SMS code on Windows, or on a Mac where Apple does not offer it. The reply then says
no_codewith a hint to use Keytray.
Security kept: off by default, per-profile switch, Allow agent sign-in required, allowlist or every-site rules (https, not local, not blocked, code saved for the tab's own site), shared verify_code rate limit (3 / 10 min), Activity row without the value, a notification per fill, the code goes only into the probed field and is never in a reply or log, Apple Passwords asks for approval when it wants to (needs_user). Trade-off accepted by the owner: with every site on, an agent holding both the password and the authenticator code can finish a sign-in with no person.
Plan
src/agent.jsverifyCode: after the tab checks, branch onisCodeHost(host).- Apple host: as today.
- Other host: allowed when on the allowlist, or
agentAllowAllwith the every-site rules (assign_in,:453-460). Then rate limit, probe the field, call new depvaultCode(tab, frame, username?), fill withfillCode; reply{ok, domain, filled:true, source:"totp"|"messages"}. - Errors:
no_code(+hintnaming Keytray),several_codes(several entries and nousername; no values),needs_user(approval refused or timed out).
src/background.js: implementvaultCodewithlistOtpEntriesfor the probed frame; keeptotprows saved for the tab's site; pick byusername, else exactly one; else a single non-totp row (Mac; its domain must match when it has one); re-read a TOTP fresh (asresolveOneTimeCode). Never logs the value.native/passbridge-agent-cli.py:verify-code <tabId> [site] [username].- Tests (
test-harness/automation/unit.test.ts): flip the:292/:294cases; new cases for every-site non-Apple host, reader never called,no_codehint,several_codes, username pick,needs_user, blocked/http/local refused, shared rate limit. - Docs:
docs/agent-protocol.mdVerification codes (drop "Allow every site (*) does not apply", add which-code-from-where), Replies table;AGENTS.md. - Check:
pnpm typecheck,pnpm test, CI green, release patch, update desktop, live proof on GitHub (list-only check first that a GitHub code exists in the vault; never print it).
Rollout state found today (checked live, not assumed)
| machine | helper | Allow every site | code reader switch | Apple prompt reader works |
|---|---|---|---|---|
| desktop | 1.4.33, paired | on (status allowAll:true) |
on | no: code-reader.json still TODO-DESCRIBE -> not_configured |
| laptop | 1.4.33 | unknown: status -> no_host (browser not connected) |
unknown | no: TODO-DESCRIBE |
| Mac | 1.4.33, paired | on (allowAll:true) |
off (unlock -> code_reader_off) |
no: Code Reader app not installed -> reader_missing |
The switch lives in each browser profile's chrome.storage.local (never synced), so it is set on each machine in its browser.
Follow-ups
- Record the real Apple prompt (Mac
--describe, Windows UI Automation ids), ship a realcode-reader.json, install the reader app on the Mac (Live demo readiness: fill, auto-unlock when locked, code reader on Mac, desktop and laptop #328).
Activity
[-]verify_code on non-Apple sites: say which tool serves the code (Keytray), document Apple-only scope[/-][+]verify_code on every site: serve Apple Passwords codes (TOTP, Messages) beyond Apple sign-in[/+]verify_code: serve Apple Passwords codes on every site (#339) (#340)
sign_in: refuse a login whose username differs from the account the p…
MehdiMamas commentedon Nov 16, 2026
Status 2026-11-15
username_mismatchwith the saved usernames, and nothing is filled. An editable username field does not block the fill.no_host: the relay only connects while "Allow agents to sign in" or the code reader is on. Neither key exists in the laptop Chrome profile's storage, so both switches are off there. Helper 1.4.33 and the native-host registration are correct. Fix: turn on Options > Agents > Allow agents to sign in (and Allow every site) in the laptop's PassBridge.code-reader.json(Windows) andprompt.json(Mac) still holdTODO-DESCRIBE, so it reads nothing anywhere. A real "Sign in requested" prompt has to be recorded once on screen: on the Mac with the app's--describemode; Windows has no describe mode yet, so the iCloud process names and the Allow/Done AutomationIds have to be read with a UI Automation dump while the prompt is open.native/code-reader/build.shand the Developer ID identity; an ad-hoc build loses its grant on every rebuild. (3) Grant Accessibility in System Settings. (4) Record the prompt as described above.