passport-bridge 0.16.6 → 0.16.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +66 -44
  2. package/dist/bridgeExchange.d.ts +1 -1
  3. package/dist/bridgeExchange.js +1 -1
  4. package/dist/cli.js +6 -6
  5. package/dist/cliActions.d.ts +28 -0
  6. package/dist/cliActions.js +224 -0
  7. package/dist/cliApprovalLink.d.ts +5 -0
  8. package/dist/cliApprovalLink.js +21 -0
  9. package/dist/cliArgs.d.ts +1 -1
  10. package/dist/cliArgs.js +26 -9
  11. package/dist/cliAutopilot.d.ts +4 -39
  12. package/dist/cliAutopilot.js +9 -230
  13. package/dist/cliAutopilotPolicy.d.ts +13 -0
  14. package/dist/cliExec.d.ts +27 -0
  15. package/dist/cliExec.js +156 -41
  16. package/dist/cliGuardHealth.d.ts +3 -1
  17. package/dist/cliGuardHealth.js +6 -43
  18. package/dist/cliHelp.d.ts +11 -0
  19. package/dist/cliHelp.js +37 -0
  20. package/dist/cliHook.d.ts +2 -1
  21. package/dist/cliHook.js +52 -14
  22. package/dist/cliHookClassify.d.ts +12 -0
  23. package/dist/cliHookDeliver.d.ts +16 -0
  24. package/dist/cliHookDeliver.js +12 -2
  25. package/dist/cliHookGuard.d.ts +1 -1
  26. package/dist/cliHookGuard.js +50 -7
  27. package/dist/cliHookInstall.js +1 -1
  28. package/dist/cliHookLocal.d.ts +6 -0
  29. package/dist/cliHookLocal.js +56 -3
  30. package/dist/cliHookLocalCode.d.ts +11 -0
  31. package/dist/cliHookLocalCode.js +18 -5
  32. package/dist/cliHookScripts.d.ts +51 -0
  33. package/dist/cliHookScripts.js +247 -0
  34. package/dist/cliHookStatus.js +4 -4
  35. package/dist/cliInit.d.ts +22 -5
  36. package/dist/cliInit.js +148 -108
  37. package/dist/cliKeys.d.ts +8 -1
  38. package/dist/cliKeys.js +75 -20
  39. package/dist/cliKeysShim.d.ts +40 -0
  40. package/dist/cliKeysShim.js +110 -0
  41. package/dist/cliLogin.d.ts +2 -14
  42. package/dist/cliLogin.js +198 -214
  43. package/dist/cliLogout.d.ts +8 -0
  44. package/dist/cliLogout.js +57 -0
  45. package/dist/cliMemberCall.d.ts +22 -0
  46. package/dist/cliMemberCall.js +38 -0
  47. package/dist/cliOpaqueId.d.ts +10 -0
  48. package/dist/cliOpaqueId.js +48 -0
  49. package/dist/cliOutput.js +30 -17
  50. package/dist/cliPolicyV2.js +54 -2
  51. package/dist/cliScan.js +3 -3
  52. package/dist/cliScriptRead.d.ts +199 -0
  53. package/dist/cliScriptRead.js +512 -0
  54. package/dist/cliScriptText.d.ts +78 -0
  55. package/dist/cliScriptText.js +412 -0
  56. package/dist/cliSession.d.ts +1 -0
  57. package/dist/cliSession.js +2 -0
  58. package/dist/cliSessions.d.ts +36 -0
  59. package/dist/cliSessions.js +129 -0
  60. package/dist/cliSetup.js +3 -3
  61. package/dist/cliSetupLock.d.ts +37 -0
  62. package/dist/cliSetupLock.js +330 -0
  63. package/dist/cliSetupOrg.d.ts +4 -0
  64. package/dist/cliSetupOrg.js +58 -11
  65. package/dist/cliStatus.d.ts +73 -0
  66. package/dist/cliStatus.js +387 -0
  67. package/dist/cliStatusGuard.d.ts +0 -2
  68. package/dist/cliStatusGuard.js +1 -18
  69. package/dist/cliStatusLocal.d.ts +22 -0
  70. package/dist/cliStatusLocal.js +18 -0
  71. package/dist/cliSupport.d.ts +8 -0
  72. package/dist/cliWait.d.ts +14 -0
  73. package/dist/cliWait.js +180 -0
  74. package/dist/completion.js +23 -8
  75. package/dist/execMask.d.ts +55 -0
  76. package/dist/execMask.js +189 -0
  77. package/dist/execShims.d.ts +59 -0
  78. package/dist/execShims.js +258 -0
  79. package/dist/hookFastPath.js +0 -5
  80. package/dist/initAppsStep.d.ts +26 -5
  81. package/dist/initAppsStep.js +73 -65
  82. package/dist/initAutopilotStep.d.ts +42 -11
  83. package/dist/initAutopilotStep.js +160 -86
  84. package/dist/initInstall.d.ts +9 -2
  85. package/dist/initInstall.js +31 -4
  86. package/dist/initKeysStep.d.ts +16 -1
  87. package/dist/initKeysStep.js +66 -38
  88. package/dist/initLocalSteps.d.ts +65 -4
  89. package/dist/initLocalSteps.js +274 -170
  90. package/dist/initOutro.d.ts +10 -0
  91. package/dist/initOutro.js +147 -0
  92. package/dist/initPlan.d.ts +39 -0
  93. package/dist/initPlan.js +193 -0
  94. package/dist/initState.d.ts +32 -0
  95. package/dist/initUi.d.ts +36 -9
  96. package/dist/initUi.js +155 -96
  97. package/dist/launcherFastPath.d.ts +4 -1
  98. package/dist/launcherFastPath.js +4 -7
  99. package/dist/lockedHooks.d.ts +99 -0
  100. package/dist/lockedHooks.js +178 -0
  101. package/dist/loginFlow.d.ts +71 -0
  102. package/dist/loginFlow.js +235 -0
  103. package/dist/loginIdentity.d.ts +27 -0
  104. package/dist/loginIdentity.js +131 -0
  105. package/dist/loginPending.d.ts +23 -0
  106. package/dist/loginPending.js +89 -0
  107. package/dist/managedHooks.d.ts +10 -0
  108. package/dist/managedHooks.js +80 -0
  109. package/dist/managedSkills.js +4 -4
  110. package/dist/passport.js +13 -136
  111. package/dist/pluginPin.d.ts +1 -1
  112. package/dist/pluginPin.js +1 -1
  113. package/dist/recoveryIdentity.js +2 -2
  114. package/dist/releaseTooling.d.ts +7 -0
  115. package/dist/releaseTooling.js +29 -0
  116. package/dist/term.d.ts +104 -0
  117. package/dist/term.js +209 -0
  118. package/dist/version.d.ts +1 -1
  119. package/dist/version.js +1 -1
  120. package/dist/waitingLine.d.ts +38 -0
  121. package/dist/waitingLine.js +78 -0
  122. package/dist/webLinks.d.ts +5 -0
  123. package/dist/webLinks.js +49 -0
  124. package/npm-shrinkwrap.json +2 -2
  125. package/package.json +2 -1
