@the-ai-company/cbio-node-runtime 1.63.3 → 1.63.6

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 (233) hide show
  1. package/README.md +48 -209
  2. package/dist/clients/agent/client.d.ts +18 -40
  3. package/dist/clients/agent/client.js +22 -109
  4. package/dist/clients/agent/client.js.map +1 -1
  5. package/dist/clients/agent/contracts.d.ts +1 -8
  6. package/dist/clients/agent/index.d.ts +1 -1
  7. package/dist/clients/owner/client.d.ts +2 -102
  8. package/dist/clients/owner/client.js +111 -266
  9. package/dist/clients/owner/client.js.map +1 -1
  10. package/dist/clients/owner/contracts.d.ts +37 -75
  11. package/dist/clients/owner/index.d.ts +2 -4
  12. package/dist/clients/owner/index.js +1 -2
  13. package/dist/clients/owner/index.js.map +1 -1
  14. package/dist/internal/id-factory.d.ts +0 -2
  15. package/dist/internal/id-factory.js +0 -6
  16. package/dist/internal/id-factory.js.map +1 -1
  17. package/dist/protocol/identity.d.ts +1 -1
  18. package/dist/protocol/identity.js +3 -3
  19. package/dist/protocol/identity.js.map +1 -1
  20. package/dist/public-types.d.ts +5 -14
  21. package/dist/public-types.js +1 -8
  22. package/dist/public-types.js.map +1 -1
  23. package/dist/runtime/bootstrap.d.ts +1 -3
  24. package/dist/runtime/bootstrap.js.map +1 -1
  25. package/dist/runtime/identity.d.ts +2 -2
  26. package/dist/runtime/identity.js +3 -5
  27. package/dist/runtime/identity.js.map +1 -1
  28. package/dist/runtime/index.d.ts +10 -12
  29. package/dist/runtime/index.js +7 -8
  30. package/dist/runtime/index.js.map +1 -1
  31. package/dist/runtime/owner-session.d.ts +7 -6
  32. package/dist/runtime/owner-session.js +5 -6
  33. package/dist/runtime/owner-session.js.map +1 -1
  34. package/dist/storage/fs.d.ts +3 -2
  35. package/dist/storage/fs.js +8 -5
  36. package/dist/storage/fs.js.map +1 -1
  37. package/dist/storage/prefix.d.ts +1 -0
  38. package/dist/storage/prefix.js +7 -0
  39. package/dist/storage/prefix.js.map +1 -1
  40. package/dist/storage/provider.d.ts +2 -0
  41. package/dist/vault-core/contracts.d.ts +95 -210
  42. package/dist/vault-core/contracts.js +8 -11
  43. package/dist/vault-core/contracts.js.map +1 -1
  44. package/dist/vault-core/core.d.ts +119 -62
  45. package/dist/vault-core/core.js +518 -1180
  46. package/dist/vault-core/core.js.map +1 -1
  47. package/dist/vault-core/defaults.d.ts +22 -44
  48. package/dist/vault-core/defaults.js +65 -234
  49. package/dist/vault-core/defaults.js.map +1 -1
  50. package/dist/vault-core/errors.d.ts +3 -2
  51. package/dist/vault-core/errors.js.map +1 -1
  52. package/dist/vault-core/index.d.ts +5 -5
  53. package/dist/vault-core/index.js +2 -2
  54. package/dist/vault-core/index.js.map +1 -1
  55. package/dist/vault-core/persistence.d.ts +72 -119
  56. package/dist/vault-core/persistence.js +310 -427
  57. package/dist/vault-core/persistence.js.map +1 -1
  58. package/dist/vault-core/ports.d.ts +19 -30
  59. package/dist/vault-core/read-policy.d.ts +3 -2
  60. package/dist/vault-core/read-policy.js.map +1 -1
  61. package/dist/vault-core/tool-metadata.js +2 -2
  62. package/dist/vault-core/tool-metadata.js.map +1 -1
  63. package/dist/vault-ingress/defaults.d.ts +4 -2
  64. package/dist/vault-ingress/defaults.js +14 -8
  65. package/dist/vault-ingress/defaults.js.map +1 -1
  66. package/dist/vault-ingress/index.d.ts +39 -119
  67. package/dist/vault-ingress/index.js +98 -456
  68. package/dist/vault-ingress/index.js.map +1 -1
  69. package/dist/vault-ingress/remote-transport.d.ts +5 -3
  70. package/dist/vault-ingress/remote-transport.js +8 -28
  71. package/dist/vault-ingress/remote-transport.js.map +1 -1
  72. package/docs/ARCHITECTURE.md +39 -22
  73. package/docs/CUSTODY_MODEL.md +1 -1
  74. package/docs/IDENTITY_MODEL.md +5 -5
  75. package/docs/MIGRATION-1.51.md +19 -19
  76. package/docs/MIGRATION-1.65.md +87 -0
  77. package/docs/PROCESS_ISOLATION.md +2 -2
  78. package/docs/REFERENCE.md +42 -224
  79. package/docs/api/README.md +48 -30
  80. package/docs/api/classes/IdentityError.md +1 -1
  81. package/docs/api/classes/OwnerClientError.md +1 -1
  82. package/docs/api/classes/PersistentVaultAgentIdentityRegistry.md +89 -0
  83. package/docs/api/classes/PersistentVaultAgentSecretGrantRegistry.md +125 -0
  84. package/docs/api/classes/PersistentVaultAuditLog.md +65 -0
  85. package/docs/api/classes/PersistentVaultSecretCustody.md +93 -0
  86. package/docs/api/classes/PersistentVaultSecretDestinationGrantRegistry.md +125 -0
  87. package/docs/api/classes/PersistentVaultSecretRepository.md +127 -0
  88. package/docs/api/classes/VaultCore.md +264 -237
  89. package/docs/api/classes/VaultCoreError.md +3 -3
  90. package/docs/api/enumerations/AuditAction.md +143 -0
  91. package/docs/api/enumerations/AuditOutcome.md +35 -0
  92. package/docs/api/enumerations/DispatchStatus.md +35 -0
  93. package/docs/api/enumerations/IdentityErrorCode.md +1 -1
  94. package/docs/api/enumerations/OwnerClientErrorCode.md +1 -1
  95. package/docs/api/functions/createAgentClient.md +1 -15
  96. package/docs/api/functions/createIdentity.md +2 -2
  97. package/docs/api/functions/createOwnerClient.md +17 -0
  98. package/docs/api/functions/createOwnerSession.md +1 -1
  99. package/docs/api/functions/createPersistentVaultCoreDependencies.md +4 -4
  100. package/docs/api/functions/createVault.md +1 -1
  101. package/docs/api/functions/createVaultCore.md +1 -1
  102. package/docs/api/functions/createVaultCoreDependencies.md +1 -1
  103. package/docs/api/functions/createVaultService.md +5 -13
  104. package/docs/api/functions/createWorkspaceStorage.md +1 -1
  105. package/docs/api/functions/deriveRootAgentId.md +17 -0
  106. package/docs/api/functions/deriveVaultWorkingKeyFromPassword.md +1 -1
  107. package/docs/api/functions/getDefaultWorkspaceDir.md +1 -1
  108. package/docs/api/functions/handleVaultAgentControlHttp.md +2 -2
  109. package/docs/api/functions/handleVaultHttpDispatch.md +2 -2
  110. package/docs/api/functions/initializeVaultCustody.md +7 -3
  111. package/docs/api/functions/listVaults.md +1 -1
  112. package/docs/api/functions/readVaultProfile.md +1 -1
  113. package/docs/api/functions/recoverVault.md +1 -1
  114. package/docs/api/functions/recoverVaultWorkingKey.md +4 -8
  115. package/docs/api/functions/restoreIdentity.md +1 -1
  116. package/docs/api/functions/updateVaultMetadata.md +1 -1
  117. package/docs/api/functions/writeVaultProfile.md +1 -1
  118. package/docs/api/interfaces/AgentClient.md +20 -59
  119. package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
  120. package/docs/api/interfaces/AgentDispatchTransport.md +12 -44
  121. package/docs/api/interfaces/AgentIdentity.md +3 -3
  122. package/docs/api/interfaces/AgentIdentityRecord.md +47 -0
  123. package/docs/api/interfaces/AgentRequestResult.md +35 -0
  124. package/docs/api/interfaces/AgentRuntimeManifest.md +55 -0
  125. package/docs/api/interfaces/AgentSecretGrant.md +41 -0
  126. package/docs/api/interfaces/AgentSigner.md +1 -1
  127. package/docs/api/interfaces/AgentVisibleRequestRecord.md +53 -0
  128. package/docs/api/interfaces/AgentVisibleSecretRecord.md +65 -0
  129. package/docs/api/interfaces/AuditEntry.md +83 -0
  130. package/docs/api/interfaces/CbioRuntime.md +13 -154
  131. package/docs/api/interfaces/CreateAgentClientOptions.md +4 -10
  132. package/docs/api/interfaces/CreateIdentityOptions.md +1 -1
  133. package/docs/api/interfaces/{CreateVaultClientOptions.md → CreateOwnerClientOptions.md} +9 -11
  134. package/docs/api/interfaces/CreateOwnerSessionOptions.md +3 -121
  135. package/docs/api/interfaces/CreatePersistentVaultCoreDependenciesOptions.md +3 -131
  136. package/docs/api/interfaces/CreateVaultOptions.md +1 -125
  137. package/docs/api/interfaces/CreatedVault.md +2 -2
  138. package/docs/api/interfaces/DefaultPolicyEngineOptions.md +1 -13
  139. package/docs/api/interfaces/DispatchAuthorization.md +43 -0
  140. package/docs/api/interfaces/DispatchInstruction.md +47 -0
  141. package/docs/api/interfaces/DispatchRequest.md +83 -0
  142. package/docs/api/interfaces/DispatchResult.md +53 -0
  143. package/docs/api/interfaces/IStorageProvider.md +13 -1
  144. package/docs/api/interfaces/InitializeVaultCustodyOptions.md +31 -11
  145. package/docs/api/interfaces/InitializedVaultCustody.md +1 -7
  146. package/docs/api/interfaces/OwnerAgentProvisionResult.md +2 -2
  147. package/docs/api/interfaces/OwnerClient.md +401 -0
  148. package/docs/api/interfaces/OwnerCreateSecretInput.md +1 -1
  149. package/docs/api/interfaces/OwnerRemoveSecretInput.md +1 -1
  150. package/docs/api/interfaces/OwnerRequestRecord.md +97 -0
  151. package/docs/api/interfaces/OwnerSensitiveActionConfirmation.md +1 -1
  152. package/docs/api/interfaces/OwnerSensitiveActionContext.md +1 -1
  153. package/docs/api/interfaces/OwnerSession.md +3 -3
  154. package/docs/api/interfaces/OwnerUpdateSecretInput.md +1 -1
  155. package/docs/api/interfaces/OwnerVisibleRequestRecord.md +73 -0
  156. package/docs/api/interfaces/RecoverVaultOptions.md +1 -125
  157. package/docs/api/interfaces/RecoveredVault.md +2 -2
  158. package/docs/api/interfaces/RequestRecord.md +107 -0
  159. package/docs/api/interfaces/RestoreIdentityOptions.md +1 -1
  160. package/docs/api/interfaces/SecretAlias.md +11 -0
  161. package/docs/api/interfaces/SecretDestinationGrant.md +41 -0
  162. package/docs/api/interfaces/SecretId.md +11 -0
  163. package/docs/api/interfaces/SecretRecord.md +89 -0
  164. package/docs/api/interfaces/Signer.md +1 -1
  165. package/docs/api/interfaces/VaultApproveDispatchInput.md +3 -9
  166. package/docs/api/interfaces/VaultAuditQueryInput.md +1 -1
  167. package/docs/api/interfaces/VaultCoreDependenciesOptions.md +1 -5
  168. package/docs/api/interfaces/VaultCreateAgentInput.md +1 -1
  169. package/docs/api/interfaces/VaultExportSecretInput.md +1 -1
  170. package/docs/api/interfaces/VaultGetRequestInput.md +17 -0
  171. package/docs/api/interfaces/VaultGrantAgentSecretInput.md +23 -0
  172. package/docs/api/interfaces/VaultGrantSecretDestinationInput.md +23 -0
  173. package/docs/api/interfaces/VaultId.md +11 -0
  174. package/docs/api/interfaces/VaultImportAgentInput.md +1 -1
  175. package/docs/api/interfaces/VaultIssueSessionTokenInput.md +5 -5
  176. package/docs/api/interfaces/VaultListAgentsInput.md +1 -1
  177. package/docs/api/interfaces/VaultListGrantsInput.md +23 -0
  178. package/docs/api/interfaces/VaultListRequestsInput.md +17 -0
  179. package/docs/api/interfaces/VaultListSecretsInput.md +1 -1
  180. package/docs/api/interfaces/VaultMetadata.md +1 -1
  181. package/docs/api/interfaces/VaultObject.md +2 -2
  182. package/docs/api/interfaces/VaultPrincipal.md +17 -0
  183. package/docs/api/interfaces/VaultProfile.md +1 -1
  184. package/docs/api/interfaces/VaultReadAgentPrivateKeyInput.md +7 -7
  185. package/docs/api/interfaces/VaultReadSecretPlaintextInput.md +1 -1
  186. package/docs/api/interfaces/VaultRevokeAgentSecretInput.md +23 -0
  187. package/docs/api/interfaces/VaultRevokeSecretDestinationInput.md +23 -0
  188. package/docs/api/interfaces/VaultRevokeSessionTokenInput.md +1 -1
  189. package/docs/api/interfaces/VaultService.md +511 -0
  190. package/docs/api/interfaces/VaultUpdateAgentInput.md +7 -7
  191. package/docs/api/type-aliases/AgentId.md +7 -0
  192. package/docs/api/type-aliases/CbioRuntimeModule.md +1 -1
  193. package/docs/api/type-aliases/DispatchApprovalDecision.md +7 -0
  194. package/docs/api/type-aliases/GrantStatus.md +7 -0
  195. package/docs/api/type-aliases/SecretLifecycleStatus.md +7 -0
  196. package/docs/api/type-aliases/VaultPrincipalKind.md +7 -0
  197. package/docs/api/variables/DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY.md +2 -2
  198. package/docs/es/README.md +3 -3
  199. package/docs/fr/README.md +3 -3
  200. package/docs/ja/README.md +5 -5
  201. package/docs/ko/README.md +5 -5
  202. package/docs/pt/README.md +3 -3
  203. package/docs/zh/PROCESS_ISOLATION.md +2 -2
  204. package/docs/zh/README.md +47 -63
  205. package/examples/process-isolation.ts +26 -35
  206. package/package.json +1 -1
  207. package/docs/api/functions/createOwnerHttpFlowBoundary.md +0 -17
  208. package/docs/api/functions/createStandardAcquireBoundary.md +0 -31
  209. package/docs/api/functions/createStandardDispatchBoundary.md +0 -23
  210. package/docs/api/functions/createVaultClient.md +0 -32
  211. package/docs/api/functions/deriveIdentityId.md +0 -17
  212. package/docs/api/functions/wrapVaultCoreAsVaultService.md +0 -31
  213. package/docs/api/interfaces/AgentSubmitCapabilityRequestInput.md +0 -41
  214. package/docs/api/interfaces/VaultApproveCapabilityRequestInput.md +0 -23
  215. package/docs/api/interfaces/VaultClient.md +0 -473
  216. package/docs/api/interfaces/VaultGrantCapabilityInput.md +0 -79
  217. package/docs/api/interfaces/VaultGrantCapabilityRequest.md +0 -23
  218. package/docs/api/interfaces/VaultIdentity.md +0 -11
  219. package/docs/api/interfaces/VaultListCapabilitiesInput.md +0 -17
  220. package/docs/api/interfaces/VaultRegisterFlowInput.md +0 -77
  221. package/docs/api/interfaces/VaultRevokeCapabilityInput.md +0 -23
  222. package/docs/api/interfaces/VaultSigner.md +0 -21
  223. package/docs/api/interfaces/VaultSubmitCapabilityRequestInput.md +0 -73
  224. package/docs/api/type-aliases/AgentCapabilityEnvelope.md +0 -7
  225. package/docs/api/type-aliases/AgentVisibleSecretRecord.md +0 -7
  226. package/docs/api/type-aliases/CreateOwnerClientOptions.md +0 -7
  227. package/docs/api/type-aliases/OwnerAgentView.md +0 -7
  228. package/docs/api/type-aliases/OwnerClient.md +0 -13
  229. package/docs/api/type-aliases/OwnerGrantCapabilityInput.md +0 -7
  230. package/docs/api/type-aliases/OwnerPendingApprovalView.md +0 -7
  231. package/docs/api/type-aliases/OwnerRequestDetailView.md +0 -7
  232. package/docs/api/type-aliases/OwnerRequestSummaryView.md +0 -7
  233. package/docs/api/type-aliases/OwnerSecretView.md +0 -7
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # cbio Vault Runtime
1
+ # cbio Vault Runtime (v1.65.1)
2
2
 
