passport-bridge 0.16.14 → 0.18.0

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 (52) hide show
  1. package/README.md +23 -22
  2. package/dist/cli.js +5 -5
  3. package/dist/cliActions.js +3 -2
  4. package/dist/cliArgs.d.ts +5 -0
  5. package/dist/cliArgs.js +11 -5
  6. package/dist/cliAutopilot.js +2 -8
  7. package/dist/cliAutopilotPolicy.d.ts +12 -0
  8. package/dist/cliAutopilotPolicy.js +33 -0
  9. package/dist/cliConnect.js +1 -1
  10. package/dist/cliDescribe.d.ts +4 -0
  11. package/dist/cliDescribe.js +11 -0
  12. package/dist/cliGuardHealth.d.ts +1 -1
  13. package/dist/cliGuardHealth.js +1 -1
  14. package/dist/cliHookGuard.js +4 -10
  15. package/dist/cliInit.js +6 -1
  16. package/dist/cliLogout.js +1 -1
  17. package/dist/cliMain.js +82 -42
  18. package/dist/cliMemberCall.js +1 -1
  19. package/dist/cliOffline.js +2 -2
  20. package/dist/cliOutput.js +10 -10
  21. package/dist/cliPolicyRefresh.d.ts +1 -1
  22. package/dist/cliPolicyRefresh.js +1 -1
  23. package/dist/cliScan.d.ts +17 -2
  24. package/dist/cliScan.js +29 -8
  25. package/dist/cliScriptRead.d.ts +1 -1
  26. package/dist/cliScriptRead.js +2 -2
  27. package/dist/cliSetupLock.js +2 -2
  28. package/dist/cliSetupOrg.js +18 -6
  29. package/dist/cliStatus.js +1 -1
  30. package/dist/completion.js +14 -10
  31. package/dist/doctor.js +6 -6
  32. package/dist/enrollment.js +1 -1
  33. package/dist/initAgents.d.ts +12 -3
  34. package/dist/initAgents.js +40 -9
  35. package/dist/initAutopilotStep.d.ts +2 -4
  36. package/dist/initAutopilotStep.js +6 -5
  37. package/dist/initLocalSteps.d.ts +0 -17
  38. package/dist/initLocalSteps.js +3 -78
  39. package/dist/initOutro.js +0 -2
  40. package/dist/initPlan.js +10 -14
  41. package/dist/initState.d.ts +0 -2
  42. package/dist/initState.js +0 -10
  43. package/dist/lockedHooks.d.ts +1 -1
  44. package/dist/lockedHooks.js +3 -3
  45. package/dist/loginFlow.js +1 -1
  46. package/dist/managedHooks.js +1 -1
  47. package/dist/pluginPin.d.ts +1 -1
  48. package/dist/pluginPin.js +1 -1
  49. package/dist/version.d.ts +1 -1
  50. package/dist/version.js +1 -1
  51. package/npm-shrinkwrap.json +2 -2
  52. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@ This package installs two binaries that reach a Passport workspace through its g
5
5
  - `passport`: CLI for terminal agents, scripts, and CI.
6
6
  - `passport-bridge`: stdio bridge for agents that launch a local MCP server, so the agent config holds no long-lived token.
7
7
 
8
- Member profiles get the same tool access, agent selection, guardrails, approvals, and activity logging as native agents. Agent keys keep their pass, selection, guardrails, and audit trail but never raise a member approval prompt.
8
+ Member profiles get the same tool access, agent selection, guardrails, approvals, and activity logging as native agents. Agent tokens keep their pass, selection, guardrails, and audit trail but never raise a member approval prompt.
9
9
 
10
10
  ## Install
11
11
 
@@ -51,6 +51,7 @@ passport run github_search_issues '{"query":"SSO"}'
51
51
  | Command | Purpose |
52
52
  | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
53
53
  | `init [--yes] [--move-keys] [--no-open] [--cloud <origin>] [--skip-apps\|--skip-agents\|--skip-guard] [--verbose] [--json]` | Set up Passport for this computer's agents in one pass. Every step asks first, can be skipped, and is safe to run again. |
