passport-bridge 0.36.0 → 0.38.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.
- package/README.md +61 -175
- package/dist/cliArgs.d.ts +3 -2
- package/dist/cliArgs.js +17 -60
- package/dist/cliClient.d.ts +1 -1
- package/dist/cliClient.js +1 -1
- package/dist/cliCodexTrust.d.ts +1 -1
- package/dist/cliConnections.d.ts +40 -0
- package/dist/cliConnections.js +125 -0
- package/dist/cliDescribe.js +8 -1
- package/dist/cliExec.d.ts +12 -21
- package/dist/cliExec.js +85 -234
- package/dist/cliExecGuard.js +1 -1
- package/dist/cliGuardHealth.d.ts +46 -2
- package/dist/cliGuardHealth.js +108 -1
- package/dist/cliHook.d.ts +12 -14
- package/dist/cliHook.js +139 -324
- package/dist/cliHookAfter.d.ts +5 -14
- package/dist/cliHookAfter.js +16 -40
- package/dist/cliHookClassify.d.ts +0 -5
- package/dist/cliHookClients.d.ts +2 -2
- package/dist/cliHookDecide.d.ts +33 -88
- package/dist/cliHookDecide.js +124 -430
- package/dist/cliHookDeliver.d.ts +14 -79
- package/dist/cliHookDeliver.js +50 -202
- package/dist/cliHookExtras.d.ts +2 -22
- package/dist/cliHookExtras.js +2 -36
- package/dist/cliHookGuard.d.ts +11 -165
- package/dist/cliHookGuard.js +23 -525
- package/dist/cliHookInstall.d.ts +2 -4
- package/dist/cliHookInstall.js +19 -43
- package/dist/cliHookLifecycle.d.ts +2 -7
- package/dist/cliHookLifecycle.js +5 -33
- package/dist/cliHookLinks.js +30 -2
- package/dist/cliHookLocal.d.ts +4 -8
- package/dist/cliHookLocal.js +36 -36
- package/dist/cliHookMode.d.ts +2 -3
- package/dist/cliHookMode.js +2 -3
- package/dist/cliHookRedact.d.ts +2 -2
- package/dist/cliHookRedact.js +2 -2
- package/dist/cliHookRewrite.d.ts +37 -58
- package/dist/cliHookRewrite.js +86 -149
- package/dist/cliHookStatus.d.ts +2 -2
- package/dist/cliHookStatus.js +8 -16
- package/dist/cliHookVendorsMore.d.ts +2 -2
- package/dist/cliHookVendorsMore.js +2 -2
- package/dist/cliInit.d.ts +2 -7
- package/dist/cliInit.js +6 -21
- package/dist/cliKeysShim.d.ts +1 -1
- package/dist/cliLogin.js +4 -4
- package/dist/cliLogout.js +4 -9
- package/dist/cliMain.js +17 -56
- package/dist/cliMemberCall.d.ts +5 -13
- package/dist/cliMemberCall.js +0 -6
- package/dist/cliOutput.js +16 -95
- package/dist/cliResult.js +6 -2
- package/dist/cliScriptRead.d.ts +2 -1
- package/dist/cliScriptRead.js +4 -6
- package/dist/cliSetupOrg.js +0 -11
- package/dist/cliStatus.d.ts +17 -11
- package/dist/cliStatus.js +41 -149
- package/dist/completion.js +3 -23
- package/dist/connectorKit/manifests/github.generated.js +2 -2
- package/dist/controlPlane.generated.d.ts +99 -17
- package/dist/controlPlane.generated.js +35 -18
- package/dist/controlPlaneBasic.generated.d.ts +78 -0
- package/dist/controlPlaneBasic.generated.js +156 -0
- package/dist/controlPlaneCli.d.ts +14 -0
- package/dist/controlPlaneCli.js +55 -0
- package/dist/controlPlaneExec.d.ts +2 -3
- package/dist/controlPlaneExec.js +4 -8
- package/dist/controlPlaneGuard.js +2 -4
- package/dist/controlPlaneModel.generated.d.ts +10 -1
- package/dist/controlPlaneModel.generated.js +12 -0
- package/dist/controlPlaneRailwayGuard.d.ts +1 -1
- package/dist/controlPlaneRailwayGuard.js +3 -5
- package/dist/controlPlaneSupabase.js +2 -3
- package/dist/cpCli.d.ts +47 -0
- package/dist/cpCli.js +174 -0
- package/dist/cpRefusal.d.ts +15 -0
- package/dist/cpRefusal.js +14 -0
- package/dist/doctor.js +0 -14
- package/dist/execLinks.d.ts +0 -3
- package/dist/execLinks.js +0 -4
- package/dist/fastPathFlag.d.ts +11 -18
- package/dist/fastPathFlag.js +31 -37
- package/dist/hookFastPath.d.ts +9 -41
- package/dist/hookFastPath.js +12 -200
- package/dist/hookMain.js +1 -1
- package/dist/hookPromptFast.d.ts +9 -13
- package/dist/hookPromptFast.js +10 -38
- package/dist/hookRepair.js +1 -1
- package/dist/initAppsStep.d.ts +1 -1
- package/dist/initAppsStep.js +3 -2
- package/dist/initLocalSteps.js +1 -2
- package/dist/initOutro.js +10 -12
- package/dist/initPlan.d.ts +0 -3
- package/dist/initPlan.js +0 -27
- package/dist/initState.d.ts +0 -26
- package/dist/launcherFastAnswers.d.ts +5 -24
- package/dist/launcherFastAnswers.js +4 -22
- package/dist/launcherFastPath.d.ts +9 -13
- package/dist/launcherFastPath.js +13 -59
- package/dist/localCommands.js +8 -2
- package/dist/localIrreversible.d.ts +12 -0
- package/dist/localIrreversible.js +42 -0
- package/dist/nativeUnsync.d.ts +33 -0
- package/dist/nativeUnsync.js +175 -0
- package/dist/pluginPin.d.ts +1 -1
- package/dist/pluginPin.js +1 -1
- package/dist/railwayDecisions.d.ts +1 -1
- package/dist/railwayDecisions.js +7 -5
- package/dist/railwayLink.d.ts +31 -0
- package/dist/railwayLink.js +79 -0
- package/dist/term.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webLinks.d.ts +7 -10
- package/dist/webLinks.js +14 -40
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/approvalLines.d.ts +0 -17
- package/dist/approvalLines.js +0 -40
- package/dist/approvalNote.d.ts +0 -20
- package/dist/approvalNote.js +0 -33
- package/dist/approvalNotice.d.ts +0 -73
- package/dist/approvalNotice.js +0 -211
- package/dist/cliActions.d.ts +0 -31
- package/dist/cliActions.js +0 -383
- package/dist/cliActionsLocal.d.ts +0 -38
- package/dist/cliActionsLocal.js +0 -186
- package/dist/cliAllowances.d.ts +0 -47
- package/dist/cliAllowances.js +0 -89
- package/dist/cliAnswered.d.ts +0 -63
- package/dist/cliAnswered.js +0 -282
- package/dist/cliAutopilot.d.ts +0 -63
- package/dist/cliAutopilot.js +0 -374
- package/dist/cliAutopilotPolicy.d.ts +0 -317
- package/dist/cliAutopilotPolicy.js +0 -411
- package/dist/cliEnv.d.ts +0 -47
- package/dist/cliEnv.js +0 -168
- package/dist/cliGuardState.d.ts +0 -92
- package/dist/cliGuardState.js +0 -174
- package/dist/cliHookAllowance.d.ts +0 -22
- package/dist/cliHookAllowance.js +0 -34
- package/dist/cliHookAudit.d.ts +0 -44
- package/dist/cliHookAudit.js +0 -59
- package/dist/cliHookDecideRequest.d.ts +0 -48
- package/dist/cliHookDecideRequest.js +0 -69
- package/dist/cliHookEarly.d.ts +0 -10
- package/dist/cliHookEarly.js +0 -8
- package/dist/cliHookEnvironment.d.ts +0 -61
- package/dist/cliHookEnvironment.js +0 -303
- package/dist/cliHookHold.d.ts +0 -91
- package/dist/cliHookHold.js +0 -168
- package/dist/cliHookIac.d.ts +0 -32
- package/dist/cliHookIac.js +0 -53
- package/dist/cliHookKey.d.ts +0 -25
- package/dist/cliHookKey.js +0 -160
- package/dist/cliHookLease.d.ts +0 -78
- package/dist/cliHookLease.js +0 -224
- package/dist/cliHookNotice.d.ts +0 -30
- package/dist/cliHookNotice.js +0 -93
- package/dist/cliHookPairing.d.ts +0 -9
- package/dist/cliHookPairing.js +0 -42
- package/dist/cliHookPending.d.ts +0 -31
- package/dist/cliHookPending.js +0 -141
- package/dist/cliHookPlan.d.ts +0 -35
- package/dist/cliHookPlan.js +0 -34
- package/dist/cliHookReach.d.ts +0 -31
- package/dist/cliHookReach.js +0 -84
- package/dist/cliHookRepo.d.ts +0 -20
- package/dist/cliHookRepo.js +0 -57
- package/dist/cliHookServerDecision.d.ts +0 -30
- package/dist/cliHookServerDecision.js +0 -85
- package/dist/cliHookSessionEnd.d.ts +0 -90
- package/dist/cliHookSessionEnd.js +0 -275
- package/dist/cliHookStep.d.ts +0 -19
- package/dist/cliHookStep.js +0 -76
- package/dist/cliHookStop.d.ts +0 -37
- package/dist/cliHookStop.js +0 -59
- package/dist/cliHookStuck.d.ts +0 -42
- package/dist/cliHookStuck.js +0 -69
- package/dist/cliLoosening.d.ts +0 -56
- package/dist/cliLoosening.js +0 -195
- package/dist/cliPolicy.d.ts +0 -85
- package/dist/cliPolicy.js +0 -259
- package/dist/cliPolicyRefresh.d.ts +0 -7
- package/dist/cliPolicyRefresh.js +0 -20
- package/dist/cliPolicyV2.d.ts +0 -18
- package/dist/cliPolicyV2.js +0 -678
- package/dist/cliReceipt.d.ts +0 -18
- package/dist/cliReceipt.js +0 -75
- package/dist/cliRequest.d.ts +0 -30
- package/dist/cliRequest.js +0 -97
- package/dist/cliRequestTask.d.ts +0 -22
- package/dist/cliRequestTask.js +0 -87
- package/dist/cliRestoreRequests.d.ts +0 -57
- package/dist/cliRestoreRequests.js +0 -186
- package/dist/cliSeen.d.ts +0 -111
- package/dist/cliSeen.js +0 -358
- package/dist/cliSessions.d.ts +0 -18
- package/dist/cliSessions.js +0 -42
- package/dist/cliSessionsJson.d.ts +0 -99
- package/dist/cliSessionsJson.js +0 -201
- package/dist/cliSessionsRender.d.ts +0 -18
- package/dist/cliSessionsRender.js +0 -209
- package/dist/cliSetup.d.ts +0 -10
- package/dist/cliSetup.js +0 -161
- package/dist/cliSpeed.d.ts +0 -106
- package/dist/cliSpeed.js +0 -340
- package/dist/cliStatusGuard.d.ts +0 -42
- package/dist/cliStatusGuard.js +0 -90
- package/dist/cliSync.d.ts +0 -14
- package/dist/cliSync.js +0 -65
- package/dist/cliUndo.d.ts +0 -49
- package/dist/cliUndo.js +0 -304
- package/dist/cliUndoLocal.d.ts +0 -27
- package/dist/cliUndoLocal.js +0 -105
- package/dist/cliUsage.d.ts +0 -71
- package/dist/cliUsage.js +0 -333
- package/dist/cliWait.d.ts +0 -14
- package/dist/cliWait.js +0 -203
- package/dist/cliWhere.d.ts +0 -50
- package/dist/cliWhere.js +0 -120
- package/dist/cliWork.d.ts +0 -123
- package/dist/cliWork.js +0 -584
- package/dist/cliWorkWords.d.ts +0 -122
- package/dist/cliWorkWords.js +0 -361
- package/dist/envDatabase.d.ts +0 -28
- package/dist/envDatabase.js +0 -166
- package/dist/envLinksAzure.d.ts +0 -34
- package/dist/envLinksAzure.js +0 -179
- package/dist/envLinksCloud.d.ts +0 -44
- package/dist/envLinksCloud.js +0 -243
- package/dist/envLinksGitlab.d.ts +0 -66
- package/dist/envLinksGitlab.js +0 -352
- package/dist/envLinksHosting.d.ts +0 -55
- package/dist/envLinksHosting.js +0 -528
- package/dist/envLinksIac.d.ts +0 -62
- package/dist/envLinksIac.js +0 -267
- package/dist/envResolve.d.ts +0 -63
- package/dist/envResolve.js +0 -288
- package/dist/envTarget.d.ts +0 -61
- package/dist/envTarget.js +0 -59
- package/dist/execBackupAzure.d.ts +0 -14
- package/dist/execBackupAzure.js +0 -49
- package/dist/execBackupGoogle.d.ts +0 -24
- package/dist/execBackupGoogle.js +0 -141
- package/dist/execBackupLine.d.ts +0 -7
- package/dist/execBackupLine.js +0 -16
- package/dist/execBackupTarget.d.ts +0 -39
- package/dist/execBackupTarget.js +0 -262
- package/dist/execLease.d.ts +0 -5
- package/dist/execLease.js +0 -38
- package/dist/execPlan.d.ts +0 -20
- package/dist/execPlan.js +0 -38
- package/dist/gitBackup.d.ts +0 -111
- package/dist/gitBackup.js +0 -391
- package/dist/gitSnapshot.d.ts +0 -82
- package/dist/gitSnapshot.js +0 -478
- package/dist/holdNotice.d.ts +0 -23
- package/dist/holdNotice.js +0 -79
- package/dist/iacPlan.d.ts +0 -75
- package/dist/iacPlan.js +0 -384
- package/dist/iacPlanRead.d.ts +0 -88
- package/dist/iacPlanRead.js +0 -341
- package/dist/iacPlanStore.d.ts +0 -43
- package/dist/iacPlanStore.js +0 -139
- package/dist/initAutopilotStep.d.ts +0 -37
- package/dist/initAutopilotStep.js +0 -399
- package/dist/kubeBackup.d.ts +0 -78
- package/dist/kubeBackup.js +0 -261
- package/dist/kubeRollout.d.ts +0 -18
- package/dist/kubeRollout.js +0 -2
- package/dist/kubeWatch.d.ts +0 -138
- package/dist/kubeWatch.js +0 -513
- package/dist/leaseCommands.d.ts +0 -42
- package/dist/leaseCommands.js +0 -251
- package/dist/localBackups.d.ts +0 -112
- package/dist/localBackups.js +0 -276
- package/dist/localBackupsGate.d.ts +0 -33
- package/dist/localBackupsGate.js +0 -52
- package/dist/localRestore.d.ts +0 -42
- package/dist/localRestore.js +0 -107
- package/dist/localTrash.d.ts +0 -97
- package/dist/localTrash.js +0 -394
- package/dist/managedSkills.d.ts +0 -7
- package/dist/managedSkills.js +0 -268
- package/dist/managedSkillsContract.generated.d.ts +0 -82
- package/dist/managedSkillsContract.generated.js +0 -32
- package/dist/managedSkillsFiles.d.ts +0 -23
- package/dist/managedSkillsFiles.js +0 -215
- package/dist/managedSkillsValidation.d.ts +0 -13
- package/dist/managedSkillsValidation.js +0 -117
- package/dist/nativeSync.d.ts +0 -89
- package/dist/nativeSync.js +0 -376
- package/dist/recommendedPolicy.d.ts +0 -13
- package/dist/recommendedPolicy.generated.d.ts +0 -1
- package/dist/recommendedPolicy.generated.js +0 -1589
- package/dist/recommendedPolicy.js +0 -6
- package/dist/regenerable.d.ts +0 -48
- package/dist/regenerable.js +0 -312
- package/dist/repoRules.d.ts +0 -45
- package/dist/repoRules.js +0 -179
- package/dist/sessionBrief.d.ts +0 -28
- package/dist/sessionBrief.js +0 -92
- package/dist/sessionCreated.d.ts +0 -24
- package/dist/sessionCreated.js +0 -80
- package/dist/waitingLine.d.ts +0 -38
- package/dist/waitingLine.js +0 -79
- package/dist/watchNotice.d.ts +0 -70
- package/dist/watchNotice.js +0 -246
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ New here? One command sets everything up:
|
|
|
23
23
|
npx passport-bridge@latest init
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
It scans for keys your agents can reach, signs you in (or up), connects the apps it found,
|
|
26
|
+
It scans for keys your agents can reach, signs you in (or up), connects the apps it found, adds Passport to your agents, and turns on the guard. See [Set up with init](#set-up-with-init).
|
|
27
27
|
|
|
28
28
|
Or step by step:
|
|
29
29
|
|
|
@@ -45,7 +45,7 @@ passport run github_search_issues '{"query":"SSO"}'
|
|
|
45
45
|
- Remote servers must use HTTPS. Plain HTTP works only on `localhost`, `127.0.0.0/8`, or `::1`.
|
|
46
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.
|
|
47
47
|
- A profile saved by `passport-bridge login` belongs to an agent, not the CLI. `status`, `doctor`, and every gateway command say so (`This sign-in was made for an agent by passport-bridge login, so Passport CLI can't use it.`, exit 2, cause `agent_sign_in`) and name `passport login` (with `--cloud <origin>` off passportmcp.com); the agent keeps its own sign-in.
|
|
48
|
-
- `passport help [command]` documents every option. `passport help` groups commands by what you're doing (Get started, Daily,
|
|
48
|
+
- `passport help [command]` documents every option. `passport help` groups commands by what you're doing (Get started, Daily, Troubleshoot); `passport help --all` adds the ones for scripts and integrations (`session`, `access`, `resources`, `prompts`, `kube-credential`, `git-credential`, `completion`), which run either way. For health, `status` is your whole setup (start there), `doctor` says why a command fails, and `ready` runs `doctor`'s checks for scripts and CI. `help`, `version`, `profiles`, `use`, and `completion` work offline.
|
|
49
49
|
|
|
50
50
|
## Commands
|
|
51
51
|
|
|
@@ -56,24 +56,18 @@ passport run github_search_issues '{"query":"SSO"}'
|
|
|
56
56
|
| `login` | Browser sign-in or sign-up (or device sign-in with `--workspace`); saves a rotating CLI credential and makes the profile active. |
|
|
57
57
|
| `logout` | Revoke the credential and always remove the local profile (warns if revocation fails). |
|
|
58
58
|
| `profiles` / `use <name>` | List stored profiles / select the active one. Offline. |
|
|
59
|
-
| `status` | Your setup on one screen: you, this computer, each agent's guard and its fix;
|
|
59
|
+
| `status` | Your setup on one screen: you, this computer, each agent's guard and its fix; apps; keys in Passport; the CLI version. |
|
|
60
60
|
| `doctor` | Check Node, how your sign-in is stored, the server, your sign-in, and that this CLI and the server match. Exit 1 on a failed check, 2 when not signed in. |
|
|
61
61
|
| `ready` | Readiness preflight for automation; gate on its `ready` field and exit code. |
|
|
62
62
|
| `search [query] [--app <key>]` | Search permitted tools. Empty query lists the full catalog. |
|
|
63
63
|
| `describe <tool>` | One exact definition with its full parameter schema. |
|
|
64
64
|
| `run <tool> [json]` | Run a tool through Passport governance. |
|
|
65
65
|
| `connect [app...] [--alias <name>] [--open] [--wait <s>]` | Show member sign-in links and optionally wait for completion. |
|
|
66
|
-
| `
|
|
66
|
+
| `connections [app] [--no-open]` | What's connected for you and what still needs you, then your connections page in the browser. See [Your connections](#your-connections). |
|
|
67
67
|
| `resources [uri] [--out <file>]` | List or read MCP resources. |
|
|
68
68
|
| `prompts [name] [--set k=v] [--out <file>]` | List or get MCP prompts. |
|
|
69
69
|
| `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. |
|
|
70
|
-
| `hook` | Records the CLIs agents run and, with `--guard`, decides each one before it runs from your
|
|
71
|
-
| `wait <approval-id> [--timeout <s>]` | Wait for a person to decide an approval request, until they do or it expires. Agents run it in the background. |
|
|
72
|
-
| `rules test "<command>" [--environment <kind>]` | What Autopilot decides for a command, why, and which environment it acts on. |
|
|
73
|
-
| `sessions [--all\|--running\|--production-changes] [--project <name>] [--pr <n>] [--since <when>]`, `sessions <id>` | Your agents' work items by project, Notable first; the Production writes ledger; or one session's outcome and recent actions. |
|
|
74
|
-
| `changes [--env production] [--since <when>] [--until <date>]` | What your agents changed in Production, one row each, grouped by app and newest first. |
|
|
75
|
-
| `undo <action-id>\|--last [--option <id>] [--yes]` | Undo an action Passport took a backup before, within 7 days. See [Undo](#undo). |
|
|
76
|
-
| `setup` | Install and maintain assigned team workflows as managed skills. |
|
|
70
|
+
| `hook` | Records the CLIs agents run and, with `--guard`, decides each one before it runs from your rules (`install`, `uninstall`, `status`). |
|
|
77
71
|
| `session` | Run NDJSON commands over one authenticated MCP session. |
|
|
78
72
|
| `access` | Signed managed access: `keygen`, `actions`, `run`, `invoke`, `status`, `cancel`. |
|
|
79
73
|
| `update`, `update check`, `update off\|on` | Install the exact version Passport names, check what runs here, or turn automatic updates off on this computer. See [Updates](#updates). |
|
|
@@ -105,19 +99,17 @@ passport connect github --wait 120
|
|
|
105
99
|
- The CLI never retries after a network failure or timeout, since the outcome is unknown.
|
|
106
100
|
- `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.
|
|
107
101
|
|
|
108
|
-
###
|
|
102
|
+
### Your connections
|
|
109
103
|
|
|
110
104
|
```sh
|
|
111
|
-
passport
|
|
112
|
-
passport
|
|
105
|
+
passport connections
|
|
106
|
+
passport connections github
|
|
113
107
|
```
|
|
114
108
|
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
- `
|
|
119
|
-
|
|
120
|
-
**Task allowances and leases.** cli-policy v2 `allowances` lists the person's allowances in running hook sessions (the agent's own session id, the app's CLIs, class, environment); the guard applies a match after block rules and, before running a command one let through, checks `GET /api/my/cli/session` (300 ms, fail-open) that it wasn't revoked. With `leases: true`, a deploy or migration in Staging or Production takes a lease first (`POST /api/my/leases`, 400 ms, fail-open), holds Claude Code while another session has it, and releases it from the audit hook; `passport exec` renews a long command's lease every 5 minutes.
|
|
109
|
+
- Lists every app you're granted: `Connected as you`, `Needs connecting`, `Ready · connected by your company` (no sign-in of yours), or `Waiting on your admin`. Apps that need you come first; a named app comes before them.
|
|
110
|
+
- Then opens your connections page in the browser (`#cp/connections`), where Connect and Reconnect start your own sign-in with the app. `--no-open` and `--json` print the link instead. The link works for 10 minutes and never signs a browser in: it goes through your workspace's sign-in when the browser isn't signed in, and refuses a browser signed in as someone else.
|
|
111
|
+
- When the CLI or an agent is refused because an app needs connecting, the refusal names `passport connections <app>`; the MCP's `passport_manage_connections` returns the same page as `connectionsUrl`.
|
|
112
|
+
- `--json`: `{workspace,apps:[{app,name,status,connectedAs?}],needsYou,url?,expiresAt?,opened}`. Agent tokens have no connections page (exit 6, `member_profile_required`).
|
|
121
113
|
|
|
122
114
|
### Resources and prompts
|
|
123
115
|
|
|
@@ -154,28 +146,17 @@ npx passport-bridge@latest init --yes --move-keys # also move CLI keys into Pas
|
|
|
154
146
|
npx passport-bridge@latest init --yes --json # one summary object with each step's status and the plan
|
|
155
147
|
```
|
|
156
148
|
|
|
157
|
-
Plan, then apply. Init scans and signs in, then reads every step below without changing anything and shows one plan: **Plan** (what the recommended setup changes), **Edits** (every file it edits, each backed up first), **Done** (already set up), **Kept** (not changed, with how to change it later), and **You do
|
|
149
|
+
Plan, then apply. Init scans and signs in, then reads every step below without changing anything and shows one plan: **Plan** (what the recommended setup changes), **Edits** (every file it edits, each backed up first), **Done** (already set up), **Kept** (not changed, with how to change it later), and **You do**. Labels sit in one column, at least two spaces from their text. 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`).
|
|
158
150
|
|
|
159
|
-
|
|
151
|
+
Six steps, each reusing the command that owns it:
|
|
160
152
|
|
|
161
153
|
1. **Scan**: the same local scan as `passport scan`, as one summary line (`--verbose` prints the table).
|
|
162
154
|
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`.
|
|
163
155
|
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.
|
|
164
156
|
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.
|
|
165
|
-
5. **
|
|
166
|
-
6. **
|
|
167
|
-
|
|
168
|
-
8. **Autopilot**: how much agents can do on their own, per environment:
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
Autopilot Production Ask before writes
|
|
172
|
-
Staging Ask before deletes
|
|
173
|
-
Development Ask if irreversible
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
The plan shows them once. Step by step lists the three choices once, in the words Rules uses, then asks one short question per environment where a choice is left (`Staging (1 to 3) [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 at least "Ask before writes" 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 writes, deletes outside Development, and irreversible actions`. **Full autopilot** (every row runs, irreversible actions included) is turned on only in Rules on the web: init never offers it, skips rows already on it, and says `Full autopilot: nothing asks.` when every row is. A server without Autopilot gets no rules step (`Autopilot needs a newer Passport server.`); init never writes the retired safety profile.
|
|
177
|
-
|
|
178
|
-
What changes on disk, and how to undo it:
|
|
157
|
+
5. **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.
|
|
158
|
+
6. **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.
|
|
159
|
+
What changes on disk, and how to undo it:
|
|
179
160
|
|
|
180
161
|
| Where | What | Undo |
|
|
181
162
|
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
@@ -196,7 +177,7 @@ npx passport-bridge@latest init --org pek_example --yes # Jamf, Kandji,
|
|
|
196
177
|
npx passport-bridge@latest init --org pek_example --yes --agents claude-code,codex
|
|
197
178
|
```
|
|
198
179
|
|
|
199
|
-
`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
|
|
180
|
+
`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; `passport setup` without `--org` exits 6 and names `init --org`. 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:
|
|
200
181
|
|
|
201
182
|
```
|
|
202
183
|
Passport setup for passportmcp.com (enrollment pek_…mple)
|
|
@@ -215,21 +196,6 @@ sudo npx passport-bridge@latest init --org pek_example --yes --lock --strict #
|
|
|
215
196
|
|
|
216
197
|
`--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.
|
|
217
198
|
|
|
218
|
-
### Team workflows
|
|
219
|
-
|
|
220
|
-
Codex and Claude Code on macOS and Linux. Requires a member profile.
|
|
221
|
-
|
|
222
|
-
```sh
|
|
223
|
-
passport setup list
|
|
224
|
-
passport setup install <setup-id> <workflow-key> --agent codex # preview
|
|
225
|
-
passport setup install <setup-id> <workflow-key> --agent codex --apply
|
|
226
|
-
passport setup installed
|
|
227
|
-
passport setup rollback <skill-name> --apply
|
|
228
|
-
passport setup remove <skill-name> --apply
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
Changes preview unless `--apply` is passed. Personal edits are preserved. `installed`, `remove`, and `rollback` work offline. Installing a workflow never grants app permissions or provisions accounts.
|
|
232
|
-
|
|
233
199
|
### Shell hook
|
|
234
200
|
|
|
235
201
|
```sh
|
|
@@ -238,95 +204,36 @@ passport hook status
|
|
|
238
204
|
passport hook uninstall --agent claude-code --guard --apply # guard only
|
|
239
205
|
```
|
|
240
206
|
|
|
241
|
-
Two hooks per agent. `passport hook` runs after each shell command and records the vendor, a coarse verb
|
|
242
|
-
|
|
243
|
-
- **Allow** (Claude Code `permissionDecision: "allow"`, Cursor `permission: "allow"`) only when every part of the line is understood and allowed: vendor commands in `src/cliHookVendors.ts` read with confidence, and everyday commands (below). Substitutions, heredocs, variables in a path, unknown wrappers or environment prefixes, scripts, aliases, `make`, and programs Passport doesn't know mean no decision, so the agent's own permission rules apply. Codex can't receive allow; its own approvals apply (see `passport sync`).
|
|
244
|
-
- **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.
|
|
245
|
-
- Each reason names its cause in one line: `Passport: railway redeploy writes to Production. Approve to run it.` A write a safety pack raises says what it does and how it's decided: `Passport: railway variables --set writes to Production. Rules decide it like a delete. Approve to run it.` (`rules test` shows `Class: Write, decided like a Delete`), or `Blocked by a team rule: no deletes in Production. Ask an admin to run it, or request an exception in Passport.` (a cause that isn't a rule reads `Blocked by Passport: <cause>`).
|
|
246
|
-
|
|
247
|
-
**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.
|
|
248
|
-
|
|
249
|
-
**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 writes to 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.
|
|
250
|
-
|
|
251
|
-
**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 Writes; `rm`, `git clean -fd`, and `git reset --hard` are Deletes. Package installs (`npm install`, `pip install`, `brew install`) are Writes in Other apps. `git push` to the default branch (origin's HEAD, else `main`/`master`) is a Write in Production, to any other branch a Write 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 Writes 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 Write, 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 Write 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 write 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.
|
|
252
|
-
|
|
253
|
-
The environment comes from each vendor's own flags (`src/cliHookEnvironment.ts`): Railway `-e/--environment`, Wrangler and Sentry `-e/--env`, Vercel `--prod`/`--target` (a deploy without either is a preview), Supabase `--local`/`--linked`/`--project-ref` (`db reset` is local unless `--linked`), Stripe `--live` (test mode otherwise), `git push <remote> <branch>`, `psql` hosts (`localhost` is Development), fly and Heroku `-a/--app`, kubectl `--context`/`-n`, helm `--kube-context`/`-n`, AWS `--profile`, gcloud `--project`, plus any flags the server adds. Names follow Passport's rules (`prod|production|live|main` → Production, `stag|qa|uat|preview` → Staging, `dev|local|test|sandbox|feature|branch` → Development), and the workspace's own placement of a name wins. Anything else, or no flag at all (a linked project the hook can't see), counts as Production, and the reason says `Environment unknown, treated as Production.`
|
|
254
|
-
|
|
255
|
-
**Attended or unattended** (`src/cliHookMode.ts`). With a person at the keyboard, an ask is the agent's own prompt with Passport's reason, except an irreversible command outside a Full autopilot row (cli-policy v2 `fullAutopilot`; there irreversible runs, and an ask a rule makes stays in the agent's prompt): it is approved only in Passport, so the guard files the request and holds as below, and blocks with `Passport can't be reached. Irreversible commands need approval in Passport.` if Passport doesn't answer. With nobody there, the guard asks Passport instead (`POST /api/my/cli/decide`, inside the hook's budget): the server knows grants already given this session, every rule, and the workspace's environments. An allow from it runs the command (for example, a retry after approval); an ask becomes an approval request on the web and the person's phone, and the agent reads ``Waiting for approval from Ramish. Run `passport wait <id>` to wait, or continue with other work.`` If Passport can't answer in time, the local decision stands and the reason adds `Passport couldn't be reached, so this computer decided.` Signals, strongest first:
|
|
256
|
-
|
|
257
|
-
| Signal | Means |
|
|
258
|
-
| ------------------------------------------------------------------------------------------------- | --------------------------------------- |
|
|
259
|
-
| `PASSPORT_HOOK_MODE=attended\|unattended` | Override |
|
|
260
|
-
| Claude Code `CLAUDE_CODE_SESSION_ATTENDED` (`1`/`0`), passed to every hook | Attended / unattended |
|
|
261
|
-
| Hook input `permission_mode` `dontAsk` or `bypassPermissions` (Claude Code, Codex) | Unattended: prompts are suppressed |
|
|
262
|
-
| Cursor `is_background_agent: true` | Unattended: background and cloud agents |
|
|
263
|
-
| `CLAUDE_CODE_ENTRYPOINT` `sdk-cli` (`claude -p`), `sdk-ts`, `sdk-py`, `claude-code-github-action` | Unattended (older Claude Code builds) |
|
|
264
|
-
| `CI`, `GITHUB_ACTIONS`, `GITLAB_CI`, `BUILDKITE`, `CIRCLECI`, `JENKINS_URL`, `TF_BUILD` | Unattended |
|
|
207
|
+
Two hooks per agent. `passport hook` runs after each shell command and records the vendor, a coarse verb and a risk class in Activity (never the command line, its output, or your folder path). `passport hook guard` runs before each command and decides only through the control plane (`src/cliHookDecide.ts`, docs/design/control-plane.md):
|
|
265
208
|
|
|
266
|
-
|
|
209
|
+
- A consequential `gh`, `git push`, `railway` or `supabase` command on a platform your workspace connected goes to `POST /api/cp/decide` through the classifiers (`src/controlPlaneGuard.ts`, `src/controlPlaneRailwayGuard.ts`, `src/controlPlaneSupabase.ts`).
|
|
210
|
+
- A write or delete verb of a vendor CLI that is a basic platform for you (you hold a working key for it in Passport) goes to `POST /api/cp/decide/cli` with the verb only (`src/controlPlaneCli.ts`).
|
|
211
|
+
- A command that can't be undone on this computer (`rm -rf ~/`, `rm -rf /`, deleting the project folder, `chmod -R` of your home folder; `src/localIrreversible.ts`) goes to `POST /api/cp/decide/cli` as This computer (`cli:local`). It runs only when an admin allowed that kind of command (Always allow covers every computer); signed out, unreachable or unanswered, the guard refuses it here.
|
|
212
|
+
- A block refuses the command at once with Passport's own words; nothing waits for a person. Anything else gets no answer at all, so the agent's own permission rules apply (it may ask you). Unanswered in time, a platform's command runs as it would without Passport, and the after-hook tells Passport it ran.
|
|
267
213
|
|
|
268
|
-
|
|
214
|
+
What the guard asks about comes from `GET /api/cp/cli` (`src/cpCli.ts`), cached at `$PASSPORT_HOME/cp-cli/<profile>.json` (mode 600) and refreshed by `passport login`, `passport status`, and the hooks' detached flush when it is over an hour old.
|
|
269
215
|
|
|
270
|
-
|
|
216
|
+
**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`): it prints nothing, as the full guard would, and only while the cached `GET /api/cp/cli` is fresh (`cli-policy/fastpath2.ok`).
|
|
271
217
|
|
|
272
|
-
|
|
218
|
+
**Script reading** (`src/cliScriptRead.ts`, `src/cliScriptText.ts`). For the project's own code, `./x.sh`, `bash x.sh`, `source x.sh`, `make <targets>` and package scripts are read on this computer so what they run is recognized; never sent.
|
|
273
219
|
|
|
274
|
-
|
|
275
|
-
- Codex: the same events in `~/.codex/hooks.json` (`CODEX_HOME` honored). Codex sends every shell command as `tool_name: "Bash"` with the model's raw command string in `tool_input.command` (never shell-wrapped), so it is read exactly like Claude Code's; its `apply_patch` tool is a file edit, not a shell command, and isn't recorded. Codex supports deny only (an ask fails the hook open, and its allow rewrites commands), so an ask is a deny there that says why (`Codex can't ask from a hook, so Passport blocked it. Approve it in Passport or run it yourself.`), recorded as a block. With a member profile and Autopilot, it goes to Passport like an unattended ask: an approval request, then the waiting line. Trust the hooks in Codex's `/hooks`.
|
|
276
|
-
- Cursor: `beforeShellExecution`/`afterShellExecution` in `~/.cursor/hooks.json`. Cursor also imports Claude Code's hooks by default; that imported copy records nothing when Passport's own Cursor entry exists, so rows aren't doubled.
|
|
220
|
+
**Everyday commands** (`src/cliHookLocal.ts`, tables in `src/localCommands.ts`, `localTools.ts`, `localFiles.ts`, `localGit.ts`, `localNetwork.ts`) are classified by what they touch on this computer. The guard says nothing for them, except the ones that can't be undone.
|
|
277
221
|
|
|
278
|
-
|
|
222
|
+
- Claude Code: `PreToolUse`, plus `PostToolUse` and `PostToolUseFailure` (failed or interrupted calls, recorded as ran with a non-zero exit), in `~/.claude/settings.json` (`CLAUDE_CONFIG_DIR` honored).
|
|
223
|
+
- Codex: the same events in `~/.codex/hooks.json` (`CODEX_HOME` honored). Codex supports deny only, so it never gets the rewrite.
|
|
224
|
+
- Cursor: `beforeShellExecution`/`afterShellExecution` in `~/.cursor/hooks.json`. Cursor also imports Claude Code's hooks by default; that imported copy stands down when Passport's own Cursor entry is registered.
|
|
279
225
|
|
|
280
|
-
**
|
|
281
|
-
|
|
282
|
-
**Guard health** (`src/cliGuardHealth.ts`, states and fixes in `src/cliGuardState.ts`, a checked copy of `shared/guardContract.ts`). `passport hook status` and `passport status` show each agent's guard in the web's words, **On**, **Off**, **Outdated**, **Not trusted**, or **Locked**, and each problem's fix (on a terminal the command goes on its own `Run:` line): `passport hook install --agent <agent> --guard --apply`, `npx passport-bridge@latest init`, or `Open Codex → /hooks and trust Passport's hooks.` At most once a day (`$PASSPORT_HOME/guard/.<profile>.heartbeat`) the CLI sends `POST /api/my/guard-health` with `{cliVersion, launcherTarget?, clients: [{client, present, mode, guard, plugin, codexTrust?, locked?, disabledEnv?}]}`: flags only, never a command, path, or value. It goes from a guard run with at least 300 ms of its budget left (a hook's first one waits a day), from `passport exec`, and from `passport status`. Codex trust (`src/cliCodexTrust.ts`) compares `trusted_hash` in `~/.codex/config.toml` `[hooks.state."<hooks.json>:pre_tool_use:<group>:<handler>"]` with Codex's own hash of Passport's guard entry: SHA-256 of the sorted-key JSON of `{event_name, matcher?, hooks: [{type, command, timeout (600 when unset), async, statusMessage?, additionalContextLimit? (when not 2500)}]}`, as in openai/codex `hook_hash`/`version_for_toml`, checked against codex-cli 0.146.0's `hooks/list`. Missing is **Not trusted**, a different hash is **Not trusted** (modified), `enabled = false` is **Off**. **Locked** means managed settings hold Passport's guard: `/Library/Application Support/ClaudeCode/managed-settings.json` (and `managed-settings.d/`), `/etc/claude-code/…`, `/etc/codex/requirements.toml`, `/Library/Application Support/Cursor/hooks.json`, or `/etc/cursor/hooks.json` (`PASSPORT_MANAGED_ROOT` points tests elsewhere).
|
|
283
|
-
|
|
284
|
-
**Coverage** (`src/cliSeen.ts`). The guard counts every command it saw, per agent per day, one character per command in `$PASSPORT_HOME/seen/<profile>.<agent>.<day>.log` (an app's action, not checked, or neither), and Cursor's imported copy of Claude Code's hook doesn't count twice. Counts go in their own batches, at most every five minutes, as `seen: {batch, day, count, governed, opaque}` on `POST /api/my/cli-activity`, never inside a report that can expire. `passport status` prints `Rules could decide 82% of commands Passport saw this week · 1,204 not checked` and a link to those commands on Work (from a server before the buckets: `Checked 94% of commands Passport saw this week`).
|
|
285
|
-
|
|
286
|
-
**When Passport can't be reached.** Production fails closed (`src/cliHookReach.ts`): a write, delete, or irreversible command placed or assumed in Production never runs offline. A Production ask, attended too, goes to Passport within the budget; a Production write the rules would run checks `/healthz` first (at most `REACH_PROBE_MS`, 800 ms), skipped when Passport answered in the last `REACH_FRESH_MS` (60 s); only successes are remembered. Either way, no answer denies with `Passport couldn't be reached, so this Production write is blocked: run it again once Passport is back.` Reads and other environments never wait on it. Elsewhere a local run, block, or attended ask stands as decided. When the guard needs Passport (an unattended ask or Codex) and it doesn't answer within the budget, the environment's `offline` setting from cli-policy v2 decides: ask, block, or allow (ask everywhere by default). An ask nobody can answer (unattended, or Codex) blocks, a second-person action is always blocked, and allow never covers an irreversible action or an ask from a team floor, team or workspace rule, approver rule, or approved exception. A policy synced more than 7 days ago uses the default. The reason ends with one line saying why, such as `Nobody is here to approve it and Passport couldn't be reached, so it's blocked.`
|
|
287
|
-
|
|
288
|
-
**App access.** The person's pass for the app a `passport exec` CLI acts on (Railway for `railway`, GitHub for `gh`, and so on) comes with cli-policy v2 as `access`, one record per CLI whose app limits the person (an older server's `appAccess` map is read the same way). The guard applies it before any rule, and no rule or exception lifts it. No access blocks every command of that CLI with `You don't have access to Railway in Passport. Ask an admin: passport request railway --reason "<why>"` and, on the next line, a link to the app's Access tab; read-only blocks everything but reads and names `passport request railway --full --reason "<why>"`. `passport exec` says the same (exit 5, cause `no_access`, with `Access: <link>`). A CLI whose app isn't in the workspace keeps working from its key.
|
|
289
|
-
|
|
290
|
-
`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; Full autopilot rows come as `handsoff` plus `fullAutopilot`, so CLI 0.33 and older ask before irreversible there, and a malformed list counts as none); 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.
|
|
291
|
-
|
|
292
|
-
Token numbers (`src/cliUsage.ts`, 0.24.0+): Claude Code's SessionStart and SessionEnd hooks note the session's `transcript_path` under `$PASSPORT_HOME/usage/<profile>/`; the detached `passport hook flush` reads what each transcript (and its subagents' files) added since the last byte offset, bounded per run, and sends per-session, per-model token counts and model ids as `usage` batches. No message content is kept or sent. Only when cli-policy v2 carries `usage: true` (the workspace keeps them); `PASSPORT_TOKEN_USAGE=off` turns it off on one computer.
|
|
226
|
+
**Guard health** (`src/cliGuardHealth.ts`). `passport hook status` and `passport status` show each agent's guard (On · Off · Outdated · Not trusted · Partly set up · Locked) with its fix, and a guard run reports it to Passport at most once a day.
|
|
293
227
|
|
|
294
228
|
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`.
|
|
295
229
|
|
|
296
|
-
###
|
|
230
|
+
### Status
|
|
297
231
|
|
|
298
232
|
```sh
|
|
299
|
-
passport
|
|
300
|
-
passport rules test "rm -rf ~/"
|
|
301
|
-
passport wait apr_123
|
|
302
|
-
passport changes # Work: needs attention, working, waiting, done today
|
|
303
|
-
passport changes --since 7d --env production # History: a week of work that touched Production
|
|
304
|
-
passport tasks # the same list as passport changes
|
|
305
|
-
passport tasks ses_123 # one task (an agent session), action by action
|
|
306
|
-
passport sync # or: passport sync --remove
|
|
307
|
-
passport env # or: passport env set railway qa staging
|
|
308
|
-
passport where # or: passport where acme/api
|
|
309
|
-
passport actions add scripts/deploy.py --environment production --class write
|
|
310
|
-
passport actions sync # propose this repository's .passport/actions.toml
|
|
311
|
-
passport actions add --local # Not checked's local scripts here, as local work, once you confirm
|
|
233
|
+
passport status
|
|
312
234
|
```
|
|
313
235
|
|
|
314
|
-
- `
|
|
315
|
-
|
|
316
|
-
- `tasks` (also `sessions`) prints the same list as `changes`, so the two never disagree; its older flags still read (`--all` is `--history`, `--running` is Working now only, `--production-changes` is `--history --env production`). `tasks <id>` opens one task (an agent session): its outcome and latest actions with what they acted on.
|
|
317
|
-
|
|
318
|
-
- `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.
|
|
319
|
-
|
|
320
|
-
- `where` reads the Production map (`GET /api/my/where?project=owner/name`, the project from this folder's origin, else the folder; none outside a repository): what is Production for the repository and why, then every target it ships to with its place, and how many need one. Outside a repository it lists the workspace's Production; `--json` prints the server's answer. Agents get the same words from the read-only `passport_where` tool (found with `passport_search_tools`, run with `passport_call`).
|
|
321
|
-
|
|
322
|
-
- `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.
|
|
323
|
-
- `wait` long-polls `GET /api/my/approvals/<id>/wait` (30 s per request), after a short first look that names who decides, until a person decides or the request expires; `--timeout <s>` caps it. Agents run it as a background command and are woken when it exits. 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> (until it expires at 14:05).` 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 (once). Run the command again.`, or `… for this session. Matching commands in this session run without asking.` (exit 0). Declined: the person's note, cleaned and labelled, `Declined by Ramish. Their note: "Use staging first"` (exit 5, cause `approval_denied`). Expired: `Expired at 14:05 with no decision. Run the command again to ask again.` (exit 5, cause `approval_expired`). Still waiting at `--timeout`: exit 4 with the same command as `next`.
|
|
324
|
-
- `sessions` lists work items the way the Sessions page does (`GET /api/my/work-items`): a pull request or branch with every session on it rolled up, grouped by project (or, for app connections, by the apps they used). Each item has its agents, then one shape line: actions, active time, failed, confirmed Production writes, unplaced changes, asks with how they ended, blocked, data checks, undone, and the share Passport couldn't check. Notable items come first; the rest fold into `14 routine work items · 3,200 reads · nothing needed you`. `--all` lists every item, `--running` only those with a running session, and `--production-changes` prints the ledger (`GET /api/my/production-ledger`, 7 days unless `--since`): changes to confirmed Production by app and target, then the unplaced count with a link to set environments. `--project`, `--pr`, `--since` (`today`, `24h`, `7d`, `30d`, `90d`, or a date read in local time), and `--status running|ended` go to the server, which applies them to every session in the window, never to a loaded page. The CLI follows up to five pages and then links the rest. `--project <name>` on its own (no lens, `--pr`, or `--status`) opens with the web project page's summary (`GET /api/my/projects/<name>`): sessions and how many run, Environments (the repository's placement, then each platform its changes reached and how many were unplaced), the rules for the apps and scripts it uses, and its Production writes, all over the same window as `--since` (any time without it), then the work list; `--json` adds it as `project` (`{project,link,sinceTs,environments:[{appKey,appName,role,label,kind,source,reached,unplaced}],rules:[{id,kind,label,decision}],moreRules,production:{total,unplaced,apps},totals}`), and a server without the page prints the list alone. A work item with several sessions links to its own page (`#projects/<name>/work?branch=`). Every count the server sends carries its window (`window: {since, until, label}`); the CLI prints the label after the count (`16 work items · … · Last 7 days`) and keeps its own words for an older server. `sessions <id>` reads one session (`GET /api/my/agent-sessions/<id>`): its title, place, agent, and active time; the web page's summary strip (actions, shipped, Production, failed, asked, not checked, undo, data checks); and its 15 latest actions with what each acted on, where it landed, and how it ended. On a terminal parts wrap only between `·` and the timeline stacks when it doesn't fit; piped output never wraps and has no color.
|
|
325
|
-
- `changes` lists every write, delete, and irreversible action that ran on confirmed Production in the window (`GET /api/my/production-changes`), the list Sessions › Production writes shows: grouped by app, newest first, each with its time and command (and what it acted on), then the agent, the person, the pull request (else branch), Failed or Approved, and Undo available, Undone by, or Undo expired. Consecutive alike changes (same command, target, agent, person, repository, and branch) fold into one line, `git push → main ×28` with their span of times, unless one failed, was approved, or has an undo state; `--json` keeps every change. With changes from more than one repository, each line names its repository. Blocked and declined actions never reached Production and aren't listed; unplaced changes are one count with a link to set environments. `--since` takes `1h`, `6h`, `24h`, `7d` (the default), `30d`, `today`, or a date read in local time; `--until` a date; `--project`, `--pr`, `--app`, and `--agent` narrow on the server. `--env` accepts only `production` for now. When the window holds more than one read returns, it says so and links the web page. The deploy and error lanes are web-only.
|
|
326
|
-
- `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.
|
|
327
|
-
- `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 adds ~20 ms per action 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 Codex commands Passport synced, counted only when the hook's `permission_mode` would have prompted: `default`, or `acceptEdits` for anything but its filesystem commands; never bypass, don't-ask, plan, auto, or an agent that sends no mode) and which agents' allowlists are synced. The presets read as Rules names them (`Production Ask before writes`). Under them, your specific rules, counted and named as Rules lists them (`2 specific rules:` then `Run git push --delete · Production`), then one line per exception among them that lets something run your presets would ask about: `! 1 exception: git push --delete runs in Production without asking.` Counts are appended locally (`$PASSPORT_HOME/prompts-answered/`) and sent in batches at most every five minutes as `answered: {batch, count, basis: "would-ask"}` on `POST /api/my/cli-activity`; counts older CLIs kept in `answered/` are deleted, never sent. Status first adds any hook slots an upgrade left missing (`src/hookRepair.ts`, also from the hooks' flush and after any command; only for a person signed in on the computer, never with an agent key, a pinned endpoint, or in CI, and it keeps no marker: nothing is written unless a slot is missing) and says so; an agent still missing one reads `Partly set up` with what Passport can't see. The coverage line's "not checked" count is the one Work's To fix shows: named commands in the last 7 days.
|
|
328
|
-
- `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`. `actions add --local` (`src/cliActionsLocal.ts`) reads this repository's package scripts (the root's and its workspaces') the way the guard does and takes the ones on your Not checked list (`GET /api/my/coverage`) that run code Passport can't read, plus the files they run; it leaves out any whose name may reach a live system (deploy, release, migrate…) or whose readable part runs a vendor CLI or changes files outside the project, lists the rest, and after you confirm (`[y/N]`, or `--yes`) sends each as Write in Development. Without a terminal or `--yes` it only lists. A write, 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.
|
|
329
|
-
- `rules test`, `sessions`, `actions`, `sync`, and `where` need a member profile. `wait` also works for a cloud agent's agent token, on the approval its own `passport exec` opened.
|
|
236
|
+
- `status` is one screen, like `gh auth status`, with a label per row (`You` with the name you signed in as, `Computer`, `Guard`, `Apps`, `Keys`, `Typing`, `CLI`); under 60 columns each label gets its own row, and piped it never wraps. `Guard` lists each agent's guard on this computer (`✓ Claude Code On`, `! Codex Not trusted`) with its fix on the line under it. Status first adds any hook slots an upgrade left missing (`src/hookRepair.ts`, also from the hooks' flush and after any command; only for a person signed in on the computer, never with an agent key, a pinned endpoint, or in CI, and it keeps no marker: nothing is written unless a slot is missing) and says so; an agent still missing one reads `Partly set up` with what Passport can't see.
|
|
330
237
|
|
|
331
238
|
### Keys and passport exec
|
|
332
239
|
|
|
@@ -350,10 +257,9 @@ passport keys shim # the CLIs that run through Passport when you type
|
|
|
350
257
|
- `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]` (Enter keeps it; `--yes` moves them all; `keys move <cli>` only that CLI's), 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 types the CLI's name at a terminal (`Type railway to confirm, or press Enter to cancel:`); no flag does it, so an agent's script can never swap a key. 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 at a terminal (`--yes`, no terminal), both keys stay, and the line says `Replacing a key in Passport needs you at a terminal. Run passport keys move railway yourself.` The scan report sent afterwards carries provider counts only.
|
|
351
258
|
- `keys rotate <app>` (an app like `github` or `cloudflare`, or its CLI) replaces a key Passport holds. It needs a person at a terminal: without one, or with `--json`, it exits 6 and nothing is read or sent, and no flag answers for you. It reads `GET /api/my/keys` for the key and its rotation guide, prints where to make the new key (`Make a new Railway key at https://railway.com/account/tokens` and one step), asks `Paste the new Railway key (it won't be shown): ` with echo off (AWS: the id and secret on one line), and sends it once to `POST /api/my/keys/:id/rotate` with this computer's name. Passport checks it with one harmless read at the provider (Railway `me`, GitHub `/user`, Vercel `/v2/user`, Cloudflare token verify, Supabase projects, Stripe balance, AWS `GetCallerIdentity`, Neon `/users/me`, Fly.io `viewer`) before it swaps anything, in one locked update that refuses if the key changed meanwhile. A refused, unchecked, or unchanged key exits 1 with `Railway didn't accept that key. Your old key is unchanged.` (or the matching line). On success it prints `✓ Railway accepted the new key. Agents use it from now on.`, then `Now revoke the old key at Railway: <page>` and the step. Like every replace from the CLI, the old value stays restorable for seven days and the owner and admins get an alert with an Undo; **Done** in the web records the revoke. The value is never printed, logged, or in `--json`; the audit trail says who rotated which app's key, when, and from which computer.
|
|
352
259
|
- `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`).
|
|
353
|
-
-
|
|
354
|
-
- 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).
|
|
355
|
-
- 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
|
|
356
|
-
- 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.
|
|
260
|
+
- Nothing waits for a person: anything but an allow is refused at once with Passport's words (exit 5). `--wait` is accepted and ignored. For a vendor CLI that is a basic platform, exec asks `POST /api/cp/decide/cli` first.
|
|
261
|
+
- 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). In a chain, every other part must only read.
|
|
262
|
+
- 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 and the owner's keys are used.
|
|
357
263
|
|
|
358
264
|
### git through Passport
|
|
359
265
|
|
|
@@ -390,21 +296,6 @@ passport kube-credential --cluster eks:111122223333:us-east-1:acme-prod
|
|
|
390
296
|
- `setup` prints the `kubectl config set-credentials` and `set-context` lines for the context's EKS cluster; it never writes the kubeconfig.
|
|
391
297
|
- The guard places kube commands by cluster and namespace (`--context`/`--kube-context`, `--kubeconfig`, `-n`, then the kubeconfig: `src/kubeconfig.ts`), keyed `<cluster>/<namespace>` with the cluster an EKS ARN, a GKE name, or a digest of its server URL. Deleting a namespace, persistent volume or claim, or custom resource definition, and `delete --all`, are Irreversible in Production; `exec`, `cp`, `attach`, and `port-forward` are changes.
|
|
392
298
|
|
|
393
|
-
### Undo
|
|
394
|
-
|
|
395
|
-
```sh
|
|
396
|
-
passport undo act_123
|
|
397
|
-
passport undo --last --yes
|
|
398
|
-
passport undo --local
|
|
399
|
-
passport undo --local <id> --yes
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
- `--local` lists the backups the guard kept on this computer in the last 7 days (`bridge/src/localBackups.ts`): `rm` of project or home paths moved to a per-project trash (Claude Code: the guard rewrites the command to `passport hook trash`), work `git reset --hard`/`clean`/`checkout --`/`restore` threw away (a commit through a temporary index under `refs/passport/backups/<id>`), dropped stashes, and refs `git branch -d`/`tag -d`/`update-ref -d`/`push --delete`/`push --force` moved, and the manifest of a named `kubectl delete <kind> <name>…` (`kubectl get -o json` right before it runs, 2.5 s at most, cluster-set fields removed; namespaces, volumes, claims, resource definitions, and pods aren't backed up: `src/kubeBackup.ts`). With an id (8+ characters) it shows what comes back, asks, and puts it back (a manifest with `kubectl apply`); anything there now is replaced only after its own question (left as it is without a terminal). Exit 0 when everything is back, 1 when some of it was left. The audit row of such a command carries `backup: "taken"` and the backup's id, so the row in Passport says **Undo on** this computer with the exact command.
|
|
403
|
-
- **Send to** this computer in Passport queues a restore here. The next time you run `passport` in a terminal (or `passport undo --local`), it shows what comes back and asks; nothing is put back without that yes, never from the hook, a script, or `--yes`. Passport's row then says what happened.
|
|
404
|
-
|
|
405
|
-
- Shows what comes back and what won't, how old the backup is, and how long undo stays available, then asks `Undo it? [y/N]` (and which option, when there are several). Without a terminal it prints the preview and `passport undo <id> --yes`; `--option <id>` picks an option.
|
|
406
|
-
- Passport decides an undo from the CLI like a write in that environment. Asks first: exit 4 with the approval id; run `passport wait <id>`, then the undo again. Blocked or declined: exit 5. Done: exit 0, with each step (`✓`/`✗`). Partly done or failed: exit 1. Expired, already undone, or otherwise unavailable: exit 5 with the reason. No backup: exit 6. Needs a member profile.
|
|
407
|
-
|
|
408
299
|
### Persistent sessions
|
|
409
300
|
|
|
410
301
|
```sh
|
|
@@ -526,33 +417,28 @@ Questions follow one convention (`src/cliAsk.ts`), only on a terminal: `[Y/n]` f
|
|
|
526
417
|
|
|
527
418
|
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.
|
|
528
419
|
|
|
529
|
-
| Command | JSON value
|
|
530
|
-
| ---------------------- |
|
|
531
|
-
| `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}`
|
|
532
|
-
| `profiles` | `{profiles:[{name,active,client?}],active?}`
|
|
533
|
-
| `use` | `{profile,active:true}`
|
|
534
|
-
| `logout` | `{profile,removed,revoked,shimsRemoved?}`
|
|
535
|
-
| `status` | `{workspace,member,endpoint,auth,profile?,client,mcps,
|
|
536
|
-
| `
|
|
537
|
-
| `
|
|
538
|
-
| `
|
|
539
|
-
| `
|
|
540
|
-
| `
|
|
541
|
-
| `
|
|
542
|
-
| `
|
|
543
|
-
| `
|
|
544
|
-
| `
|
|
545
|
-
| `
|
|
546
|
-
| `
|
|
547
|
-
| `
|
|
548
|
-
| `
|
|
549
|
-
| `
|
|
550
|
-
| `
|
|
551
|
-
| `access` | `keygen`: algorithm, paths, public JWK; `actions`: `{actions}`; `run`/`cancel`: `{run}`; `invoke`: governed result; `status`: `{receipt}` |
|
|
552
|
-
| `update` | `{version,latest,requested,auto,install,outcome?,to?}`; `check` leaves out `outcome`; `off`/`on`: `{auto}`. A failed update is an error with `cause: "update_failed"` and a `hint`. |
|
|
553
|
-
| `completion` | `{shell,script}` |
|
|
554
|
-
| `help` | `{command,help}` |
|
|
555
|
-
| `version` | `{version,profileCount,profileSelected,selectionSource,next,endpoint?,profile?}` |
|
|
420
|
+
| Command | JSON value |
|
|
421
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
422
|
+
| `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}` |
|
|
423
|
+
| `profiles` | `{profiles:[{name,active,client?}],active?}` |
|
|
424
|
+
| `use` | `{profile,active:true}` |
|
|
425
|
+
| `logout` | `{profile,removed,revoked,shimsRemoved?}` |
|
|
426
|
+
| `status` | `{workspace,member,endpoint,auth,profile?,client,mcps,guard?:{agents,repaired?},next?,computer,keys?,keysOnThisComputer?,cli:{version},signedInAs?,shims?:[{vendor,command,state}]}` |
|
|
427
|
+
| `doctor` | `{version,ok,auth,profile?,profileCount,endpointOrigin?,server?,checks}`, also on failure |
|
|
428
|
+
| `ready` | `{ready,version,ok,auth,profile?,profileCount,endpointOrigin?,server?,checks}` |
|
|
429
|
+
| `search` | Gateway payload with `results` or `catalog`, and `note` |
|
|
430
|
+
| `describe` | Tool definition (`tool`, `parameters`) plus `name`/`inputSchema` aliases |
|
|
431
|
+
| `run` | Full governed MCP tool result, including `structuredContent` |
|
|
432
|
+
| `connect` | Gateway payload with `connections` and optional `connectAllUrl` |
|
|
433
|
+
| `resources`, `prompts` | MCP list, read, or get result |
|
|
434
|
+
| `discover` | `{snapshot,report,compliant}` (the old name of `scan`'s inventory step, for one release) |
|
|
435
|
+
| `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 |
|
|
436
|
+
| `session` | NDJSON `{id?,ok,exitCode,result?}` or `{id?,ok:false,error,cause,exitCode,...}` |
|
|
437
|
+
| `access` | `keygen`: algorithm, paths, public JWK; `actions`: `{actions}`; `run`/`cancel`: `{run}`; `invoke`: governed result; `status`: `{receipt}` |
|
|
438
|
+
| `update` | `{version,latest,requested,auto,install,outcome?,to?}`; `check` leaves out `outcome`; `off`/`on`: `{auto}`. A failed update is an error with `cause: "update_failed"` and a `hint`. |
|
|
439
|
+
| `completion` | `{shell,script}` |
|
|
440
|
+
| `help` | `{command,help}` |
|
|
441
|
+
| `version` | `{version,profileCount,profileSelected,selectionSource,next,endpoint?,profile?}` |
|
|
556
442
|
|
|
557
443
|
Errors: `{"error":"...","cause":"blocked","exitCode":5,"app":"github"}`, optionally with `approvalId`, `hint`, `profiles`, `next` (`argv` plus description), `remediation`, `retry`, `requiredInput`, or `connectUrl`.
|
|
558
444
|
|
|
@@ -562,8 +448,8 @@ Errors: `{"error":"...","cause":"blocked","exitCode":5,"app":"github"}`, optiona
|
|
|
562
448
|
| 1 | Network, timeout, server, or unsupported-content error. When Passport can't be reached: `Passport couldn't be reached at <host>. Check your connection and try again.` |
|
|
563
449
|
| 2 | Missing, expired, or revoked authentication |
|
|
564
450
|
| 3 | App needs member sign-in |
|
|
565
|
-
| 4 | Approval pending
|
|
566
|
-
| 5 | Policy, guardrail, selection, or approval denial
|
|
451
|
+
| 4 | Approval pending |
|
|
452
|
+
| 5 | Policy, guardrail, selection, or approval denial |
|
|
567
453
|
| 6 | Usage mistake: an unknown command, option, tool, or app (with the closest match when there is one) |
|
|
568
454
|
|
|
569
455
|
## MCP stdio bridge
|