3
3
  Node.js vault runtime with a **Sovereign Vault** architecture: authority is rooted in a master password, and agent identities are fully managed within the vault's encrypted storage.
4
4
 
@@ -9,12 +9,11 @@ Node.js vault runtime with a **Sovereign Vault** architecture: authority is root
9
9
  ## Key Features
10
10
 
11
11
  - **No CLI / No TUI**: Pure library for integration into Node.js applications.
12
- - **Authority-centric**: Administrative control is tied to the vault's master password, not an external identity.
12
+ - **Authority-centric**: Administrative control is tied to the vault's master password.
13
+ - **Grant-Based Authorization**: Simplified, domain-level white-listing replaced the legacy grant model.
14
+ - **Zero-Configuration Discovery**: Agents can self-introspect to discover their identity, grants, and toolset.
13
15
  - **Managed Agent Custody**: Generate and store agent private keys securely inside the vault.
14
- - **Agent Session Tokens**: Issue revocable, short-lived (or long-lived) tokens for agents to avoid handling raw private keys.
15
- - **Zero-Configuration Discovery**: Agents can self-introspect to discover their identity, capabilities, and toolset (v1.56.0+).
16
16
  - **Process Isolation**: Hard separation between the Security Process (Master) and Agent Processes (Consumers).
17
- - **Zero-Leak Discovery**: Vault metadata is fully encrypted and hidden until unlocked.
18
17
 