54
+ | `init --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). |
54
55
  | `login` | Browser sign-in or sign-up (or device sign-in with `--workspace`); saves a rotating CLI credential and makes the profile active. |
55
56
  | `logout` | Revoke the credential and always remove the local profile (warns if revocation fails). |
56
57
  | `profiles` / `use <name>` | List stored profiles / select the active one. Offline. |
@@ -63,14 +64,12 @@ passport run github_search_issues '{"query":"SSO"}'
63
64
  | `connect [app...] [--alias <name>] [--open] [--wait <s>]` | Show member sign-in links and optionally wait for completion. |
64
65
  | `resources [uri] [--out <file>]` | List or read MCP resources. |
65
66
  | `prompts [name] [--set k=v] [--out <file>]` | List or get MCP prompts. |
66
- | `scan [--path <dir>] [--verbose] [--check]` | Find keys your agents can reach on this computer and what each can do. Local only, no account. `--check` scans files only (not the shell environment) and exits 5 on a high or medium key. |
67
- | `discover` | Scan local MCP configuration and submit a privacy-minimized fleet report. Exit 5 on a managed-policy violation. |
67
+ | `scan [--path <dir>] [--verbose] [--check]` | Find keys your agents can reach on this computer and what each can do, without an account. Signed in, also report the MCP servers set up in your agents to your workspace and exit 5 when its policy doesn't allow one. `--check` scans files only (not the shell environment), never reports, and exits 5 on a high or medium key. |
68
68
  | `hook` | Records the CLIs agents run and, with `--guard`, decides each one before it runs from your Autopilot rules (`install`, `uninstall`, `status`). |
69
69
  | `wait <approval-id> [--timeout <s>]` | Wait for a person to decide an approval request (default 100 seconds). |
70
70
  | `rules test "<command>" [--environment <kind>]` | What Autopilot decides for a command, why, and which environment it acts on. |
71
71
  | `sessions [--status running\|idle\|ended]` | Your agents' recent sessions with what Passport decided. |
72
72
  | `undo <action-id>\|--last [--option <id>] [--yes]` | Undo an action Passport took a backup before, within 7 days. See [Undo](#undo). |
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). |
74
73
  | `setup` | Install and maintain assigned team workflows as managed skills. |
75
74
  | `session` | Run NDJSON commands over one authenticated MCP session. |
76
75
  | `access` | Signed managed access: `keygen`, `actions`, `run`, `invoke`, `status`, `cancel`. |
@@ -100,7 +99,7 @@ passport connect github --wait 120
100
99
 
101
100
  - An approval-required call exits 4 with its approval ID. `--wait <s>` retries only after a definite `approval_pending` response.
102
101
  - The CLI never retries after a network failure or timeout, since the outcome is unknown.
103
- - `connect` with no app names uses one aggregate link when several apps need sign-in. Agent keys get guidance but cannot create sign-in links.
102
+ - `connect` with no app names uses one aggregate link when several apps need sign-in. Agent tokens get guidance but cannot create sign-in links.
104
103
 
105
104
  ### Resources and prompts
106
105
 
@@ -120,7 +119,9 @@ passport scan --path ../api --verbose
120
119
  passport scan --check # CI and pre-commit: files only, exit 5 on a high or medium key
121
120
  ```
122
121
 
123
- Reads agent MCP configs (Claude Desktop, Claude Code, Cursor, VS Code, Codex), CLI sign-in files (GitHub CLI, Railway, Vercel, Wrangler, AWS, Stripe CLI, Supabase, npm), well-known shell variable names, and `.env*` files up to three folders deep in the project. It never prints or saves any part of a key, opens no network connection, needs no profile, and skips `.env` files in your home folder. Sign-ins held by the OS keychain are named but not flagged. `passport-bridge scan` and `passport-bridge init` run the `passport` CLI's own implementation.
122
+ Reads agent MCP configs (Claude Desktop, Claude Code, Cursor, VS Code, Codex), CLI sign-in files (GitHub CLI, Railway, Vercel, Wrangler, AWS, Stripe CLI, Supabase, npm), well-known shell variable names, and `.env*` files up to three folders deep in the project. It never prints, saves, or sends any part of a key, needs no profile, and skips `.env` files in your home folder. Sign-ins held by the OS keychain are named but not flagged. `passport-bridge scan` and `passport-bridge init` run the `passport` CLI's own implementation.
123
+
124
+ Signed in (a member profile, never an agent token), scan then sends the MCP-config inventory to `POST /api/my/discovery/scan` for **Agents → Discovered**: each MCP server's name and how it connects, never paths, commands, arguments, environment values, or keys. The closing line becomes `No key left this computer.` followed by what Passport made of it (`Sent the MCP setup on <computer> to Passport: …`), and a workspace that requires MCP servers to go through Passport makes it exit 5. A problem sending it is one line and never fails the scan. Without a profile, and with `--check`, nothing leaves the computer (`Nothing left this computer.`). `passport discover` is its old name: it still sends the inventory alone, with the same output and exit code, and says `passport discover is now part of passport scan.` on stderr.
124
125
 
125
126
  ### Set up with init
126
127
 
@@ -141,7 +142,7 @@ Eight steps, each reusing the command that owns it:
141
142
  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
143
  4. **Keys**: the recommended setup keeps them; the plan says `Your GitHub and Railway keys stay on this computer. Move them any time.` with `Run: passport keys move` under it. Step by step asks the same question as `passport keys move` for each: `Move your Railway account token into Passport and sign the Railway CLI out on this computer? [y/N]` (a long question wraps; `[y/N]` stays on its last line). Enter keeps the key here; an answer that isn't y or n 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 `Passport already holds a different Railway key. Replace it with this computer's? Every agent that uses it switches to this one.` then `Type railway to confirm, or press Enter to cancel:`: only the name replaces it and signs the CLI out, keeping links; anything else 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
144
  5. **Where** (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), counted as 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: paste the copied URL in Settings → Connectors → Add custom connector`; without one it names the URL.