package/README.md CHANGED
@@ -36,9 +36,11 @@ passport run github_search_issues '{"query":"SSO"}'
36
36
  ```
37
37
 
38
38
  - First time? Bare `passport login` opens `/cli` in your browser. Sign in with Google, GitHub, or an emailed code, then connect a workspace you belong to or create one. No workspace id needed.
39
- - Confirm that the code in the browser matches the one in your terminal. Nothing connects until you click Connect.
39
+ - One screen every time: `Code: HJKT-WQRM`, the pre-filled `Link:`, and `Check the code matches the one in your browser before you approve.` Nothing connects until you click Connect. It ends `Signed in as Erin Park to Acme.`; `--verbose` adds the profile name and where it's saved.
40
+ - Already signed in? On a terminal, `passport login` asks `Already signed in as Erin Park to Acme. Switch? [y/N]`. Enter keeps you signed in; `--switch` skips the question and lets the browser pick again. A sign-in that stopped working just signs in again.
40
41
  - Re-signing in? Bare `passport login` reuses the workspace of the active profile, the sole CLI profile, or the one workspace all saved profiles share. With several workspaces saved it lists them and asks for `--workspace`.
41
- - `--workspace ws_example` signs in to one known workspace (the device flow). Self-hosted: add `--cloud https://passport.example.com` (origin only). A server without browser sign-in keeps asking for `--workspace`.
42
+ - `--workspace ws_example` takes the same browser sign-in straight to that workspace, and only that workspace is accepted. Self-hosted: add `--cloud https://passport.example.com` (origin only). A server without browser sign-in falls back to its device flow when the workspace is known, else asks for `--workspace`.
43
+ - Without a terminal (an agent's shell, CI) or with `--json`, login is two steps, like `stripe login --non-interactive`: it prints `{status:"pending", verification_url, code, next_step, login_id}` and exits; once the code is approved in the browser, run `next_step` (`passport login --complete <login_id>`) to save the profile. The poll secret stays in an owner-only file under `~/.passport/login-pending/`.
42
44
  - `--no-open` (or `PASSPORT_NO_OPEN=1`) prints the sign-in link instead of opening a browser. Use it over SSH and in headless sessions; open the link on any device.
43
45
  - Remote servers must use HTTPS. Plain HTTP works only on `localhost`, `127.0.0.0/8`, or `::1`.
44
46
  - Requires a gateway reporting serverInfo `passport` 0.5.0 or newer with the four-tool CLI protocol; older servers fail before any tool call.
@@ -52,7 +54,7 @@ passport run github_search_issues '{"query":"SSO"}'
52
54
  | `login` | Browser sign-in or sign-up (or device sign-in with `--workspace`); saves a rotating CLI credential and makes the profile active. |
53
55
  | `logout` | Revoke the credential and always remove the local profile (warns if revocation fails). |
54
56
  | `profiles` / `use <name>` | List stored profiles / select the active one. Offline. |
55
- | `status` | Workspace, member, agent, and app connection states, plus Autopilot presets, team floors, and how old this computer's copy of your rules is. |
57
+ | `status` | One screen: you, your workspace, and this computer; each agent's guard and its fix; Autopilot; apps; keys in Passport; this folder's environments; the CLI version. |
56
58
  | `doctor` | Check Node, credential-file safety, HTTPS policy, `/healthz`, auth, serverInfo, and CLI protocol. Exit 1 on a failed check, with the full report. |
57
59
  | `ready` | Readiness preflight for automation; gate on its `ready` field and exit code. |
58
60
  | `search [query] [--app <key>]` | Search permitted tools. Empty query lists the full catalog. |
@@ -68,7 +70,7 @@ passport run github_search_issues '{"query":"SSO"}'
68
70
  | `rules test "<command>" [--environment <kind>]` | What Autopilot decides for a command, why, and which environment it acts on. |
69
71
  | `sessions [--status running\|idle\|ended]` | Your agents' recent sessions with what Passport decided. |
70
72
  | `undo <action-id>\|--last [--option <id>] [--yes]` | Undo an action Passport took a backup before, within 7 days. See [Undo](#undo). |
71
- | `setup --org <pek_key> [--yes] [--clients <list>]` | Set up every agent on this computer for your company without asking anything (MDM and scripts). See [Company rollout](#company-rollout). |
73
+ | `setup --org <pek_key> [--yes] [--agents <list>] [--lock [--strict]]` | Set up every agent on this computer for your company without asking anything (MDM and scripts); `--lock` (root) locks the guard on. See [Company rollout](#company-rollout). |
72
74
  | `setup` | Install and maintain assigned team workflows as managed skills. |
73
75
  | `session` | Run NDJSON commands over one authenticated MCP session. |
74
76
  | `access` | Signed managed access: `keygen`, `actions`, `run`, `invoke`, `status`, `cancel`. |
@@ -124,51 +126,52 @@ Reads agent MCP configs (Claude Desktop, Claude Code, Cursor, VS Code, Codex), C
124
126
 
125
127
  ```sh
126
128
  npx passport-bridge@latest init # or: passport init
127
- npx passport-bridge@latest init --yes # accept every default; needed without a terminal. Keys stay put
129
+ npx passport-bridge@latest init --dry-run # the plan only; nothing changes (so does --json without --yes)
130
+ npx passport-bridge@latest init --yes # the recommended setup without asking; needed without a terminal. Keys stay put
128
131
  npx passport-bridge@latest init --yes --move-keys # also move CLI keys into Passport and sign those CLIs out
129
- npx passport-bridge@latest init --yes --json # one summary object with each step's status
132
+ npx passport-bridge@latest init --yes --json # one summary object with each step's status and the plan
130
133
  ```
131
134
 
135
+ Plan, then apply. Init scans and signs in, then reads every step below without changing anything and shows one plan: **Will** (what the recommended setup changes), **Edits** (every file it edits, each backed up first), **Already set up**, **Not changed** (with how to change it later), and **You do**, then the Autopilot presets and Environments. One question follows: `Use the recommended setup? (n to choose step by step) [Y/n]`. Enter applies the plan; `n` walks each step with its own question. When nothing is missing it says `Nothing to change.` and asks nothing. It ends with a ✓ list of what's true now and what's left for you, and one next command (the `PATH` line, `passport connect --wait 300`, a first thing to ask your agent, or `passport status`).
136
+
132
137
  Eight steps, each reusing the command that owns it:
133
138
 
134
139
  1. **Scan**: the same local scan as `passport scan`, as one summary line (`--verbose` prints the table).
135
140
  2. **Sign in**: reuses the active or only CLI profile, asks which one when there are several, or runs the browser sign-in from `passport login`.
136
- 3. **Apps**: Railway, Vercel, Supabase, Cloudflare, GitHub, and Stripe, when the scan found a key or its CLI is on PATH. Missing apps are added through the same catalog rules as the web (an app your workspace reviews first says `! Stripe needs approval from your admin.`), then one sign-in page covers the rest. In a terminal init waits until they connect (Enter stops waiting); without one it prints the page and `Next: passport connect --wait 300` and moves on.
137
- 4. **Keys**: for each CLI sign-in on this computer, the same question as `passport keys move`: `Store your Railway account token in Passport and sign the Railway CLI out on this computer? [y/n]`. It has no default: Enter asks again (`Type y or n.`). `--yes` never moves a key: the step prints `Keys stayed on this computer. Run passport keys move to move them.` Add `--move-keys` to move every key it finds unasked; the closing summary then says which (`Moved your Railway key into Passport and signed that CLI out on this computer.`) and which old keys to rotate (`Rotate the old Railway key once your agents don't need it.`, only when a key moved in that run). When Passport already holds a different key for that CLI, an interactive run asks `Replace the Railway key in Passport with the one on this computer? [y/n]` (no default): yes replaces it and signs the CLI out, keeping links; no prints `Kept the key in Passport. This computer's Railway CLI stays signed in.` `--yes` never replaces a key. Quiet when there's nothing to move.
138
- 5. **Environments**: the environments Passport has placed for your apps, each with its kind: `Found 3 environments: production (Railway), preview (Vercel), qa (Railway)`. Anything Passport can't place counts as Production; change it any time in Rules. With no app connected yet it says `Environments appear once an app is connected.`
139
- 6. **Agents**: Passport's one MCP URL with this workspace as its hint (`https://passportmcp.com/mcp?ws=<workspace>`), with each agent's own browser sign-in; a server that doesn't serve `/mcp` yet (read from its OAuth protected-resource metadata) gets the workspace's own URL (`https://<host>/w/<workspace>/mcp`). An existing entry at either URL for this workspace counts as set up, so no token lands in a config file. Claude Code and Codex through their own CLIs (`claude mcp add --transport http --scope user`, `codex mcp add --url`), Cursor through `~/.cursor/mcp.json`, VS Code through `code --add-mcp` or its user `mcp.json`. Claude Desktop connects through Settings → Connectors, so init prints that step.
140
- 7. **Guard**: asks `Apply your Autopilot rules before each shell command in <agents>? [Y/n]`, then runs `passport hook install --guard` for Claude Code, Codex, and Cursor (Codex: blocks only), pointing at the launcher `$PASSPORT_HOME/cli/bin/passport` (`passport.cmd` on Windows), which runs a stable copy of the CLI in `$PASSPORT_HOME/cli/<version>/` (never npm's cache), or at a global `passport-bridge` of the same version or newer. An upgrade rewrites the launcher and the `cli/current` link in one rename each, so hooks follow without being edited; the launcher runs the recorded node, or the node on PATH once that one is removed. A hook from an older init that names a version folder is replaced where it stands, next to your other hooks. Once the new copy is in place, older copies are deleted unless a hook still runs them.
141
+ 3. **Apps**: Railway, Vercel, Supabase, Cloudflare, GitHub, and Stripe, when the scan found a key or its CLI is on PATH. Missing apps are added through the same catalog rules as the web (an app your workspace reviews first says `! Stripe needs approval from your admin.`), then one sign-in page covers the rest. In a terminal init waits until they connect (Enter stops waiting); with `--yes` or without a terminal it prints the page, adds `passport connect --wait 300` to `next`, and moves on.
142
+ 4. **Keys**: the recommended setup keeps them; the plan says `Your Railway and GitHub keys stay on this computer. Move them any time: passport keys move`. Step by step asks the same question as `passport keys move` for each: `Store your Railway account token in Passport and sign the Railway CLI out on this computer? [y/n]`. It has no default: Enter asks again (`Type y or n.`). Add `--move-keys` to move every key it finds without asking; the closing list then says which (`Moved your Railway key into Passport and signed that CLI out here`) and, once per moved key, where to rotate the old one (`Rotate the old Railway key, since copies may exist elsewhere: https://railway.com/account/tokens`). When Passport already holds a different key for that CLI, an interactive run asks `Replace the Railway key in Passport with the one on this computer? [y/n]` (no default): yes replaces it and signs the CLI out, keeping links; no prints `Kept the key in Passport. This computer's Railway CLI stays signed in.` `--yes` never replaces a key. Quiet when there's nothing to move.
143
+ 5. **Environments**: the environments Passport has placed for your apps, grouped by kind (`Production production (Railway), production (Vercel)`), one row per resource. Anything Passport can't place counts as Production and is listed once: `Treated as Production until placed: blue (Railway). Change it in Rules.` A resource named for its kind (`production` in Production) is never called assumed. This folder's links follow (`This folder: Railway production · linked · Production`). With no app connected yet it says they appear once one is.
144
+ 6. **Agents**: Passport's one MCP URL with this workspace as its hint (`https://passportmcp.com/mcp?ws=<workspace>`), with each agent's own browser sign-in; a server that doesn't serve `/mcp` yet (read from its OAuth protected-resource metadata) gets the workspace's own URL (`https://<host>/w/<workspace>/mcp`). An existing entry at either URL for this workspace counts as set up, so no token lands in a config file. Claude Code and Codex through their own CLIs (`claude mcp add --transport http --scope user`, `codex mcp add --url`), Cursor through `~/.cursor/mcp.json`, VS Code through `code --add-mcp` or its user `mcp.json`. Claude Desktop connects through Settings → Connectors: on a terminal init copies the URL and says `Claude Desktop: Settings → Connectors → Add custom connector → paste the URL (copied)`; without one it names the URL.
145
+ 7. **Guard**: (step by step asks `Check each shell command in <agents> before it runs? [Y/n]`) runs `passport hook install --guard` for Claude Code, Codex, and Cursor (Codex: blocks only), pointing at the launcher `$PASSPORT_HOME/cli/bin/passport` (`passport.cmd` on Windows), which runs a stable copy of the CLI in `$PASSPORT_HOME/cli/<version>/` (never npm's cache), or at a global `passport-bridge` of the same version or newer. An upgrade rewrites the launcher and the `cli/current` link in one rename each, so hooks follow without being edited; the launcher runs the recorded node, or the node on PATH once that one is removed. A hook from an older init that names a version folder is replaced where it stands, next to your other hooks. Once the new copy is in place, older copies are deleted unless a hook still runs them.
141
146
  8. **Autopilot**: how much agents can do on their own, per environment:
142
147
 
143
148
  ```
144
- Autopilot How much can agents do on their own?
145
- Production Careful reads run, changes ask
146
- Staging Balanced reads and changes run, deletes ask
147
- Development Hands-off everything except irreversible runs
148
- Keep these? [Y/n]
149
+ Autopilot Production Careful reads run, changes ask
150
+ Staging Balanced reads and changes run, deletes ask
151
+ Development Hands-off everything except irreversible runs
149
152
  ```
150
153
 
151
- `n` chooses per environment; `--yes` keeps the defaults. A team floor stricter than a default is shown with why (`Your team requires Careful or stricter in Staging.`), and choices below it aren't offered. A CLI credential can only make presets stricter; a looser pick says so in one line and keeps the current ones. A re-run shows the presets `(already set up)` without asking. The closing summary says what will ask: `Autopilot on. You'll be asked only for Production changes, deletes outside Development, and irreversible actions.` A server without Autopilot gets the earlier Safety step instead.
154
+ The plan shows them once. Step by step asks one compact question per environment where a choice is left (`Staging: 1 Careful 2 Balanced 3 Hands-off [2]`, Enter keeps it); the recommended setup and `--yes` keep the defaults. A team floor stricter than a default is shown with why (`Your team requires Careful or stricter in Staging.`), and choices below it aren't offered. A CLI credential can only make presets stricter; a looser pick says so in one line and keeps the current ones. A re-run lists them under Already set up without asking. The closing list says what will ask: `Autopilot on. You'll be asked only for Production changes, deletes outside Development, and irreversible actions.` A server without Autopilot gets the earlier Safety step instead.
152
155
 
153
156
  What changes on disk, and how to undo it:
154
157
 
155
- | Where | What | Undo |
156
- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------- | -------------------------------------------------- |
157
- | `~/.passport/credentials.json` | A `cli@<workspace>` profile, as `passport login` writes | `passport logout` |
158
- | `~/.passport/cli/` | A copy of this CLI, the `bin/passport` launchers hooks run, and a `current` link | Delete the folder (after removing the hooks) |
159
- | `~/.claude.json` | A `passport` MCP server entry, via `claude mcp add` | `claude mcp remove --scope user passport` |
160
- | `~/.codex/config.toml` | `[mcp_servers.passport]`, via `codex mcp add` | `codex mcp remove passport` |
161
- | `~/.cursor/mcp.json` | `mcpServers.passport` | Delete that entry |
162
- | VS Code user `mcp.json` | `servers.passport` | `MCP: List Servers`, then remove it |
163
- | `~/.claude/settings.json`, `~/.codex/hooks.json`, `~/.cursor/hooks.json` | Passport's audit and guard hooks | `passport hook uninstall --client <agent> --apply` |
158
+ | Where | What | Undo |
159
+ | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------- |
160
+ | `~/.passport/credentials.json` | A `cli@<workspace>` profile, as `passport login` writes | `passport logout` |
161
+ | `~/.passport/cli/` | A copy of this CLI, the `bin/passport` launchers hooks run, and a `current` link | Delete the folder (after removing the hooks) |
162
+ | `~/.claude.json` | A `passport` MCP server entry, via `claude mcp add` | `claude mcp remove --scope user passport` |
163
+ | `~/.codex/config.toml` | `[mcp_servers.passport]`, via `codex mcp add` | `codex mcp remove passport` |
164
+ | `~/.cursor/mcp.json` | `mcpServers.passport` | Delete that entry |
165
+ | VS Code user `mcp.json` | `servers.passport` | `MCP: List Servers`, then remove it |
166
+ | `~/.claude/settings.json`, `~/.codex/hooks.json`, `~/.cursor/hooks.json` | Passport's audit and guard hooks | `passport hook uninstall --agent <agent> --apply` |
164
167
 
165
- Before editing a file it didn't create, init says which file and keeps one copy of the original as `<file>.passport-backup`. It changes only Passport's own entries, writes atomically, refuses a malformed file with one line, and leaves an existing Passport entry alone unless it points at npm's cache or a file that's gone. Ctrl-C at any point stops cleanly; run init again to pick up where it left off. A question only takes keys typed after it appears, so an Enter pressed during a pause never answers it. Any wait longer than a moment shows what it's for in the step's row (`Sign in Checking your sign-in…`); off a terminal nothing extra prints. If Passport can't be reached, init says `Couldn't reach Passport at <origin>. Check your connection, then run passport init again.` and exits 1. Without a terminal, `init` needs `--yes` (exit 6 otherwise), and `--json` needs `--yes`. It never edits your shell profile: it prints the one `PATH` line to add if you want `passport` everywhere.
168
+ The plan names every file init edits before it edits any, and it keeps one copy of each original as `<file>.passport-backup`. It changes only Passport's own entries, writes atomically, refuses a malformed file with one line, and leaves an existing Passport entry alone unless it points at npm's cache or a file that's gone. Ctrl-C at any point stops cleanly; run init again to pick up where it left off. A question only takes keys typed after it appears, so an Enter pressed during a pause never answers it. Any wait longer than a moment shows what it's for in the step's row (`Sign in Checking your sign-in…`), clipped to one row so it's always replaced cleanly, and work that holds the terminal (an agent's own CLI, copying the CLI for the hooks) says so before it starts; off a terminal nothing extra prints. Everything wraps to the terminal's width, at least 40 columns. If Passport can't be reached, init says `Couldn't reach Passport at <origin>. Check your connection, then run passport init again.` and exits 1. Without a terminal, `init` needs `--yes` or `--dry-run` (exit 6 otherwise); `--json` without `--yes` is a dry run. It never edits your shell profile: it prints the one `PATH` line to add if you want `passport` everywhere.
166
169
 
167
170
  ### Company rollout
168
171
 
169
172
  ```sh
170
173
  npx passport-bridge@latest setup --org pek_example --yes # Jamf, Kandji, Intune, or any script
171
- npx passport-bridge@latest setup --org pek_example --clients claude-code,codex
174
+ npx passport-bridge@latest setup --org pek_example --agents claude-code,codex
172
175
  ```
173
176
 
174
177
  `init` for MDM: it never asks anything and never signs in. It installs the stable copy of the CLI, adds Passport to every detected agent (Claude Code, Cursor, Codex, VS Code; Claude Desktop gets the connector step) at the one URL with the enrollment key as its hint (`https://passportmcp.com/mcp?enroll=pek_…`), turns on the guard and audit hooks for Claude Code, Codex, and Cursor, and records the key in `$PASSPORT_HOME/enrollment.json` (mode 600). It prints one line per agent:
@@ -181,7 +184,14 @@ Codex ✓ Passport added · sign in: codex mcp login passport · guard o
181
184
  Each agent asks you to sign in to Passport the first time it connects.
182
185
  ```
183
186
 
184
- The first line names the workspace the key pre-selects (`GET /api/auth/enrollment/<key>`, public, no credential). It exits 0 even with no agents (`No supported agents found. Nothing to set up.`), so an MDM run never fails a computer without them. A malformed key or `--clients` list exits 6, and so does a key the server doesn't know or has revoked, with the server's one line (`This enrollment key isn't valid.` or `This enrollment key was revoked. Ask your admin for a new one.`) before anything changes. `passport login` on that computer later passes the recorded key: as the browser sign-in hint (`POST /api/auth/cli/start { enroll }`) and for rollout attribution when the CLI credential is minted (`enrollmentKey`). A server that doesn't serve the one URL yet still gets the CLI, hooks, and key, and the agents wait for `passport init`. Run it again any time: it changes nothing that's in place and repairs what drifted (a removed hook, an entry pointing at npm's cache). The enrollment key is a workspace hint, not a credential: people still sign in as themselves. `--cloud <origin>` (or `PASSPORT_CLOUD`) points it at a self-hosted Passport. `--json` prints `{version,origin,universal,url?,workspace?:{id,name},enrollment,clients:[{agent,name,mcp,guard,message?,next?}]}`.
187
+ The first line names the workspace the key pre-selects (`GET /api/auth/enrollment/<key>`, public, no credential). It exits 0 even with no agents (`No supported agents found. Nothing to set up.`), so an MDM run never fails a computer without them. A malformed key or `--agents` list (`--clients` still works) exits 6, and so does a key the server doesn't know or has revoked, with the server's one line (`This enrollment key isn't valid.` or `This enrollment key was revoked. Ask your admin for a new one.`) before anything changes. `passport login` on that computer later passes the recorded key: as the browser sign-in hint (`POST /api/auth/cli/start { enroll }`) and for rollout attribution when the CLI credential is minted (`enrollmentKey`). A server that doesn't serve the one URL yet still gets the CLI, hooks, and key, and the agents wait for `passport init`. Run it again any time: it changes nothing that's in place and repairs what drifted (a removed hook, an entry pointing at npm's cache). The enrollment key is a workspace hint, not a credential: people still sign in as themselves. `--cloud <origin>` (or `PASSPORT_CLOUD`) points it at a self-hosted Passport. `--json` prints `{version,origin,universal,url?,workspace?:{id,name},enrollment,clients:[{agent,name,mcp,guard,message?,next?}]}`.
188
+
189
+ ```sh
190
+ sudo npx passport-bridge@latest setup --org pek_example --yes --lock # lock the guard on
191
+ sudo npx passport-bridge@latest setup --org pek_example --yes --lock --strict # and allow only managed hooks
192
+ ```
193
+
194
+ `--lock`, run as root, puts the guard and audit hooks in each agent's managed settings instead of the per-person steps (as root those would write into root's home), so people can't turn them off (`src/cliSetupLock.ts`, `src/lockedHooks.ts`, a checked copy of `shared/lockedHooks.ts`). It writes a root-owned launcher (`/Library/Application Support/Passport/bin/passport` on macOS, `/opt/passport/bin/passport` on Linux, 0755) that sets `PASSPORT_HOOK_VIA=managed` and runs the person's own `$PASSPORT_HOME/cli/bin/passport`; without one it lets the command run, or with `--strict` blocks it with `Passport's guard isn't set up for you yet. Run: npx passport-bridge@latest init`. Then per agent: Claude Code gets the drop-in `managed-settings.d/50-passport.json`; Codex's `/etc/codex/requirements.toml` gets Passport's `[features]`/`[hooks]` lines between `# >>> passport` and `# <<< passport`; Cursor's system `hooks.json` gets Passport's two entries beside everyone else's. `--strict` adds `allowManagedHooksOnly` and `onFailure: "block"` (Claude Code), `allow_managed_hooks_only = true` (Codex), and `failClosed` (Cursor). A file it can't merge safely (someone else's drop-in or `[hooks]`, `hooks = false`, `disableAllHooks`, invalid JSON) is left untouched with the fix. Atomic writes, files 0644. Without root, or on Windows, it writes nothing and prints `Locking needs administrator rights. Run it with sudo, or deploy these through MDM:` with each path. `--clients` narrows it; `--strict` without `--lock` exits 6. It exits 0 and prints one line per agent (`Claude Code Locked · <path>`, `Already locked`, or `! Not locked: <reason>`); `--json` prints `{version,lock:{strict,shim,agents:[{agent,state,path,message?}]}}` with `state` one of `locked`, `already_locked`, `conflict`, `needs_admin`, `failed`. A hook from the person's own settings stands down when managed settings already run Passport's guard (`src/managedHooks.ts`). `PASSPORT_MANAGED_ROOT` puts every managed path under a folder (tests). Vendor docs: code.claude.com/docs/en/settings, code.claude.com/docs/en/hooks, learn.chatgpt.com/docs/enterprise/managed-configuration, cursor.com/docs/agent/hooks.
185
195
 
186
196
  ### Team workflows
187
197
 
@@ -189,8 +199,8 @@ Codex and Claude Code on macOS and Linux. Requires a member profile.
189
199
 
190
200
  ```sh
191
201
  passport setup list
192
- passport setup install <setup-id> <workflow-key> --client codex # preview
193
- passport setup install <setup-id> <workflow-key> --client codex --apply
202
+ passport setup install <setup-id> <workflow-key> --agent codex # preview
203
+ passport setup install <setup-id> <workflow-key> --agent codex --apply
194
204
  passport setup installed
195
205
  passport setup rollback <skill-name> --apply
196
206
  passport setup remove <skill-name> --apply
@@ -201,9 +211,9 @@ Changes preview unless `--apply` is passed. Personal edits are preserved. `insta
201
211
  ### Shell hook
202
212
 
203
213
  ```sh
204
- passport hook install --client claude-code --guard --apply # or codex, cursor
214
+ passport hook install --agent claude-code --guard --apply # or codex, cursor
205
215
  passport hook status
206
- passport hook uninstall --client claude-code --guard --apply # guard only
216
+ passport hook uninstall --agent claude-code --guard --apply # guard only
207
217
  ```
208
218
 
209
219
  Two hooks per agent. `passport hook` runs after each shell command and records the vendor, a coarse verb, a risk class, and (with Autopilot) the environment name the flags gave and the guard's decision in Activity; the server works out the class and cause. `passport hook guard` runs before it and decides from the member's Autopilot rules (`src/cliHookGuard.ts`):
@@ -212,7 +222,9 @@ Two hooks per agent. `passport hook` runs after each shell command and records t
212
222
  - **Ask** or **deny** when any recognized command needs it. The strictest part of a compound command wins and names itself. `--help` and `--dry-run` never ask.
213
223
  - Each reason names its cause in one line: `Passport: railway redeploy changes Production. Approve to run it.`, or `Blocked by Passport: Team rule, no deletes in Production. Ask an admin to run it, or request an exception in Passport.`
214
224
 
215
- **Speed.** Hooks must never slow agents down. The launcher `$PASSPORT_HOME/cli/bin/passport` (written by `src/initInstall.ts`) answers plain reads and local dev commands in POSIX sh without starting Node (`src/launcherFastPath.ts`): `ls`, `cat`, `rg`, `git status`, `npm test`, `cargo check`, and the rest of a fixed list, joined only by single pipes, with relative paths that stay in the folder and pass through no symlink or hidden file. It answers only while `cli-policy/fastpath.ok` is armed: a full guard run arms it for five minutes when the cached rules give those commands exactly the launcher's answer (`src/hookFastPath.ts`), and a policy or profile change removes it. Each answer appends one line (agent, session id, program names, never an argument) to `cli-policy/fastpath.spool`, which the next full run counts. Anything else, or any doubt, starts Node with the same input, through `dist/hookMain.js`, which loads only the guard. `src/launcherFastPath.test.ts` holds the launcher to the full guard's exact answer across both corpora and generated variants. `PASSPORT_HOOK_FAST=0` turns it off. The after-hook and the guard's own report never wait on the network: they queue to `$PASSPORT_HOME/hook-outbox/` and a detached `passport hook flush` sends them within the budget (`src/hookOutbox.ts`). Each guard run records its timings (numbers only, `src/cliSpeed.ts`), sent every five minutes with the answered counts. `npm run bench:guard` times it all on the compiled CLI.
225
+ **Speed.** Hooks must never slow agents down. The launcher `$PASSPORT_HOME/cli/bin/passport` (written by `src/initInstall.ts`) answers plain reads and local dev commands in POSIX sh without starting Node (`src/launcherFastPath.ts`): `ls`, `cat`, `rg`, `git status`, `cargo check`, and the rest of a fixed list, joined only by single pipes, with relative paths that stay in the folder and pass through no symlink or hidden file. It answers only while `cli-policy/fastpath.ok` is armed: a full guard run arms it for five minutes when the cached rules give those commands exactly the launcher's answer (`src/hookFastPath.ts`), and a policy or profile change removes it. Each answer appends one line (agent, session id, program names, never an argument) to `cli-policy/fastpath.spool`, which the next full run counts. Anything else, or any doubt, starts Node with the same input, through `dist/hookMain.js`, which loads only the guard. `src/launcherFastPath.test.ts` holds the launcher to the full guard's exact answer across both corpora and generated variants. `PASSPORT_HOOK_FAST=0` turns it off. The after-hook and the guard's own report never wait on the network: they queue to `$PASSPORT_HOME/hook-outbox/` and a detached `passport hook flush` sends them within the budget (`src/hookOutbox.ts`). Each guard run records its timings (numbers only, `src/cliSpeed.ts`), sent every five minutes with the answered counts. `npm run bench:guard` times it all on the compiled CLI.
226
+
227
+ **Script reading** (`src/cliScriptRead.ts`, `src/cliScriptText.ts`). For the project's own code, `./x.sh`, `bash x.sh`, `source x.sh`, `make <targets>` (prerequisites first, variables resolved once), and `npm|pnpm|yarn run <name>` or `npm test` (with `pre`/`post` scripts), the guard reads the file and classifies every line like a typed command; the strictest finding wins and says where it came from (`railway up changes Production (from --environment, in deploy.sh)`; Sessions shows `· from deploy.sh`). A line it can't follow makes that part **Partly checked**: no allow, reported as unchecked, with a hash (`opaqueIds`) instead of its name, keyed with 32 random bytes made on the computer and kept in `$PASSPORT_HOME/opaque-salt` (0600), never sent; suggestion counts are therefore per computer. Limits: 256 KB a file, 20 files and 3 levels a command, 30 ms a call. Results are cached in `$PASSPORT_HOME/scan-cache.json` (0600) by path, mtime, and size, then SHA-256; findings only. The after-hook reads it again and reports `drift` when it changed in between. Package scripts no longer take the launcher's fast path, since Node reads them. With a warm cache, a 60-line script adds a few milliseconds; `bench:guard --check` fails over 20 ms.
216
228
 
217
229
  **Everyday commands** (`src/cliHookLocal.ts`, tables in `src/localCommands.ts`, `localTools.ts`, `localFiles.ts`, `localGit.ts`, `localNetwork.ts`). Local commands are placed by what they touch on this computer. The project folder (the git root, else the agent's folder; never `/` or the home folder) is Development: reads such as `ls`, `rg`, `git status`, test runners, linters, builds, and type checks are Reads; `git commit`, formatters with `--write`, package scripts, and `mv`/`cp` are Changes; `rm`, `git clean -fd`, and `git reset --hard` are Deletes. Package installs (`npm install`, `pip install`, `brew install`) are Changes in Other apps. `git push` to the default branch (origin's HEAD, else `main`/`master`) is a Change in Production, to any other branch a Change in Development; deleting a remote branch (`--delete`, `:branch`) is a Delete in Other apps because teammates share it. Temporary folders (`/tmp`, `$TMPDIR`) count as Development; deleting one whole is Irreversible. Outside the project: deleting the home folder, `/`, system paths, or the whole project is Irreversible; other writes are Changes and deletes are Deletes in Other apps; writes to keys, shell startup files, or an agent's own settings are Deletes, and reads of them are no decision. `curl`/`wget` GETs are Reads and anything that sends data is a Change, in Other apps (Development for localhost). docker `ps`/`logs` read, `run`/`build`/`compose up` change, `rm`/`prune` delete. `sudo` never runs silently. The project's own code run directly (`node scripts/check.mjs`, `npx tsx scripts/x.ts`, `bash scripts/ci.sh`, `./scripts/ci.sh`, `make test`) is a Change in Development, like a package script; Passport can't read inside it, so it is never allowed and never recorded as opaque. `tsx --test` and `./node_modules/.bin/<tool>` are their tools, `bash -lc '…'` and `sh -c '…'` are read as the line inside, and Codex's `apply_patch <<'PATCH'` is a change to the files the patch names. A checkout an agent keeps for itself (`~/.codex/worktrees/…`, `~/.cursor/worktrees/…`) is the project, not the agent's settings. Symlinks are resolved before deciding, `cd` is followed through `&&`, `;`, and subshells, and redirects are writes where they land. The server keeps a generated copy of the tables (`node scripts/generate-local-commands.mjs`) for `rules test` on the web. Allowed project work and reads are counted on the machine ("Answered for you") rather than recorded one by one; installs, pushes, and anything that asks or blocks are recorded like vendor commands, with the environment kind and never a path.
218
230
 
@@ -260,16 +272,19 @@ passport wait apr_123
260
272
  passport sessions
261
273
  passport sync # or: passport sync --remove
262
274
  passport env # or: passport env set railway qa staging
275
+ passport actions add scripts/deploy.py --environment production --class change
276
+ passport actions sync # propose this repository's .passport/actions.toml
263
277
  ```
264
278
 
265
279
  - `env` lists where commands in this folder land, read the way each vendor's own CLI reads it (`src/envResolve.ts`; order: flag, the folder's link, the vendor's default, the workspace's saved mapping, the whole-word naming rule, else Production). Link readers: `src/envLinksHosting.ts` (Railway `~/.railway/config.json`, Vercel `.vercel/project.json` / `repo.json`, Supabase `supabase/.temp/project-ref`, Wrangler config, Netlify `.netlify/state.json`, Firebase `.firebaserc` + configstore, Convex `CONVEX_DEPLOYMENT`, Neon `.neon`), `src/envLinksCloud.ts` (Fly, Heroku git remotes, kubeconfig, AWS profile, gcloud configuration, Terraform workspace, Stripe key mode), and `src/envDatabase.ts` (database URLs: only `DATABASE_URL`, `DIRECT_URL`, `POSTGRES_URL*`, `DATABASE_URL_UNPOOLED`, reduced to a host-derived key; the URL, user, and password never leave the function). Files are read fresh for every command, size-capped, and a link file symlinked out of the project is ignored (`src/envLinkFs.ts`). For a placed id its mapping decides, and a different name in the link file is treated as a rename (sent as the new label, which the server stores). A name in a link file never loosens anything: an unplaced id is named only by a label the server confirmed through the connected app (`resources[].confirmed`), which the naming rule then reads (`source: "name"`, shown as `Staging (from its name)`); without one, or when it says nothing, it is assumed Production. The table keeps its columns when every row fits the terminal and stacks each row otherwise. Findings to a server that sends `resources` in cli-policy v2 carry `{kind, source, resourceKey?, label?, platform?, flag?, via}`. `env set` calls `PUT /api/my/environments/:platform/:key`; members may only say Production.
266
280
 
267
281
  - `rules test` classifies the command here and sends only its app and verb (and the environment kind) to `POST /api/my/rules/test`, never the command line. An everyday command goes as a finding (`{finding: {vendor, verb, risk, environment}}`), because only this computer can place its paths. It prints the decision, its cause, the environment, and the class. Without a server answer it decides from this computer's copy and says how old it is. `--environment` picks one when the flags don't say.
268
- - `wait` long-polls `GET /api/my/approvals/<id>/wait`. Approved: `Approved by Ramish. Run the command again.` (exit 0). Declined: the note for the agent, `Declined by Ramish: <note>` (exit 5, cause `approval_denied`). Expired: `Expired. The agent can ask again.` (exit 5, cause `approval_expired`). Still waiting at `--timeout` (default 100 seconds, under an agent's 2-minute command limit): exit 4 with the same command as `next`.
282
+ - `wait` long-polls `GET /api/my/approvals/<id>/wait`, after a short first look that names who decides. On a terminal it prints the approval link at once and one live line (`Waiting for Erin · 1:32 left`); piped, `Waiting for a decision on <id> (up to 100 seconds).` and `Open in Passport: <url>` once Passport says it's still pending. Ctrl-C exits 4 with `The request is still open. Run passport wait <id> to keep waiting.` Approved: `Approved by Ramish. Run the command again.` (exit 0). Declined: the note for the agent, `Declined by Ramish: <note>` (exit 5, cause `approval_denied`). Expired: `Expired. The agent can ask again.` (exit 5, cause `approval_expired`). Still waiting at `--timeout` (default 100 seconds, under an agent's 2-minute command limit): exit 4 with the same command as `next`.
269
283
  - `sessions` lists recent sessions (`GET /api/my/agent-sessions`): status, agent, folder, start, `42 ran · 2 asked · 1 blocked`, environments touched, and `Waiting for you` when approvals are pending.
270
284
  - `sync` writes the allows Passport is sure of into each agent's own permission settings, so those prompts disappear offline and in Codex (`src/nativeSync.ts`). Only reads, test runners, builds and type checks, linters that only check, `git status`, `git add`, and `git commit`, checked against the person's rules. Formatters, fixing linters, `mv`/`cp`, and package scripts stay with the hook, which sees what they touch; deletes, installs, pushes, and Production never sync. Claude Code: `Bash(npm test *)` in `permissions.allow` of `~/.claude/settings.json`. Codex: `prefix_rule(pattern = ["npm", "test"], decision = "allow")` in `~/.codex/rules/passport.rules`, a file Passport owns. Cursor CLI: `Shell(npm:test*)` in `permissions.allow` of `~/.cursor/cli-config.json`. Cursor: `npm test` in `terminalAllowlist` of `~/.cursor/permissions.json`, only when that list already exists there (defining it replaces Cursor's in-app list). Entries Passport added are listed in `$PASSPORT_HOME/native-sync.json`; an entry you had before is never claimed or removed, and a file Passport can't parse exactly (JSONC) is left alone. Sync runs on `init`, `setup --org`, every rules refresh, and `passport sync`; `hook uninstall`, `sync --remove`, and signing out of the last profile take the entries out.
271
- - `status` adds each agent's guard (`Guard: Claude Code On · Codex Not trusted`), the coverage line, and each fix, and sends the daily guard report when due. It also adds today's speed line, `Passport added 0.3 s and asked you twice today. 412 actions ran on their own.` (across your computers when the server keeps speed numbers, else `(this computer)`), and `Answered for you: N prompts today` (allows the hook gave in Claude Code and Cursor, and Codex commands Passport synced, counted only when the agent would have prompted) and which agents' allowlists are synced. Under the presets, one line per exception that lets something run your presets would ask about, in the web's words: `! 1 exception: deletes run in Production without asking, even without a backup.` Counts are appended locally (`$PASSPORT_HOME/answered/`) and sent in batches at most every five minutes as `answered: {batch, count}` on `POST /api/my/cli-activity`.
272
- - `rules test`, `sessions`, and `sync` need a member profile. `wait` also works for a cloud agent's key, on the approval its own `passport exec` opened.
285
+ - `status` is one screen, like `gh auth status`, with a label per row (`You` with the name you signed in as, `Computer`, `Guard`, `Autopilot`, `Apps`, `Keys`, `Shims`, `This folder`, `Allowlists`, `CLI`); under 60 columns each label gets its own row, and piped it never wraps. `Guard` lists each agent's guard (`✓ Claude Code On`, `! Codex Not trusted`) with its fix on the line under it, the coverage line, and sends the daily guard report when due. It also adds today's speed line, `Passport added 0.3 s and asked you twice today. 412 actions ran on their own.` (across your computers when the server keeps speed numbers, else `(this computer)`), and `Answered for you: N prompts today` (allows the hook gave in Claude Code and Cursor, and Codex commands Passport synced, counted only when the agent would have prompted) and which agents' allowlists are synced. Under the presets, one line per exception that lets something run your presets would ask about, in the web's words: `! 1 exception: deletes run in Production without asking, even without a backup.` Counts are appended locally (`$PASSPORT_HOME/answered/`) and sent in batches at most every five minutes as `answered: {batch, count}` on `POST /api/my/cli-activity`.
286
+ - `actions` tells Passport what a project script does (`src/cliActions.ts`): `actions add <script> [args…] --environment <kind> --class <class>` sends the path in the repository (or `make`, `npm`, `pnpm`, `yarn` with the target), an argument glob, the repository's remote fingerprint and name, and the SHA-256 of what it runs, never its contents, to `POST /api/my/project-actions`. `--id <op_…>` resolves a Session row's **Tell Passport what this does** from this computer's scan cache. `actions sync` proposes each entry of `.passport/actions.toml`. A change, delete, or irreversible in Production applies at once; anything looser waits for an admin. The guard then decides a matching run as vendor `project` with that class and environment; it never makes a line allowed on its own, and a changed script stops matching (`projectChanged`) until it's set again. `.passport/actions.toml` entries apply locally only when they ask or block.
287
+ - `rules test`, `sessions`, `actions`, and `sync` need a member profile. `wait` also works for a cloud agent's key, on the approval its own `passport exec` opened.
273
288
 
274
289
  ### Keys and passport exec
275
290
 
@@ -278,12 +293,17 @@ passport keys move # confirm each key [y/n], store it in Passport, si
278
293
  passport keys # what Passport holds, and what's still on this computer
279
294
  passport keys add railway # store a key you paste (stdin, never echoed)
280
295
  passport exec -- railway up -e staging
296
+ passport keys shim # the CLIs that run through Passport when you type them
281
297
  ```
282
298
 
299
+ - Shims keep a moved CLI working when you type it. After each key it moves, `keys move` asks `Keep typing railway in your terminal? Passport runs it with the key it now holds. [Y/n]` (`--yes` installs, `--no-shim` skips) and writes `~/.passport/cli/bin/railway`, which runs `passport exec -- railway "$@"` through the stable launcher. Put that folder ahead of the vendor's on PATH; when it isn't, the CLI prints the same `export PATH=…` line init prints (it never edits your shell profile). `passport keys shim <cli>` adds one, `--remove <cli|all>` takes them out, and `status --json` lists them under `shims`. `exec` never runs a shim: it finds the vendor's own CLI past Passport's folder and anything carrying the shim marker, and a shim stops after three nested calls. A shim goes by itself when Passport no longer holds that vendor's key and when the last profile signs out. POSIX only.
300
+ - Masking, like `op run`, when stdout isn't a terminal (an agent's shell, a pipe, a CI log, where output is kept and read later): `exec` reads the CLI's stdout and stderr and replaces each issued value (raw, base64, URL-encoded) with `<hidden by Passport>`. Output streams; the exit code (or 128 + signal) passes through. In a terminal the CLI gets the terminal itself (colors, prompts), unmasked: a person watching their own screen isn't the risk. `--mask` masks in a terminal too (the CLI then writes to a pipe); `--no-masking` (or `PASSPORT_EXEC_NO_MASKING=1` through a shim) never masks. Cost on an M-series Mac (`npm run bench:mask`): about 625 MB/s through the masker against 1,155 MB/s for a bare pipe, and a few microseconds per line.
301
+ - Releases: Passport's own release computer keeps its Railway sign-in, so releases never depend on Passport. In a repository with `scripts/lib/local-release-controller.mjs`, `keys move` and `init` ask `This computer deploys Passport with the Railway CLI. Moving the key will stop releases. Keep it here? [Y/n]` (Enter, `--yes`, and no terminal keep it). Release attestation checks the exact Railway CLI binary on PATH with a throwaway HOME, so a shim in front of it fails closed. See `docs/DEPLOY.md`.
302
+
283
303
  - After a move, `keys move` remembers where each removed key was in `$PASSPORT_HOME/keys-moved.json` (vendor, `~/…` location, file, field names, size, modified time; never a value or hash). With the daily guard report, files that changed are read again; a key that's back is reported as `reappeared: [vendor]` on `POST /api/my/keys/report`, so the key reads "Back on <computer>" in Apps with the fix `passport keys move`. Kept keys are never listed. The report's computer is the CLI's own sign-in (its Device); the name it sends stays for older servers.
284
304
  - `keys move` finds CLI sign-ins (Railway, GitHub CLI, Vercel, Wrangler API tokens, Supabase, Stripe test keys, the AWS `default` profile) and tokens in Claude Code's settings `env`. For each it asks `[y/n]` with no default (an empty answer asks again; `--yes` moves them all), stores the key in Passport (`POST /api/my/keys`), then signs that CLI out by removing only the credential: the token fields of `~/.railway/config.json` (project links stay), `token` in Vercel's `auth.json` (not revoked; the current team stays), Wrangler's sign-in keys in `default.toml`, the Supabase `access-token` file and its keychain token (saved database passwords stay), the Stripe profile's API keys and its live key in the keychain (account, color, and other profiles stay), the AWS profile's key lines, or the one settings entry. Files are written atomically with their mode kept. Vendor sign-outs don't run because they do more (`railway logout` unlinks every project, `vercel logout` revokes the token Passport just stored); only the GitHub CLI's `gh auth logout --hostname github.com` runs, adding `--user <active>` when several accounts are signed in, so other hosts and accounts stay. Keychain items are deleted by exact service and account (`security delete-generic-password` on macOS, `secret-tool clear` on Linux); where that isn't possible the row says which keychain copy may stay. Wrangler OAuth tokens are removed locally, not revoked. A sign-out that fails leaves the key in Passport and says what's left on disk. `.env` files are never touched: "Used by your app, so Passport leaves it." Browser-session sign-ins (Railway, Vercel, Wrangler OAuth) can't move; the line says how to make a token instead. A different key than the one already in Passport is replaced only when the person answers yes to `Replace the <CLI> key in Passport with the one on this computer? [y/n]`; the CLI then names the key it replaces (`replace: <keyId>` on `POST /api/my/keys`). The server alerts the owner and admins with an Undo, records it in the audit trail, and keeps the old value encrypted for seven days (`POST /api/my/keys/:id/restore` from the browser, or the alert). Without a person (`--yes`, no terminal), both keys stay. The scan report sent afterwards carries provider counts only.
285
305
  - `exec -- <cli> …` runs railway, gh, vercel, wrangler, supabase, stripe, aws, neonctl, or flyctl from PATH. It classifies the command here, asks `POST /api/my/exec/authorize`, and on allow sets only that vendor's variables (`GH_TOKEN`, `RAILWAY_API_TOKEN`, `VERCEL_TOKEN`, `CLOUDFLARE_API_TOKEN`, `SUPABASE_ACCESS_TOKEN`, `STRIPE_API_KEY`, `AWS_*`, `NEON_API_KEY`, `FLY_API_TOKEN`) in the child's environment, removing Passport's own and any stray vendor tokens. Output and exit code pass through. Afterwards it reports the exit code and duration (`POST /api/my/exec/result`, best effort, two seconds at most) so the session row reads Ran or Failed. It refuses paths, shells, `env`, and subcommands that would print the key, sign in again, mint longer-lived tokens, or run another program with the key (`railway run`, `gh auth`, gh extensions, `aws configure`, `vercel dev`, `fly tokens`).
286
- - Asks wait for your approval in Passport (web or push) when you're at the keyboard or with `--wait <sec>`; otherwise exit 4 with the approval id: run `passport wait <id>`, then the command again. An approval is used once. Blocked or declined: exit 5. No key, or it stopped working: exit 3 ("Your Railway key in Passport stopped working. Update it in Apps."). Offline: exit 1, nothing runs, and exec never uses a key on this computer instead. A team that requires the guard refuses exec for an agent whose computer hasn't reported its guard On in 48 hours: exit 5 with `Blocked by Passport: guard required…` and the fix.
306
+ - Asks wait for your approval in Passport (web or push) when you're at the keyboard or with `--wait <sec>`; otherwise exit 4 with the approval id: run `passport wait <id>`, then the command again. While it waits, the approval link prints at once and, on a terminal, one live line counts down (`Waiting for Erin · 1:32 left`); piped, it prints the waiting line and `Open in Passport: <url>`. Ctrl-C exits 4: `The request is still open. Run passport wait <id> to keep waiting, then run the command again.` An approval is used once. Blocked or declined: exit 5. A decline answers the same command for ten minutes, said with who and when: `Declined 2 minutes ago by Erin: Not during the freeze.` and `Run with --ask-again to request again.`; `--ask-again` opens a new request. No key, or it stopped working: exit 3 ("Your Railway key in Passport stopped working. Update it in Apps."). Offline: exit 1, nothing runs, and exec never uses a key on this computer instead. A team that requires the guard refuses exec for an agent whose computer hasn't reported its guard On in 48 hours: exit 5 with `Blocked by Passport: guard required…` and the fix.
287
307
  - In Claude Code, the guard rewrites a plain vendor command whose key is in Passport to `passport exec` (PreToolUse `updatedInput` with allow; a block stays a deny). When the rules ask, or someone is at the keyboard, the rewrite adds `--wait 120`, so the agent holds while the person approves: "Approve it on your phone or in Passport." Codex and Cursor get no rewrite: use `passport exec` there.
288
308
  - Cloud agents (Agents → Cloud agents) run exec and MCP with `PASSPORT_AGENT_KEY` and `PASSPORT_ENDPOINT`: the owner's rules decide, the owner's keys are used, and approvals go to the owner.
289
309
  - Backups: for `gh issue close`, `gh pr close`, `gh api -X DELETE` of a branch, `vercel env rm`, `vercel rollback`, and `vercel promote`, exec also sends the ids Passport needs to take a backup first (repo and number or branch; the linked Vercel project and variable name from `.vercel/project.json`), never a value. After the run it prints `Backup taken. Undo within 7 days: passport undo <action-id>`, or `No backup: <reason>` for a delete it couldn't back up.
@@ -338,7 +358,7 @@ Otherwise Passport refuses to guess: run `passport profiles`, then `passport use
338
358
  A distinct agent identity for policy, selection, devices, and activity, while keeping the CLI credential surface:
339
359
 
340
360
  ```sh
341
- passport login --workspace ws_example --client claude-code --profile claude-code@ws_example
361
+ passport login --workspace ws_example --agent claude-code --profile claude-code@ws_example
342
362
  ```
343
363
 
344
364
  ### Caller attribution
@@ -399,15 +419,17 @@ const actions = await client.actions(); // or client.actions(delegationId)
399
419
 
400
420
  ## Output contract
401
421
 
402
- With `--json`, stdout is exactly one JSON value; hints and warnings go to stderr.
422
+ With `--json`, stdout is exactly one JSON value; hints and warnings go to stderr. JSON shapes only gain fields.
423
+
424
+ On a terminal, human output comes from one renderer (`src/term.ts`): it wraps to the window's width (at least 40 columns, at most 100) without breaking a URL or a `passport` command, hangs wrapped lines under their label or mark, stacks a table one row at a time when its columns don't fit, and clips a live line (a countdown, a "Checking…" row) to one row so it's always replaced cleanly. Marks always sit next to words (`✓ On`, `! Not trusted`, `– skipped`), with `+`, `!`, `-` where the terminal can't show them. Piped output never wraps, has no color, and draws no live lines. `NO_COLOR` and `TERM=dumb` turn color off.
403
425
 
404
426
  | Command | JSON value |
405
427
  | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
406
- | `login` | `{profile,endpoint,client,surface,active,workspaceId,workspaceName?,next}` (`workspaceName` after browser sign-in) |
428
+ | `login` | `{profile,endpoint,client,surface,active,workspaceId,workspaceName?,memberName?,next}`; without a terminal or with `--json`, step one is `{status:"pending",verification_url,code,expires_in,next_step,login_id,next}` |
407
429
  | `profiles` | `{profiles:[{name,active,client?}],active?}` |
408
430
  | `use` | `{profile,active:true}` |
409
- | `logout` | `{profile,removed,revoked}` |
410
- | `status` | `{workspace,member,endpoint,auth,profile?,client,mcps,autopilot?:{presets,floors,floorReason?,exceptions?,cache:{version,fetchedAt,ageMs}},next?}` |
431
+ | `logout` | `{profile,removed,revoked,shimsRemoved?}` |
432
+ | `status` | `{workspace,member,endpoint,auth,profile?,client,mcps,autopilot?:{presets,floors,floorReason?,exceptions?,cache:{version,fetchedAt,ageMs}},next?,computer,keys?,keysOnThisComputer?,folder,cli:{version},signedInAs?,shims?:[{vendor,command,state}]}` |
411
433
  | `wait` | `{approvalId,status:"approved",scope?,message}`; declined, expired, and still-waiting are errors with `approvalId` |
412
434
  | `rules` | `{command,decision,cause?,explanation?,environment?,environmentAssumed?,actionClass?,source}` |
413
435
  | `sessions` | `{sessions:[{id,client,folder,status,startedAt,lastActivityAt,counts,environments,waiting}],nextCursor}` |
@@ -443,7 +465,7 @@ Errors: `{"error":"...","cause":"blocked","exitCode":5,"app":"github"}`, optiona
443
465
 
444
466
  ```sh
445
467
  passport-bridge login --cloud https://passport.example.com --workspace ws_example \
446
- --client cursor --profile cursor@ws_example
468
+ --agent cursor --profile cursor@ws_example
447
469
  ```
448
470
 
449
471
  Configure the agent to launch:
@@ -4,7 +4,7 @@
4
4
  * started serving. We fail closed rather than silently attribute activity to the
5
5
  * wrong workspace.
6
6
  */
7
- export declare const TENANT_FLIP_MESSAGE = "This machine's Passport credential now belongs to a different workspace. Reconnect this agent from the Passport web app or run `passport-bridge login`.";
7
+ export declare const TENANT_FLIP_MESSAGE = "This computer's Passport sign-in now belongs to a different workspace. Reconnect this agent from the Passport web app or run `passport-bridge login`.";
8
8
  /** The saved credential itself was refused: 401 (revoked or expired) or 409
9
9
  * (superseded by a newer rotation that this process cannot see on disk). */
10
10
  export declare class BridgeCredentialError extends Error {
@@ -17,7 +17,7 @@ function safeHostname() {
17
17
  * started serving. We fail closed rather than silently attribute activity to the
18
18
  * wrong workspace.
19
19
  */
20
- export const TENANT_FLIP_MESSAGE = "This machine's Passport credential now belongs to a different workspace. Reconnect this agent from the Passport web app or run `passport-bridge login`.";
20
+ export const TENANT_FLIP_MESSAGE = "This computer's Passport sign-in now belongs to a different workspace. Reconnect this agent from the Passport web app or run `passport-bridge login`.";
21
21
  const ROTATION_PERSISTENCE_MESSAGE = "Passport rotated the credential, but durable local recovery is still pending. Repair the credential store and retry.";
22
22
  /** The saved credential itself was refused: 401 (revoked or expired) or 409
23
23
  * (superseded by a newer rotation that this process cannot see on disk). */
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ import { ensureOneLinerRuntime, oneLinerNodeProblem } from "./nodeVersion.js";
14
14
  /**
15
15
  * passport-bridge — the local tier.
16
16
  *
17
- * passport-bridge login [--cloud URL] [--client AICLIENT] [--profile NAME] [--target T]
17
+ * passport-bridge login [--cloud URL] [--agent NAME] [--profile NAME] [--target T]
18
18
  * passport-bridge serve [--profile NAME] (what agents launch)
19
19
  * passport-bridge status
20
20
  * passport-bridge logout [--profile NAME]
@@ -72,7 +72,7 @@ Usage: passport-bridge [command] [options]
72
72
 
73
73
  Commands:
74
74
  serve Connect an agent using a saved profile (default)
75
- login Sign in and save a rotating bridge credential
75
+ login Sign in and save a rotating bridge sign-in
76
76
  status Check saved bridge profiles
77
77
  logout Revoke and remove a saved profile
78
78
  scan Find keys your agents can reach. Local, no account
@@ -83,8 +83,8 @@ Options:
83
83
  --profile <name> Use a named profile (default: default)
84
84
  --cloud <url> Passport URL for login
85
85
  --workspace <id> Workspace for login
86
- --client <name> agent identity for login
87
- --target <target> Credential target for login
86
+ --agent <name> agent identity for login (--client still works)
87
+ --target <target> Sign-in target for login
88
88
  -h, --help Show this help
89
89
  -V, --version Show the package version
90
90
  `);
@@ -103,7 +103,7 @@ async function serve() {
103
103
  if (!refreshToken || !endpoint) {
104
104
  const saved = getProfile(profile);
105
105
  if (!saved) {
106
- log(`no credential for profile "${profile}". Run: passport-bridge login --profile ${profile}`);
106
+ log(`no sign-in for profile "${profile}". Run: passport-bridge login --profile ${profile}`);
107
107
  process.exit(1);
108
108
  }
109
109
  endpoint = saved.endpoint;
@@ -274,7 +274,7 @@ async function login() {
274
274
  // The agent this credential is for (claude-code, cursor, …). Defaults to
275
275
  // the profile name for back-compat; the install instructions always pass it
276
276
  // explicitly so the gateway labels the device and applies policy correctly.
277
- const client = arg("--client", profile);
277
+ const client = arg("--agent", arg("--client", profile));
278
278
  // Which workspace to sign into. A multi-tenant cloud with the demo off can't
279
279
  // resolve a tenant from a bare device/start (there's no session yet), so the
280
280
  // install instructions always pass this; the whole approve chain stays in it.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * `passport actions` (Batch A item 5): tell Passport what a project's own
3
+ * script does, so the guard can check it.
4
+ *
5
+ * passport actions the workspace's project scripts
6
+ * passport actions add <script> [args…] --environment <kind> --class <class>
7
+ * passport actions add --id <op_…> --environment <kind> --class <class>
8
+ * passport actions sync propose this repository's .passport/actions.toml
9
+ *
10
+ * The CLI sends the script's path in the repository, its arguments as a glob,
11
+ * the repository's remote fingerprint and name, and the SHA-256 of what it runs
12
+ * (so Passport can say "changed since set"). Never the script's contents.
13
+ * `--id` resolves a Session row's "Tell Passport what this does" on this
14
+ * computer, from the scan cache: the server only ever had the keyed hash.
15
+ *
16
+ * A member may say a script changes, deletes, or can't be undone in
17
+ * Production; anything else is proposed until an admin approves it.
18
+ */
19
+ import { type ParsedArgs } from "./cliArgs.js";
20
+ import { type MemberApi } from "./cliClient.js";
21
+ import { type LocalFs } from "./cliHookLocal.js";
22
+ import { type CommandResult, type Runtime } from "./cliSupport.js";
23
+ export type ActionsDependencies = {
24
+ api?: MemberApi;
25
+ fs?: LocalFs;
26
+ cwd?: string;
27
+ };
28
+ export declare function actions(args: ParsedArgs, runtime: Runtime, deps?: ActionsDependencies): Promise<CommandResult>;