19
18
  ## Install
20
19
 
@@ -26,257 +25,97 @@ npm install @the-ai-company/cbio-node-runtime
26
25
 
27
26
  ## Usage
28
27
 
29
- ### 1. Bootstrap a New Vault
30
-
31
- The Sovereign Vault requires only a storage provider and a master password.
28
+ ### 1. Bootstrap and Recover
32
29
 
33
30
  ```ts
34
- import {
35
- createVault,
36
- FsStorageProvider,
37
- createWorkspaceStorage
38
- } from '@the-ai-company/cbio-node-runtime';
31
+ import { createVault, recoverVault, FsStorageProvider } from '@the-ai-company/cbio-node-runtime';
39
32
 
40
33
  const storage = new FsStorageProvider('./my-vaults');
41
34
 
35
+ // Create
42
36
  const myVault = await createVault(storage, {
43
37
  password: 'your-secure-password',
44
38
  nickname: 'Production Vault'
45
39
  });
46
40
 
47
- console.log(`Vault created: ${myVault.nickname}`);
48
- ```
49
-
50
- ### 2. Recover an Existing Vault
51
-
52
- ```ts
53
- import { recoverVault, FsStorageProvider } from '@the-ai-company/cbio-node-runtime';
54
-
41
+ // Recover
55
42
  const vault = await recoverVault(storage, {
56
43
  vaultId: myVault.core.vaultId.value,
57
44
  password: 'your-secure-password'
58
45
  });
59
46
  ```