145
+ 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 entry already at the one URL counts as set up. Once the server serves `/mcp`, an entry at this workspace's own URL or a local bridge entry for this workspace (`passport-bridge serve --profile <agent>@<workspace>`) moves to the one URL: the plan says `Move Cursor and Codex to Passport's one URL`, and each row's status is `updated`. Codex without its CLI gets its `[mcp_servers.passport]` table (and subtables) replaced in place. An entry for another workspace is left as is. No token lands in a config file. **Agents** shows `Uses an old URL` on an agent still on the workspace's own URL until init moves it. 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: paste the copied URL in Settings → Connectors → Add custom connector`; without one it names the URL.
145
146
  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 (in Codex, a command your rules ask about is blocked with how to approve it, since Codex can't show Passport's questions), 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.
146
147
  8. **Autopilot**: how much agents can do on their own, per environment:
147
148
 
@@ -151,7 +152,7 @@ Eight steps, each reusing the command that owns it:
151
152
  Development Hands-off everything except irreversible runs
152
153
  ```
153
154
 
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 Done without asking. The closing list says what will ask: `Autopilot on: asks only for Production changes, deletes outside Development, and irreversible actions`. A server without Autopilot gets the earlier Safety step instead.
155
+ 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 Done without asking. The closing list says what will ask: `Autopilot on: asks only for Production changes, deletes outside Development, and irreversible actions`. A server without Autopilot gets no rules step (`Autopilot needs a newer Passport server.`); init never writes the retired safety profile.
155
156
 
156
157
  What changes on disk, and how to undo it:
157
158
 
@@ -170,11 +171,11 @@ The plan names every file init edits before it edits any, and it keeps one copy
170
171
  ### Company rollout
171
172
 
172
173
  ```sh
173
- npx passport-bridge@latest setup --org pek_example --yes # Jamf, Kandji, Intune, or any script
174
- npx passport-bridge@latest setup --org pek_example --agents claude-code,codex
174
+ npx passport-bridge@latest init --org pek_example --yes # Jamf, Kandji, Intune, or any script
175
+ npx passport-bridge@latest init --org pek_example --yes --agents claude-code,codex
175
176
  ```
176
177
 
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:
178
+ `init --org` is `init` for MDM: it never asks anything and never signs in. `passport setup --org` is its old name and still runs it for one release, saying `passport setup --org is now passport init --org.` on stderr. init's own step flags (`--dry-run`, `--move-keys`, `--skip-*`, `--no-open`, `--verbose`) don't go with `--org` (exit 6), and `--agents`, `--lock`, and `--strict` need `--org`. 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:
178
179
 
179
180
  ```
180
181
  Passport setup for passportmcp.com (enrollment pek_…mple)
@@ -184,11 +185,11 @@ Codex ✓ Passport added · sign in: codex mcp login passport · guard o
184
185
  Each agent asks you to sign in to Passport the first time it connects.
185
186
  ```
186
187
 
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
+ 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). When the key names its workspace, an agent on that workspace's own URL or a local bridge for it moves to the one URL (`✓ Passport updated`). 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
 
189
190
  ```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
191
+ sudo npx passport-bridge@latest init --org pek_example --yes --lock # lock the guard on
192
+ sudo npx passport-bridge@latest init --org pek_example --yes --lock --strict # and allow only managed hooks
192
193
  ```
193
194
 
194
195
  `--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.
@@ -263,7 +264,7 @@ An ask becomes one Activity row. In Claude Code, with the audit hook registered,
263
264
 
264
265
  `src/cliPolicy.ts` caches the member's CLI policy (`GET /api/my/cli-policy`) at `$PASSPORT_HOME/cli-policy/<profile>.json` (mode 600). Servers with Autopilot send version 2 (`src/cliPolicyV2.ts`: presets, floors, CLI rules, irreversible and delete verbs, environment flags, placed environments); older servers send version 1, and then the guard keeps its earlier shape: ask or deny before destructive verbs, never allow, no server call, and reports without the Autopilot fields. `passport login` and `passport status` refresh it and `passport logout` removes it. A 404 or error keeps the previous copy; with no copy the guard asks before every destructive verb. `PASSPORT_HOOK_DISABLED=1` turns both hooks off.
265
266
 
266
- The Passport plugin (`rsyed94/passport-plugins`) runs the same two hooks from the agent's plugin folder, with `PASSPORT_HOOK_VIA=plugin`. `passport hook status` shows those agents as `via plugin`, and `hook install`, `init`, and `setup --org` skip them (`Claude Code: already covered by the Passport plugin.`) so nothing is recorded twice. The plugin pins the CLI version in `src/pluginPin.ts`.
267
+ The Passport plugin (`rsyed94/passport-plugins`) runs the same two hooks from the agent's plugin folder, with `PASSPORT_HOOK_VIA=plugin`. `passport hook status` shows those agents as `via plugin`, and `hook install`, `init`, and `init --org` skip them (`Claude Code: already covered by the Passport plugin.`) so nothing is recorded twice. The plugin pins the CLI version in `src/pluginPin.ts`.
267
268
 
268
269
  ### Autopilot from the terminal
269
270
 