60
47
 
61
- ### 3. Owner Sessions for GUI Apps
62
-
63
- For long-running processes such as GUI apps, keep an `OwnerSession`, not a raw `VaultClient`.
64
-
65
- `createVaultClient(...)` creates an owner client for the current runtime. It is not intended to be cached across HMR, module reloads, or runtime swaps. `OwnerSession` gives you a stable SDK-managed handle and recreates owner clients on demand.
66
-
67
- ```ts
68
- import { createOwnerSession, FsStorageProvider } from '@the-ai-company/cbio-node-runtime';
69
-
70
- const session = createOwnerSession(storage, {
71
- vaultId: myVault.core.vaultId.value,
72
- password: 'your-secure-password',
73
- });
74
-
75
- const createdAgent = await session.withClient((client) =>
76
- client.ownerCreateAgent({ nickname: 'Background Worker' })
77
- );
78
-
79
- const ownerClient = await session.client();
80
- const agents = await ownerClient.ownerListAgents();
81
-
82
- // Invalidate the session when your app unloads or explicitly locks the vault.
83
- session.invalidate();
84
- ```
85
-
86
- If you are writing a short-lived script, `recoverVault(...)` plus `createVaultClient(...)` is still fine.
87
-
88
- ### 4. Managed Agent Identities
89
-
90
- You can generate and register agents directly within the vault. The vault holds the private keys for full custody.
48
+ ### 2. Manage Agents and Grants (Owner)
91
49
 
92
50
  ```ts
93
- import { createVaultClient } from '@the-ai-company/cbio-node-runtime';
51
+ import { createOwnerClient } from '@the-ai-company/cbio-node-runtime';
94
52
 
95
- const client = createVaultClient({
53
+ const client = createOwnerClient({
96
54
  vault: vault.vault,
97
55
  passwordVerifier: vault.verifyPassword
98
56
  });
99
57
 
100
- // Generate and register a new agent in one step
101
- const createdAgent = await client.ownerCreateAgent({
102
- nickname: 'Background Worker'
103
- });
58
+ // 1. Create an agent
59
+ const { agent, sessionToken } = await client.ownerCreateAgent({ nickname: 'Bot' });
104
60
 
105
- const agentId = createdAgent.agent.agentId;
106
- console.log(`Agent public key: ${createdAgent.agent.publicKey}`);
107
- console.log(`Identity ID: ${createdAgent.agent.identityId}`);
108
- const session = createdAgent.sessionToken;
61
+ // 2. Create a secret
62
+ const secret = await client.ownerCreateSecret({ alias: 'api-key', plaintext: 'sk-...' });
109
63
 
110
- // RECOMENDED (v1.48.4+): Batch issue tokens for all agents at once
111
- const tokens = await client.ownerIssueAllSessionTokens();
112
-
113
- // ownerListAgents() also includes current session tokens for each agent
114
- const agents = await client.ownerListAgents();
64
+ // 3. Grant access (Whitelist)
65
+ await client.ownerGrantAgentSecret({ rootAgentId: agent.rootAgentId, secretAlias: 'api-key' });
66
+ await client.ownerGrantSecretDestination({ secretAlias: 'api-key', domain: 'api.openai.com' });
115
67
  ```
116
68
 
117
- ### 5. Secret Management (Owner)
69
+ ### 3. Dispatch Secrets (Agent)
118
70
 
119
- ```ts
120
- // Create a secret. Active aliases must stay unique.
121
- const record = await client.ownerCreateSecret({
122
- alias: 'api-token',
123
- plaintext: 'super-secret-value'
124
- });
71
+ Agents use a "Zero-Configuration" workflow. They don't need to know their permissions up front; the system guides them.
125
72
 
126
- // 4. Grant agent capabilities
127
- await client.ownerGrantCapability({
128
- agentId,
129
- write: {
130
- secretIds: [record.secretId.value],
131
- scope: 'https://api.example.com/*',
132
- methods: ['POST']
133
- },
134
- read: { paths: ['$'] }
135
- });
136
- ```
137
-
138
- ### 6. Consuming Secrets (Agent)
139
-
140
- Agents run in isolated processes and communicate with the vault via a transport. Agent execution now requires a **Session Token** issued by the owner.
141
-
142
- #### Using a Session Token (Stateless/Token-based)
143
73
  ```ts
144
74
  import { createAgentClient } from '@the-ai-company/cbio-node-runtime';
145
75
 
146
- const agent = createAgentClient({
147
- agentIdentity: { agentId },
148
- capability: myCapability,
149
- token: session.token,
76
+ const agentClient = createAgentClient({
77
+ rootAgentIdentity: agent,
78
+ token: sessionToken.token,
150
79
  vault: vault.vault
151
80
  });
152
81
 
153
- const result = await agent.agentDispatch({ ... });
154
- const requests = await agent.agentListRequests();
155
- const request = await agent.agentGetRequest(result.requestId);
156
- const ownerView = await client.ownerGetRequest({ requestId: result.requestId });
157
- ```
158
-
159
- The agent process does not execute directly with its raw private key. If it has an identity key, it still needs to exchange that trust for a session token before dispatching.
160
-
161
- LLM-facing rule of thumb:
162
- - `agentDispatch(...)` means "do the task now". It attempts real execution immediately.
163
- - `agentDispatch(...)` requires a one-sentence `reason` for the owner explaining why this exact request should be sent.
164
- - `agentSubmitCapabilityRequest(...)` means "ask for permission". It never executes the task by itself.
165
- - `agentSubmitCapabilityRequest(...)` also requires a one-sentence `reason` so the owner understands why the broader permission is needed.
166
- - `agentListRequests()` / `agentGetRequest(...)` are how the agent checks asynchronous results after execution.
167
- - `ownerListRequests()` / `ownerGetRequest(...)` are how the owner reviews the full sealed request record before approving read.
168
-
169
- ### 7. Proactive Capability Requests
170
-
171
- If an LLM or orchestration layer already knows it needs a broader scope, it can create a capability carrier up front instead of discovering one URL at a time through failed dispatch attempts.
172
-
173
- ```ts
174
- const request = await client.ownerSubmitCapabilityRequest({
175
- requester: { kind: 'trusted_executor', id: 'llm-planner' },
176
- agentId,
177
- write: {
178
- secretIds: [record.secretId.value],
179
- scope: 'https://api.example.com/users/*',
180
- methods: ['GET']
181
- },
182
- read: { paths: ['$'] },
183
- reason: 'Need collection-level user read access'
82
+ // Dispatch request
83
+ const result = await agentClient.agentDispatch({
84
+ targetUrl: 'https://api.openai.com/v1/chat/completions',
85
+ method: 'POST',
86
+ secretAlias: 'api-key',
87
+ reason: 'Processing user request'
184
88
  });
185
89
 
186
- const pendingRequests = await client.ownerListCapabilityStates({ writeGranted: false });
187
-
188
- await client.ownerAllowAlways({
189
- requestId: pendingRequests[0].requestId
190
- });
191
-
192
- await client.ownerApproveCapabilityRead({
193
- requestId: pendingRequests[0].requestId,
194
- read: { paths: ['data.id', 'data.status'] }
195
- });
90
+ if (result.status === 'PENDING') {
91
+ console.log("Stalled for HITL approval. Request ID:", result.requestId);
92
+ }
196
93
  ```
197
94
 
198
- This uses the same carrier model as dispatch discovery:
199
- - `ownerSubmitCapabilityRequest(...)` creates a capability carrier for owner review.
200
- - `ownerOnCapabilityState(...)` pushes new carrier changes to the owner UI or controller.
201
- - `ownerAllowAlways(...)` persists the carrier as an active capability. For dispatch discovery it also executes the blocked request; for explicit requests it grants the capability without sending network traffic.
202
- - `ownerAllowOnce(...)` executes the approved write action once and then deletes the carrier record. This option is only valid for dispatch discovery carriers that already contain a concrete blocked request.
203
- - `ownerApproveCapabilityRead(...)` approves response release separately on the same carrier record and may replace the pending `read` policy with a narrower `paths` whitelist.
204
- - Response shape is always visible. `read.paths` only controls which values are revealed, and `['$']` means the full response body is visible.
205
- - `ownerDeny(...)` rejects the currently pending action on the carrier.
95
+ ### 4. Human-in-the-Loop (Owner Approval)
206
96
 
207
- ### 8. Zero-Configuration Agent Discovery (v1.56.0+)
208
-
209
- Instead of hard-coding the agent's capabilities or tools, the agent can self-introspect at runtime. This is the "--help" and "llms.txt" for your agent.
97
+ If a dispatch is blocked (status `PENDING`), the owner reviews the request record:
210
98
 
211
99
  ```ts
212
- const manifest = await agent.agentIntrospect();
100
+ // List pending requests
101
+ const pending = await client.ownerListRequests({ status: 'PENDING' });
213
102
 
214
- console.log(manifest.agent.agentId); // Vault-known agent ID
215
- console.log(manifest.agent.identityId); // Stable identity ID
216
- console.log(manifest.agent.nickname); // Optional nickname
217
- console.log(manifest.capabilities); // Capability carriers with write/read action states
218
- console.log(manifest.tools); // List of available API tools with JSON-Schema
103
+ // Approve with the "Allow & Grant" shortcut
104
+ await client.ownerApproveDispatch({
105
+ requestId: pending[0].requestId,
106
+ decision: 'allow_and_grant' // Approves THIS request AND provisions permanent grants
107
+ });
219
108
  ```