@@ -283,10 +284,10 @@ passport actions sync # propose this repository's .passport/actions.toml
283
284
  - `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.
284
285
  - `wait` long-polls `GET /api/my/approvals/<id>/wait`, after a short first look that names who decides. Once Passport says the request is still pending (never for one that doesn't exist or is already decided), on a terminal it prints the approval link 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>`. Ctrl-C exits 4 with `The request is still open. Keep waiting any time.` and `Run: passport wait <id>`. 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`.
285
286
  - `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.
286
- - `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.
287
+ - `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`, `init --org`, every rules refresh, and `passport sync`; `hook uninstall`, `sync --remove`, and signing out of the last profile take the entries out.
287
288
  - `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`.
288
289
  - `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.
289
- - `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.
290
+ - `rules test`, `sessions`, `actions`, and `sync` need a member profile. `wait` also works for a cloud agent's agent token, on the approval its own `passport exec` opened.
290
291
 
291
292
  ### Keys and passport exec
292
293
 
@@ -308,7 +309,7 @@ passport keys shim # the CLIs that run through Passport when you type
308
309
  - `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`).
309
310
  - 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. Keep waiting, then run the command again.` and `Run: passport wait <id>`. 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 (`No Railway key in Passport yet. Add a Railway key in Passport → Apps.`, or `Your Railway key in Passport stopped working. Update it in Apps.`). When this computer still has the Railway CLI's own sign-in, the no-key line is `No Railway key in Passport yet, but this computer has one.` with `Run: passport keys move railway` instead (read here; Passport never sees this computer's files). 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.
310
311
  - 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.
311
- - 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.
312
+ - Cloud agents (Agents → Cloud agents) run exec and MCP with their agent token in `PASSPORT_AGENT_KEY` and `PASSPORT_ENDPOINT`: the owner's rules decide, the owner's keys are used, and approvals go to the owner.
312
313
  - 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.
313
314
 
314
315
  ### Undo
@@ -333,7 +334,7 @@ printf '%s\n' \
333
334
  - One `{"id"?:string|number,"argv":string[]}` request per line, run in order; one JSON response per line with `ok`, `exitCode`, and `result` or error fields. `id` is echoed.
334
335
  - A failed request does not close the session. EOF, SIGINT, or SIGTERM closes it cleanly.
335
336
  - Limits: 1 MiB per line, 128 arguments. Set `--profile`, `--caller`, and `--timeout` on `passport session`, not per request.
336
- - Allowed commands: `status`, `search`, `describe`, `run`, `connect`, `resources`, `prompts`, `discover`.
337
+ - Allowed commands: `status`, `search`, `describe`, `run`, `connect`, `resources`, `prompts` (and `discover`, the old inventory name, for one release).
337
338
  - Governance is unchanged; access tokens keep normal expiry and refresh.
338
339
 
339
340
  ### Shell completion
@@ -377,7 +378,7 @@ passport ready --json
377
378
  passport search "deployment status" --json
378
379
  ```
379
380
 
380
- `PASSPORT_ENDPOINT` is Passport's one URL (`https://<host>/mcp`, where the agent key's own prefix says which workspace) or a workspace's own (`https://<host>/w/<workspace>/mcp`). Set both variables together. Environment auth overrides stored profiles, persists nothing, and cannot be combined with `--profile` or `login`/`logout`. Agent keys skip member approval prompts; use a member profile for work that must pause for a human.
381
+ `PASSPORT_ENDPOINT` is Passport's one URL (`https://<host>/mcp`): the agent token's own prefix says which workspace. A workspace's own older URL (`https://<host>/w/<workspace>/mcp`) still works. Set both variables together. Environment auth overrides stored profiles, persists nothing, and cannot be combined with `--profile` or `login`/`logout`. Agent tokens skip member approval prompts; use a member profile for work that must pause for a human.
381
382
 
382
383
  ## Managed access
383
384
 
@@ -448,8 +449,8 @@ On a terminal, human output comes from one renderer (`src/term.ts`): it wraps to
448
449
  | `run` | Full governed MCP tool result, including `structuredContent` |
449
450
  | `connect` | Gateway payload with `connections` and optional `connectAllUrl` |
450
451
  | `resources`, `prompts` | MCP list, read, or get result |