220
109
 
221
- This manifest can be directly fed into an LLM's system prompt or tool-calling configuration to enable fully autonomous, zero-config integration.
222
-
223
- `agentListCapabilities()` returns the same carrier view used by the manifest, and `agentListRequests()` / `agentGetRequest()` expose sealed request history and per-request results through controlled interfaces.
110
+ Decisions can be:
111
+ - `allow_once`: Execute once, no permanent whitelist update.
112
+ - `allow_and_grant`: Execute and add to the permanent whitelist (Zero-Config).
113
+ - `deny`: Reject the request.
224
114
 
225
115
  ---
226
116
 
227
117
  ## Documentation
228
118
 
229
- - [Custody Model](docs/CUSTODY_MODEL.md) - Understanding managed agency and key storage.
230
- - [Process Isolation](docs/PROCESS_ISOLATION.md) - Guidelines for A/B architecture.
231
-
232
- ## Architecture Rules
233
-
234
- 1. **Secret Isolation**: Plane-text secrets never leave the Security Process.
235
- 2. **Authority Root**: The master password is the only source of administrative authority.
236
- 3. **Auditability**: Every administrative and agent action is recorded in the vault's audit log under the `vault-master` or agent principal.
237
- 4. **Binary Discovery**: Either the vault is unlocked and visible, or it is a silent directory of encrypted shards.
238
-
239
- ### Human-in-the-Loop (HITL) Workflow
240
-
241
- If an agent attempts an action not explicitly in its white-list, the dispatch returns `PENDING` and the runtime records a capability carrier whose `write` action is still pending owner approval:
242
-
243
- ```ts
244
- // In Agent process
245
- const result = await agent.agentDispatch({ ... });
246
- if (result.status === 'PENDING') {
247
- console.log("Discovery needed: Waiting for owner approval...");
248
- }
249
-
250
- // OR: Use the observer for real-time push
251
- client.ownerOnCapabilityState((state) => {
252
- if (state.writeGrant === null) {
253
- console.log("New pending capability carrier:", state.requestId);
254
- }
255
- });
256
-
257
- // In Owner process (GUI or Script)
258
- const pending = await client.ownerListCapabilityStates({ writeGranted: false });
259
- if (pending.length > 0) {
260
- await client.ownerAllowAlways({
261
- requestId: pending[0].requestId
262
- });
263
- await client.ownerApproveCapabilityRead({
264
- requestId: pending[0].requestId
265
- });
266
- }
267
- ```
268
-
269
- ## Build & Test
270
-
271
- ```bash
272
- npm run build
273
- npm test
274
- ```
275
- ```ts
276
- // 9. Sensitive actions (v1.55.0+)
277
- // Sensitive reads require the vault password again for verification
278
- const plaintext = await client.ownerReadSecretPlaintext({
279
- alias: 'api-token',
280
- password: 'your-secure-password'
281
- });
282
- ```
119
+ - [Architecture](docs/ARCHITECTURE.md) - Deep dive into the Sovereign Vault model.
120
+ - [Reference](docs/REFERENCE.md) - API surface and type definitions.
121
+ - [Migration Guide](docs/MIGRATION-1.65.md) - Moving from v1.4x (Capabilities) to v1.65 (Grants).
@@ -1,52 +1,42 @@
1
- import type { CreatedIdentity } from "../../runtime/identity.js";
2
1
  import { type Clock } from "../../vault-core/index.js";
3
2
  import type { VaultService } from "../../vault-ingress/index.js";
4
- import type { AgentCapabilityEnvelope, AgentDispatchIntent, AgentDispatchTransport, AgentSubmitCapabilityRequestInput, AgentVisibleRequestRecord, AgentVisibleSecretRecord } from "./contracts.js";
3
+ import type { AgentDispatchIntent, AgentDispatchTransport, AgentVisibleRequestRecord, AgentVisibleSecretRecord } from "./contracts.js";
5
4
  export interface AgentIdentity {
6
- agentId: string;
5
+ rootAgentId: string;
7
6
  }
8
7
  /**
9
8
  * A client for agents to perform authorized operations (e.g., dispatch HTTP requests with secrets).
10
- * This client uses a delegated capability granted by the owner.
9
+ * This client uses a session token managed by the owner.
11
10
  * Agents can use secrets and request broader access, but they do not directly manage
12
- * the secret lifecycle inside the vault. Newly obtained credentials are persisted only
13
- * through owner actions or owner-configured vault flows that explicitly capture them.
11
+ * the secret lifecycle inside the vault.
14
12
  */
15
13
  export interface AgentClient {
16
14
  /**
17
15
  * Dispatches a session-token-authenticated request to a target using a vault secret.
18
- *
19
- * @param intent - The destination, method, and secret alias to use.
20
- * @returns The result of the remote operation.
21
- *
22
- * @example
23
- * ```ts
24
- * const result = await agent.agentDispatch({
25
- * targetUrl: 'https://api.example.com/data',
26
- * method: 'POST',
27
- * secretAlias: 'api-token',
28
- * body: JSON.stringify({ key: 'value' })
29
- * });
30
- * ```
16
+ * If the grant is missing, it will return a PENDING status.
31
17
  */
32
18
  agentDispatch(intent: AgentDispatchIntent): Promise<import("../../vault-core/index.js").DispatchResult>;
33
- agentListCapabilities(): Promise<readonly import("../../vault-core/index.js").AgentCapabilityState[]>;
19
+ /**
20
+ * List secrets the agent can see, including whether they are granted or not.
21
+ */
34
22
  agentListSecrets(): Promise<readonly AgentVisibleSecretRecord[]>;
23
+ /**
24
+ * List previous requests sent by this agent.
25
+ */
35
26
  agentListRequests(): Promise<readonly AgentVisibleRequestRecord[]>;
27
+ /**
28
+ * Get details of a specific request.
29
+ */
36
30
  agentGetRequest(requestId: string): Promise<import("../../vault-core/index.js").AgentRequestResult>;
37
31
  /**
38
- * Introspects the current runtime environment, providing identity, capabilities, and a toolbox manifest.
39
- * Equivalent to '--help' or 'llms.txt' for the agent.
40
- * This is the primary place where an agent should learn its operational boundary:
41
- * it can use existing secrets and request more permission, but it cannot directly
42
- * create, update, or remove secrets in the vault.
32
+ * Introspects the current runtime environment, providing identity, grants, and a toolbox manifest.
43
33
  */
44
34
  agentIntrospect(): Promise<import("../../vault-core/index.js").AgentRuntimeManifest>;
45
- agentSubmitCapabilityRequest(input: AgentSubmitCapabilityRequestInput): Promise<import("../../vault-core/index.js").CapabilityStateRecord>;
46
35
  }