451
- | `discover` | `{snapshot,report,compliant}` |
452
- | `scan` | `{version:1,findings:[{id,provider,kind,label,severity,location,locations,blastRadius}],agents,unreadable,checked}` |
452
+ | `discover` | `{snapshot,report,compliant}` (the old name of `scan`'s inventory step, for one release) |
453
+ | `scan` | `{version:1,findings:[{id,provider,kind,label,severity,location,locations,blastRadius}],agents,unreadable,checked,inventory?:{snapshot,report,compliant}}`; `inventory` only when signed in, or `{error}` when it couldn't be sent |
453
454
  | `session` | NDJSON `{id?,ok,exitCode,result?}` or `{id?,ok:false,error,cause,exitCode,...}` |
454
455
  | `access` | `keygen`: algorithm, paths, public JWK; `actions`: `{actions}`; `run`/`cancel`: `{run}`; `invoke`: governed result; `status`: `{receipt}` |
455
456
  | `completion` | `{shell,script}` |
package/dist/cli.js CHANGED
@@ -27,8 +27,9 @@ function arg(flag, fallback = "") {
27
27
  const i = process.argv.indexOf(flag);
28
28
  return i >= 0 && process.argv[i + 1] ? process.argv[i + 1] : fallback;
29
29
  }
30
- /** `npx passport-bridge@latest scan`, `init`, and `setup --org` run the
31
- * `passport` CLI's own implementation, so both bins behave identically. */
30
+ /** `npx passport-bridge@latest scan` and `init` (with `--org` for MDM) run the
31
+ * `passport` CLI's own implementation, so both bins behave identically.
32
+ * `setup` is here for `setup --org`, init's old name for one release. */
32
33
  const PASSPORT_ONE_LINERS = new Set(["scan", "init", "setup"]);
33
34
  async function passportOneLiner() {
34
35
  const problem = oneLinerNodeProblem();
@@ -80,9 +81,8 @@ Commands:
80
81
  login Sign in and save a rotating bridge sign-in
81
82
  status Check saved bridge profiles
82
83
  logout Revoke and remove a saved profile
83
- scan Find keys your agents can reach. Local, no account
84
- init Set up Passport for your agents, step by step
85
- setup setup --org <key>: set up every agent here for your company (MDM)
84
+ scan Find the keys and MCP servers your agents can reach
85
+ init Set up Passport for your agents (--org <key> for company computers)
86
86
 
87
87
  Options:
88
88
  --profile <name> Use a named profile (default: default)
@@ -21,6 +21,7 @@ import { readBoundedJson } from "./boundedResponse.js";
21
21
  import { value } from "./cliArgs.js";
22
22
  import { memberApi } from "./cliClient.js";
23
23
  import { localMachine, NODE_FS } from "./cliHookLocal.js";
24
+ import { CLASS_LABEL } from "./cliAutopilotPolicy.js";
24
25
  import { lookupOpaqueId, normalizeRemote, originUrl, remoteFingerprint, sha256 } from "./cliScriptRead.js";
25
26
  import { linesDigestInput, makeLines, packageLines, parseRepoActions } from "./cliScriptText.js";
26
27
  import { unknownSubcommand } from "./cliSuggest.js";
@@ -30,9 +31,9 @@ const ENVIRONMENTS = new Set(["production", "staging", "development"]);
30
31
  const CLASSES = new Set(["read", "change", "delete", "irreversible"]);
31
32
  const RUNNERS = new Set(["make", "npm", "pnpm", "yarn"]);
32
33
  const ENV_WORD = { production: "Production", staging: "Staging", development: "Development" };
33
- /** An action class in sentence case, as `rules test` and the web say it: "Change". */
34
+ /** An action class in the word `rules test` and the web use: "Change". */
34
35
  function classWord(actionClass) {
35
- return actionClass ? `${actionClass.charAt(0).toUpperCase()}${actionClass.slice(1)}` : "";
36
+ return actionClass && CLASSES.has(actionClass) ? CLASS_LABEL[actionClass] : "";
36
37
  }
37
38
  function api(args, runtime, deps) {
38
39
  if (deps.api)
package/dist/cliArgs.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  export declare const COMMANDS: readonly ["init", "login", "logout", "profiles", "use", "status", "doctor", "ready", "search", "describe", "run", "connect", "resources", "prompts", "discover", "scan", "hook", "wait", "rules", "actions", "sessions", "env", "sync", "exec", "undo", "keys", "setup", "session", "access", "completion", "help", "version"];
2
2
  export type Command = (typeof COMMANDS)[number];
3
+ /** Old names that still run for one release, left out of help, completion,
4
+ * and suggestions. `discover` is part of `scan` now. */
5
+ export declare const HIDDEN_COMMANDS: readonly Command[];
6
+ /** Every command help, completion, and suggestions name. */
7
+ export declare const VISIBLE_COMMANDS: readonly Command[];
3
8
  /** A usage mistake. `suggestion` is the command the person most likely meant. */
4
9
  export declare class ArgError extends Error {
5
10
  readonly suggestion?: string[] | undefined;
package/dist/cliArgs.js CHANGED
@@ -33,6 +33,11 @@ export const COMMANDS = [
33
33
  "help",
34
34
  "version"
35
35
  ];
36
+ /** Old names that still run for one release, left out of help, completion,
37
+ * and suggestions. `discover` is part of `scan` now. */
38
+ export const HIDDEN_COMMANDS = ["discover"];
39
+ /** Every command help, completion, and suggestions name. */
40
+ export const VISIBLE_COMMANDS = COMMANDS.filter((command) => !HIDDEN_COMMANDS.includes(command));
36
41
  const FLAGS = {
37
42
  profile: { kind: "value" },
38
43
  json: { kind: "boolean" },
@@ -47,10 +52,11 @@ const FLAGS = {
47
52
  guard: { kind: "boolean", commands: ["hook"] },
48
53
  "no-open": { kind: "boolean", commands: ["login", "init"] },
49
54
  yes: { kind: "boolean", commands: ["init", "setup", "keys", "undo"] },
50
- org: { kind: "value", commands: ["setup"] },
51
- clients: { kind: "value", commands: ["setup"] },
52
- lock: { kind: "boolean", commands: ["setup"] },
53
- strict: { kind: "boolean", commands: ["setup"] },
55
+ // `init --org` is setup for MDM; `setup --org` still runs it for one release.
56
+ org: { kind: "value", commands: ["init", "setup"] },
57
+ clients: { kind: "value", commands: ["init", "setup"] },
58
+ lock: { kind: "boolean", commands: ["init", "setup"] },
59
+ strict: { kind: "boolean", commands: ["init", "setup"] },
54
60
  "skip-apps": { kind: "boolean", commands: ["init"] },
55
61
  "skip-agents": { kind: "boolean", commands: ["init"] },
56
62
  "skip-guard": { kind: "boolean", commands: ["init"] },
@@ -108,7 +114,7 @@ function optionsFor(command) {
108
114
  return [...new Set(names)];
109
115
  }
110
116
  function unknownCommand(raw, help = false) {
111
- const guess = closest(raw, COMMANDS);
117
+ const guess = closest(raw, VISIBLE_COMMANDS);
112
118
  const argv = guess ? ["passport", ...(help ? ["help"] : []), guess] : undefined;
113
119
  return new ArgError(`Unknown command "${raw}". ${argv ? `Did you mean: ${argv.join(" ")}` : "See every command with passport help."}`, argv);
114
120
  }
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import { guardStatus } from "./cliStatusGuard.js";
12
12
  import { value } from "./cliArgs.js";
13
- import { OTHER_APPS, causeSentence, PRESET_ROWS, rowLabel } from "./cliAutopilotPolicy.js";
13
+ import { CLASS_LABEL, OTHER_APPS, causeSentence, PRESET_ROWS, rowLabel } from "./cliAutopilotPolicy.js";
14
14
  import { classifyLine, localMachine } from "./cliHookLocal.js";
15
15
  import { ENV_KINDS, isEnvKind } from "./cliHookEnvironment.js";
16
16
  import { decideGuard, guardLabel } from "./cliHookGuard.js";
@@ -30,12 +30,6 @@ import { api, text } from "./cliMemberCall.js";
30
30
  // ---- passport rules test ----------------------------------------------------
31
31
  const DECISION_WORDS = { allow: "Runs", ask: "Asks first", block: "Blocked" };
32
32
  const DECISION_MARKS = { allow: "done", ask: "warn", block: "fail" };
33
- const CLASS_WORDS = {
34
- read: "Read",
35
- change: "Change",
36
- delete: "Delete",
37
- irreversible: "Irreversible"
38
- };
39
33
  function ageText(ms) {
40
34
  const minutes = Math.round(ms / 60_000);
41
35
  if (minutes < 1)
@@ -66,7 +60,7 @@ function ruleTestLines(term, label, result, source) {
66
60
  label,
67
61
  ` ${mark(term, DECISION_MARKS[result.decision])} ${explanation}`,
68
62
  ...(environment ? [` Environment: ${environment}`] : []),
69
- ...(result.actionClass ? [` Class: ${CLASS_WORDS[result.actionClass]}`] : []),
63
+ ...(result.actionClass ? [` Class: ${CLASS_LABEL[result.actionClass]}`] : []),
70
64
  ...indented(source)
71
65
  ];
72
66
  }
@@ -23,6 +23,18 @@ export type Cause = {
23
23
  id?: string;
24
24
  label: string;
25
25
  };
26
+ /**
27
+ * Checked copies of the class words in shared/autopilotContract.ts
28
+ * (cliAutopilotPolicy.test.ts compares them): one class, one word, on every
29
+ * surface. `CLASS_LABEL` names it ("Delete"), `CLASS_EFFECT` says what it does
30
+ * to an environment ("deletes from Production"), `CLASS_EFFECT_OTHER` without one
31
+ * ("deletes data").
32
+ */
33
+ export declare const CLASS_LABEL: Readonly<Record<ActionClass, string>>;
34
+ export declare const CLASS_EFFECT: Readonly<Record<ActionClass, string>>;
35
+ export declare const CLASS_EFFECT_OTHER: Readonly<Record<ActionClass, string>>;
36
+ export declare const CLASS_OF_RISK: Readonly<Record<"read" | "write" | "destructive", ActionClass>>;
37
+ export declare function riskOfClass(actionClass: ActionClass): "read" | "write" | "destructive";
26
38
  /**
27
39
  * Checked copies of `ruleParts` and `causeSentence` in shared/collabContract.ts
28
40
  * (the CLI can't import shared/; cliAutopilot.test.ts compares them):
@@ -14,6 +14,39 @@
14
14
  import { ENV_LABEL } from "./cliHookEnvironment.js";
15
15
  export const PRESETS = ["careful", "balanced", "handsoff"];
16
16
  export const ACTION_CLASSES = ["read", "change", "delete", "irreversible"];
17
+ /**
18
+ * Checked copies of the class words in shared/autopilotContract.ts
19
+ * (cliAutopilotPolicy.test.ts compares them): one class, one word, on every
20
+ * surface. `CLASS_LABEL` names it ("Delete"), `CLASS_EFFECT` says what it does
21
+ * to an environment ("deletes from Production"), `CLASS_EFFECT_OTHER` without one
22
+ * ("deletes data").
23
+ */
24
+ export const CLASS_LABEL = {
25
+ read: "Read",
26
+ change: "Change",
27
+ delete: "Delete",
28
+ irreversible: "Irreversible"
29
+ };
30
+ export const CLASS_EFFECT = {
31
+ read: "reads",
32
+ change: "changes",
33
+ delete: "deletes from",
34
+ irreversible: "can't be undone in"
35
+ };
36
+ export const CLASS_EFFECT_OTHER = {
37
+ read: "reads data",
38
+ change: "makes a change",
39
+ delete: "deletes data",
40
+ irreversible: "can't be undone"
41
+ };
42
+ export const CLASS_OF_RISK = {
43
+ read: "read",
44
+ write: "change",
45
+ destructive: "delete"
46
+ };
47
+ export function riskOfClass(actionClass) {
48
+ return actionClass === "read" ? "read" : actionClass === "change" ? "write" : "destructive";
49
+ }
17
50
  /**
18
51
  * Checked copies of `ruleParts` and `causeSentence` in shared/collabContract.ts
19
52
  * (the CLI can't import shared/; cliAutopilot.test.ts compares them):
@@ -20,7 +20,7 @@ export function managePayload(result) {
20
20
  }
21
21
  function assertConnectionCanStart(auth, needSignin, urls, human, shouldOpen, shouldAct) {
22
22
  if (auth.kind === "agent-key" && needSignin.length && shouldAct) {
23
- return failure("Agent-key authentication cannot create a person's sign-in link.", 3, "member_profile_required", {
23
+ return failure("Agent-token authentication cannot create a person's sign-in link.", 3, "member_profile_required", {
24
24
  app: needSignin.length === 1 ? String(needSignin[0].app ?? "") || undefined : undefined,
25
25
  hint: "Use an interactive member profile, delegate the agent to a member, or configure a company-managed connection.",
26
26
  remediation: {
@@ -6,3 +6,7 @@
6
6
  * conventional MCP vocabulary. Keep all server-provided fields intact.
7
7
  */
8
8
  export declare function describedToolPayload(exact: Record<string, unknown>, fallbackName: string): Record<string, unknown>;
9
+ /** A search hit's class in the word every surface uses: Read, Change, Delete,
10
+ * or Irreversible. A server older than the class sent only `readonly`; a tool
11
+ * it didn't call read-only reads as a change. */
12
+ export declare function toolClassWord(hit: Record<string, unknown>): string;
@@ -1,3 +1,4 @@
1
+ import { ACTION_CLASSES, CLASS_LABEL } from "./cliAutopilotPolicy.js";
1
2
  /**
2
3
  * Normalize a search result for the CLI's describe contract.
3
4
  *
@@ -16,3 +17,13 @@ export function describedToolPayload(exact, fallbackName) {
16
17
  inputSchema: parameters
17
18
  };
18
19
  }
20
+ /** A search hit's class in the word every surface uses: Read, Change, Delete,
21
+ * or Irreversible. A server older than the class sent only `readonly`; a tool
22
+ * it didn't call read-only reads as a change. */
23
+ export function toolClassWord(hit) {
24
+ const sent = hit.actionClass;
25
+ if (typeof sent === "string" && ACTION_CLASSES.includes(sent)) {
26
+ return CLASS_LABEL[sent];
27
+ }
28
+ return CLASS_LABEL[hit.readonly === true ? "read" : "change"];
29
+ }
@@ -13,7 +13,7 @@ export declare const GUARD_HEALTH_PATH = "/api/my/guard-health";
13
13
  type ApiCall = (path: string, init: RequestInit) => Promise<Response>;
14
14
  /** Managed settings hold Passport's guard for this agent: one reader for
15
15
  * guard health and the hooks' stand-down (`managedHooks.ts`, which
16
- * `passport setup --org --lock` writes for). */
16
+ * `passport init --org --lock` writes for). */
17
17
  export declare function managedGuard(client: GuardClient, env: Env): boolean;
18
18
  /** Each agent on this computer, as the report sends it. */
19
19
  export declare function guardClientReports(env: Env): Promise<GuardClientReport[]>;
@@ -19,7 +19,7 @@ import { VERSION } from "./version.js";
19
19
  export const GUARD_HEALTH_PATH = "/api/my/guard-health";
20
20
  /** Managed settings hold Passport's guard for this agent: one reader for
21
21
  * guard health and the hooks' stand-down (`managedHooks.ts`, which
22
- * `passport setup --org --lock` writes for). */
22
+ * `passport init --org --lock` writes for). */
23
23
  export function managedGuard(client, env) {
24
24
  return managedPassportHook(client, env);
25
25
  }
@@ -13,7 +13,7 @@
13
13
  * With a v1 policy (an older server) or none at all, the guard keeps its old
14
14
  * shape: ask or deny, never allow.
15
15
  */
16
- import { causeSentence, decideAction, decisionRank, envLabel } from "./cliAutopilotPolicy.js";
16
+ import { CLASS_EFFECT, CLASS_EFFECT_OTHER, CLASS_OF_RISK as CLASS_OF_HOOK_RISK, causeSentence, decideAction, decisionRank, envLabel } from "./cliAutopilotPolicy.js";
17
17
  import { reportedEnvironment } from "./cliHookEnvironment.js";
18
18
  import { placementOf, resolveTarget, targetNote } from "./envResolve.js";
19
19
  import { NODE_LINK_FS } from "./envLinkFs.js";
@@ -52,7 +52,7 @@ const OPAQUE_SHELL = /[<>`$\\\n]|\$\(/;
52
52
  /** Built in, whatever the server sends: these can't be taken back. */
53
53
  const BUILT_IN_IRREVERSIBLE = { gh: ["repo delete"] };
54
54
  /** Classes the guard decides; anything else (http, api, sql, local) is no decision. */
55
- const CLASS_OF_RISK = { read: "read", write: "change", destructive: "delete" };
55
+ const CLASS_OF_RISK = CLASS_OF_HOOK_RISK;
56
56
  /** `fly` and `flyctl` share one map; the server may key either spelling. */
57
57
  function vendorKeys(vendor) {
58
58
  const spec = Object.hasOwn(VENDORS, vendor) ? VENDORS[vendor] : undefined;
@@ -329,12 +329,6 @@ export function decideGuard(findings, policy, command = "", complete, machine) {
329
329
  return decideV1(findings, policy);
330
330
  }
331
331
  // ---- What the agent shows ---------------------------------------------------
332
- const EFFECT = {
333
- read: (env) => `reads ${env}`,
334
- change: (env) => `changes ${env}`,
335
- delete: (env) => `deletes from ${env}`,
336
- irreversible: (env) => `can't be undone in ${env}`
337
- };
338
332
  /** How the environment was found: a short aside after the effect
339
333
  * (" (linked in this folder)") or a sentence at the end (" Environment
340
334
  * unknown, treated as Production."). */
@@ -395,13 +389,13 @@ export function askMessage(decision) {
395
389
  }
396
390
  if (decision.cause && decision.environment && decision.actionClass) {
397
391
  const branch = decision.deciding?.pushEnvironment === "production" ? " (the default branch)" : "";
398
- const effect = `${EFFECT[decision.actionClass](envLabel(decision.environment))}${branch}`;
392
+ const effect = `${CLASS_EFFECT[decision.actionClass]} ${envLabel(decision.environment)}${branch}`;
399
393
  const because = decision.cause.kind === "preset" ? "" : ` ${decision.cause.label}.`;
400
394
  const notes = sourceNotes(decision);
401
395
  return `Passport: ${decision.label} ${effect}${notes.aside}.${because}${notes.sentence} Approve to run it.`;
402
396
  }
403
397
  return decision.destructive
404
- ? `Passport: ${decision.label} is destructive. Run it only if you meant to.`
398
+ ? `Passport: ${decision.label} ${CLASS_EFFECT_OTHER.delete}. Run it only if you meant to.`
405
399
  : `Passport: your Autopilot rules ask before ${decision.label}. Run it only if you meant to.`;
406
400
  }
407
401
  export function denyMessage(decision, owner) {
package/dist/cliInit.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * `--json` without `--yes`, print the plan and change nothing.
11
11
  *
12
12
  * Every step reuses the command that already owns it (scan, login, the hook
13
- * installer, the server's connect plans and safety profile) in-process. Every
13
+ * installer, the server's connect plans and Autopilot presets) in-process. Every
14
14
  * step is skippable and idempotent, and state is read back from the machine and
15
15
  * the server, so a re-run, or a run after Ctrl-C, changes only what's missing.
16
16
  */
@@ -558,6 +558,11 @@ export async function init(args, runtime, deps = {}) {
558
558
  if (problem)
559
559
  return failure(problem, 1, "unsupported_node");
560
560
  ensureOneLinerRuntime();
561
+ // --agents, --lock, and --strict choose what a company rollout sets up.
562
+ const orgOnly = ["clients", "lock", "strict"].find((flag) => flag === "clients" ? value(args, flag) !== undefined : bool(args, flag));
563
+ if (orgOnly) {
564
+ return failure(`--${orgOnly === "clients" ? "agents" : orgOnly} goes with --org <enrollment key>.`, 6, "usage");
565
+ }
561
566
  const json = bool(args, "json");
562
567
  const yes = bool(args, "yes");
563
568
  const dryRun = bool(args, "dry-run") || (json && !yes);
package/dist/cliLogout.js CHANGED
@@ -10,7 +10,7 @@ import { listOf } from "./initUi.js";
10
10
  import { paint, say, termOf } from "./term.js";
11
11
  export async function logout(args, runtime) {
12
12
  if (runtime.env.PASSPORT_AGENT_KEY || runtime.env.PASSPORT_ENDPOINT) {
13
- return failure("Agent-key authentication is not stored locally and cannot be logged out. Unset the environment variables instead.", 6, "usage");
13
+ return failure("Agent-token authentication is not stored locally and cannot be logged out. Unset the environment variables instead.", 6, "usage");
14
14
  }
15
15
  // Nothing saved here: signing out is already done.
16
16
  if (!Object.keys(readCreds()).length && value(args, "profile") === undefined) {