47
36
  export interface CreateAgentClientOptions {
48
- agentIdentity: CreatedIdentity | AgentIdentity;
49
- capability: AgentCapabilityEnvelope;
37
+ agentRecord: AgentIdentity | {
38
+ id: string;
39
+ };
50
40
  vault?: VaultService;
51
41
  transport?: AgentDispatchTransport;
52
42
  token: string;
@@ -54,17 +44,5 @@ export interface CreateAgentClientOptions {
54
44
  }
55
45
  /**
56
46
  * Creates an {@link AgentClient} for a delegated identity.
57
- *
58
- * @param options - Configuration including agent identity, capability, and transport.
59
- * @returns An initialized {@link AgentClient}.
60
- *
61
- * @example
62
- * ```ts
63
- * const agent = createAgentClient({
64
- * agentIdentity,
65
- * capability,
66
- * vault
67
- * });
68
- * ```
69
47
  */
70
48
  export declare function createAgentClient(options: CreateAgentClientOptions): AgentClient;
@@ -3,13 +3,11 @@ import { SystemClock } from "../../vault-core/index.js";
3
3
  import { LocalVaultTransport } from "../../vault-ingress/defaults.js";
4
4
  class DefaultAgentClient {
5
5
  _identity;
6
- _capability;
7
6
  _transport;
8
7
  _clock;
9
8
  _token;
10
- constructor(_identity, _capability, _transport, _clock, _token) {
9
+ constructor(_identity, _transport, _clock, _token) {
11
10
  this._identity = _identity;
12
- this._capability = _capability;
13
11
  this._transport = _transport;
14
12
  this._clock = _clock;
15
13
  this._token = _token;
@@ -22,30 +20,15 @@ class DefaultAgentClient {
22
20
  throw new Error("agentDispatch requires a non-empty reason for owner review");
23
21
  }
24
22
  return this._transport.agentDispatch({
25
- vaultId: this._capability.vaultId,
23
+ vaultId: { value: "" }, // Will be filled by transport/vault if needed, or ignored if local
26
24
  requestId,
27
25
  requestedAt,
28
26
  agent: {
29
27
  kind: "agent",
30
- id: this._identity.agentId,
31
- },
32
- capability: {
33
- vaultId: this._capability.vaultId,
34
- capabilityId: this._capability.capabilityId,
35
- agentId: this._capability.agentId,
36
- operation: this._capability.operation,
37
- customFlowId: this._capability.customFlowId,
38
- write: this._capability.write,
39
- read: this._capability.read,
40
- issuedAt: this._capability.issuedAt,
41
- expiresAt: this._capability.expiresAt,
42
- revocationVersion: this._capability.revocationVersion,
43
- rateLimit: this._capability.rateLimit,
44
- skipAudit: this._capability.skipAudit,
28
+ id: this._identity.rootAgentId,
45
29
  },
46
30
  proof: {
47
- agentId: this._identity.agentId,
48
- token: this._token,
31
+ rootAgentId: this._identity.rootAgentId,
49
32
  requestId,
50
33
  requestedAt,
51
34
  },
@@ -57,118 +40,63 @@ class DefaultAgentClient {
57
40
  body: intent.body,
58
41
  });
59
42
  }
60
- async _createProof(requestId, requestedAt, _action, _payload = {}) {
43
+ async _createProof(requestId, requestedAt) {
61
44
  return {
62
- agentId: this._identity.agentId,
63
- token: this._token,
45
+ rootAgentId: this._identity.rootAgentId,
64
46
  requestId,
65
47
  requestedAt,
66
48
  };
67
49
  }
68
- async agentListCapabilities() {
69
- const requestedAt = this._clock.nowIso();
70
- const requestId = createRequestIdValue("list_capabilities");
71
- return this._transport.agentListCapabilities({
72
- vaultId: this._capability.vaultId,
73
- requestId,
74
- requestedAt,
75
- agent: { kind: "agent", id: this._identity.agentId },
76
- proof: await this._createProof(requestId, requestedAt, "list_capabilities"),
77
- });
78
- }
79
50
  async agentListSecrets() {
80
51
  const requestedAt = this._clock.nowIso();
81
52
  const requestId = createRequestIdValue("list_secrets");
82
53
  return this._transport.agentListSecrets({
83
- vaultId: this._capability.vaultId,
54
+ vaultId: { value: "" },
84
55
  requestId,
85
56
  requestedAt,
86
- agent: { kind: "agent", id: this._identity.agentId },
87
- proof: await this._createProof(requestId, requestedAt, "list_secrets"),
57
+ agent: { kind: "agent", id: this._identity.rootAgentId },
58
+ proof: await this._createProof(requestId, requestedAt),
88
59
  });
89
60
  }
90
61
  async agentIntrospect() {
91
62
  const requestedAt = this._clock.nowIso();
92
63
  const requestId = createRequestIdValue("get_manifest");
93
64
  return this._transport.agentGetRuntimeManifest({
94
- vaultId: this._capability.vaultId,
65
+ vaultId: { value: "" },
95
66
  requestId,
96
67
  requestedAt,
97
- agent: { kind: "agent", id: this._identity.agentId },
98
- proof: await this._createProof(requestId, requestedAt, "get_manifest"),
68
+ agent: { kind: "agent", id: this._identity.rootAgentId },
69
+ proof: await this._createProof(requestId, requestedAt),
99
70
  });
100
71
  }
101
72
  async agentListRequests() {
102
73
  const requestedAt = this._clock.nowIso();
103
74
  const requestId = createRequestIdValue("list_requests");
104
75
  return this._transport.agentListRequests({
105
- vaultId: this._capability.vaultId,
76
+ vaultId: { value: "" },
106
77
  requestId,
107
78
  requestedAt,
108
- agent: { kind: "agent", id: this._identity.agentId },
109
- proof: await this._createProof(requestId, requestedAt, "list_requests"),
79
+ agent: { kind: "agent", id: this._identity.rootAgentId },
80
+ proof: await this._createProof(requestId, requestedAt),
110
81
  });
111
82
  }
112
83
  async agentGetRequest(targetRequestId) {
113
84
  const requestedAt = this._clock.nowIso();
114
85
  const requestId = createRequestIdValue("read_request_result");
115
86
  return this._transport.agentGetRequest({
116
- vaultId: this._capability.vaultId,
87
+ vaultId: { value: "" },
117
88
  requestId,
118
89
  requestedAt,
119
90
  targetRequestId,
120
- agent: { kind: "agent", id: this._identity.agentId },
121
- proof: await this._createProof(requestId, requestedAt, "read_request_result", { targetRequestId }),
91
+ agent: { kind: "agent", id: this._identity.rootAgentId },
92
+ proof: await this._createProof(requestId, requestedAt),
122
93
  });
123
94
  }
124
- async agentSubmitCapabilityRequest(input) {
125
- const requestedAt = input.requestedAt ?? this._clock.nowIso();
126
- const requestId = createRequestIdValue("submit_capability_request");
127
- const reason = input.reason.trim();
128
- if (!reason) {
129
- throw new Error("agentSubmitCapabilityRequest requires a non-empty reason for owner review");
130
- }
131
- const payload = {
132
- write: {
133
- ...input.write,
134
- secretAliases: input.secretAliases ?? null,
135
- },
136
- read: input.read,
137
- operation: input.operation ?? "dispatch_http",
138
- reason,
139
- };
140
- return this._transport.agentSubmitCapabilityRequest({
141
- vaultId: this._capability.vaultId,
142
- requestId,
143
- requestedAt,
144
- agent: { kind: "agent", id: this._identity.agentId },
145
- proof: await this._createProof(requestId, requestedAt, "submit_capability_request", payload),
146
- capability: {
147
- operation: input.operation ?? "dispatch_http",
148
- write: {
149
- scope: input.write.scope,
150
- methods: [...input.write.methods],
151
- },
152
- read: { paths: [...input.read.paths] },
153
- },
154
- secretAliases: input.secretAliases ? [...input.secretAliases] : undefined,
155
- reason,
156
- });
157
- }
158
- }
159
- function isCreateAgentClientOptions(value) {
160
- return typeof value === "object" && value !== null && "agentIdentity" in value && "capability" in value;
161
95
  }
162
96
  function resolveAgentIdentity(options) {
163
- return "agentId" in options.agentIdentity
164
- ? options.agentIdentity
165
- : { agentId: options.agentIdentity.identityId };
166
- }
167
- function resolveAgentToken(options) {
168
- if (!options.token) {
169
- throw new Error("createAgentClient() requires a session token; raw private-key execution is not supported");
170
- }
171
- return options.token;
97
+ return "rootAgentId" in options.agentRecord
98
+ ? options.agentRecord
99
+ : { rootAgentId: options.agentRecord.id };
172
100
  }
173
101
  function resolveAgentTransport(options) {
174
102
  if (options.transport) {
@@ -181,23 +109,8 @@ function resolveAgentTransport(options) {
181
109
  }
182
110
  /**
183
111
  * Creates an {@link AgentClient} for a delegated identity.
184
- *
185
- * @param options - Configuration including agent identity, capability, and transport.
186
- * @returns An initialized {@link AgentClient}.
187
- *
188
- * @example
189
- * ```ts
190
- * const agent = createAgentClient({
191
- * agentIdentity,
192
- * capability,
193
- * vault
194
- * });
195
- * ```
196
112
  */
197
113
  export function createAgentClient(options) {
198
- if (!isCreateAgentClientOptions(options)) {
199
- throw new Error("createAgentClient() requires a single options object");
200
- }
201
- return new DefaultAgentClient(resolveAgentIdentity(options), options.capability, resolveAgentTransport(options), options.clock ?? new SystemClock(), resolveAgentToken(options));
114
+ return new DefaultAgentClient(resolveAgentIdentity(options), resolveAgentTransport(options), options.clock ?? new SystemClock(), options.token);
202
115
  }
203
116
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/clients/agent/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAc,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAgEtE,MAAM,kBAAkB;IAEH;IACA;IACA;IACA;IACA;IALnB,YACmB,SAAwB,EACxB,WAAoC,EACpC,UAAkC,EAClC,MAAa,EACb,MAAc;QAJd,cAAS,GAAT,SAAS,CAAe;QACxB,gBAAW,GAAX,WAAW,CAAyB;QACpC,eAAU,GAAV,UAAU,CAAwB;QAClC,WAAM,GAAN,MAAM,CAAO;QACb,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,MAA2B;QAC7C,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAC/D,MAAM,SAAS,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,MAAM,EAA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