@agentvault/agentvault 0.17.1 → 0.17.3

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 CHANGED
@@ -1,16 +1,20 @@
1
1
  # @agentvault/agentvault
2
2
 
3
- The security infrastructure layer for AI agents cryptographic identity, earned trust, and Signal-grade encrypted communications natively integrated with [OpenClaw](https://openclaw.ai).
3
+ The security infrastructure layer for AI agents -- cryptographic identity, earned trust, and Signal-grade encrypted communications natively integrated with [OpenClaw](https://openclaw.ai).
4
4
 
5
5
  Connect your agent to its owner with XChaCha20-Poly1305 encryption, Double Ratchet forward secrecy, and W3C Decentralized Identifiers (DIDs). No plaintext ever touches the server.
6
6
 
7
- ## What's New in v0.17.0
7
+ ## What's New in v0.17.3
8
8
 
9
- * **Policy Enforcer:** 5-stage policy pipeline (Parse Validate Enforce Log Report) with tool blocklists, model routing rules, and telemetry emission.
10
- * **SKILL.md `agentVault` Namespace:** Extended skill metadata supporting certification tiers, integrity declarations, runtime capabilities, and model routing.
11
- * **Unified Delivery Protocol:** Single `deliver()` dispatcher for all outbound messages text, decisions, approvals, policy alerts, and artifacts.
12
- * **20 OTel Span Types:** Full observability with `av.*`-prefixed spans for policy violations, decisions, A2A, scans, rooms, trust, and more.
13
- * **W3C TraceContext:** All telemetry spans carry `traceparent` and `tracestate` for cross-agent trace correlation.
9
+ - **Runtime Shadow Mode:** Agents in shadow mode send recommendations instead of executing. Config synced via `shadow_config_sync` WS event on connect. Supports `shadow_session_created`, `shadow_session_graduated`, and `shadow_session_deleted` events. Use `getShadowConfig(skillName)` to check if a skill is shadowed before execution.
10
+ - **Shadow Recommendations:** New `shadow_recommendation` delivery type. Agents deliver structured recommendation cards to owners for Agree/Override review in chat.
11
+ - **Agent Roles:** Lead/peer role assignment via `agentRole` config. Lead agents get workspace-level file access. Roles sync automatically via `hub_identity_role_changed` events.
12
+ - **Eval Framework Integration:** `av.eval_run` telemetry spans for evaluation pipelines. Shadow mode and review queue support via the observability dashboard.
13
+ - **Policy Enforcer:** 5-stage policy pipeline (Parse, Validate, Enforce, Log, Report) with tool blocklists, model routing rules, and telemetry emission.
14
+ - **SKILL.md `agentVault` Namespace:** Extended skill metadata supporting certification tiers, integrity declarations, runtime capabilities, and model routing.
15
+ - **Unified Delivery Protocol:** Single `deliver()` dispatcher for all outbound messages -- text, decisions, approvals, policy alerts, shadow recommendations, and artifacts.
16
+ - **21 OTel Span Types:** Full observability with `av.*`-prefixed spans for policy violations, decisions, A2A, scans, rooms, trust, eval runs, and more.
17
+ - **W3C TraceContext:** All telemetry spans carry `traceparent` and `tracestate` for cross-agent trace correlation.
14
18
 
15
19
  ## Installation
16
20
 
@@ -47,6 +51,33 @@ The CLI will generate an Ed25519 identity keypair, enroll with the server (ancho
47
51
  | `doctor [--fix]` | Diagnose and fix LaunchAgent / gateway issues |
48
52
  | `version` | Print the installed version |
49
53
 
54
+ ## Configuration
55
+
56
+ ```typescript
57
+ const channel = new SecureChannel({
58
+ // Required
59
+ inviteToken: process.env.AGENTVAULT_INVITE_TOKEN,
60
+ dataDir: "./agentvault-data",
61
+ apiUrl: "https://api.agentvault.chat",
62
+
63
+ // Optional
64
+ agentName: "My Agent",
65
+ agentVersion: "1.0.0",
66
+ httpPort: 18790, // Local HTTP port for unified delivery protocol
67
+ enableScanning: true, // Enable client-side policy scanning
68
+ backupCode: "...", // Auto-backup encrypted state to server
69
+
70
+ // Callbacks
71
+ onMessage: (text, metadata) => {},
72
+ onStateChange: (state) => {},
73
+ onA2AMessage: (msg) => {},
74
+ onA2AChannelReady: (info) => {},
75
+ });
76
+ ```
77
+
78
+ The persisted state also tracks:
79
+ - `agentRole` -- `"lead"` or `"peer"` (synced from server, determines workspace file access)
80
+
50
81
  ## Programmatic Usage
51
82
 
52
83
  ### SecureChannel
@@ -75,6 +106,54 @@ channel.on("ready", () => {
75
106
  await channel.start();
76
107
  ```
77
108
 
109
+ ### Unified Delivery Protocol -- `deliver()`
110
+
111
+ All outbound messages should flow through `deliver()`. It routes based on explicit target and never silently falls back.
112
+
113
+ ```typescript
114
+ // Send to the agent owner
115
+ await channel.deliver(
116
+ { kind: "owner" },
117
+ { type: "text", text: "Task complete" },
118
+ );
119
+
120
+ // Send to a multi-agent room
121
+ await channel.deliver(
122
+ { kind: "room", roomId: "room_abc123" },
123
+ { type: "text", text: "Ready for review" },
124
+ );
125
+
126
+ // Send to another agent (A2A)
127
+ await channel.deliver(
128
+ { kind: "a2a", hubAddress: "did:hub:other_agent" },
129
+ { type: "text", text: "Handoff data" },
130
+ );
131
+
132
+ // Send a decision request
133
+ await channel.deliver(
134
+ { kind: "owner" },
135
+ {
136
+ type: "decision_request",
137
+ request: {
138
+ question: "Which database?",
139
+ options: [
140
+ { label: "PostgreSQL", value: "postgres" },
141
+ { label: "SQLite", value: "sqlite" },
142
+ ],
143
+ urgency: "medium",
144
+ },
145
+ },
146
+ );
147
+ ```
148
+
149
+ **Delivery targets:**
150
+ - `{ kind: "owner" }` -- Send to the agent owner
151
+ - `{ kind: "room", roomId: "..." }` -- Send to a multi-agent room
152
+ - `{ kind: "a2a", hubAddress: "..." }` -- Send to another agent
153
+ - `{ kind: "context" }` -- Resolve from last inbound room (opt-in only)
154
+
155
+ **Content types:** `text`, `decision_request`, `decision_response`, `approval_request`, `approval_response`, `policy_alert`, `artifact_share`, `action_confirmation`, `attachment`
156
+
78
157
  ### Gateway Send Helpers
79
158
 
80
159
  Send messages from your agent code without managing the channel directly:
@@ -82,36 +161,41 @@ Send messages from your agent code without managing the channel directly:
82
161
  ```typescript
83
162
  import { sendToOwner, sendToRoom, sendToTarget, listTargets } from "@agentvault/agentvault";
84
163
 
85
- // Send to the agent owner
86
- await sendToOwner("Task complete — 3 files processed");
87
-
88
- // Send to a multi-agent room
164
+ await sendToOwner("Task complete -- 3 files processed");
89
165
  await sendToRoom("room_abc123", "Ready for review");
90
-
91
- // Send to any target (auto-resolves owner, room, or A2A)
92
166
  await sendToTarget("did:hub:other_agent", "Handoff data");
93
167
 
94
- // List available targets
95
168
  const targets = await listTargets();
96
169
  ```
97
170
 
98
- ### Structured Messages
171
+ ### Policy Enforcement
172
+
173
+ The PolicyEnforcer validates skill invocations against a 5-stage pipeline:
99
174
 
100
175
  ```typescript
101
- import { sendDecisionToOwner } from "@agentvault/agentvault";
102
-
103
- // Decision request ask the owner to choose
104
- await sendDecisionToOwner({
105
- question: "Which database should I use?",
106
- options: [
107
- { label: "PostgreSQL", value: "postgres" },
108
- { label: "SQLite", value: "sqlite" },
109
- ],
110
- urgency: "medium",
176
+ import { PolicyEnforcer } from "@agentvault/agentvault";
177
+
178
+ const enforcer = new PolicyEnforcer();
179
+
180
+ enforcer.registerSkill({
181
+ name: "code-review",
182
+ toolsAllowed: ["file.read"],
183
+ toolsDenied: ["shell.exec", "network.raw"],
184
+ modelRouting: { allowed: ["gpt-4", "claude-sonnet-4-20250514"] },
111
185
  });
112
- ```
113
186
 
114
- All 8 message types are supported: `text`, `decision_request`, `decision_response`, `approval_request`, `approval_response`, `policy_alert`, `artifact_share`.
187
+ const result = enforcer.evaluate({
188
+ skillName: "code-review",
189
+ toolName: "shell.exec",
190
+ model: "gpt-4",
191
+ });
192
+
193
+ if (!result.allowed) {
194
+ console.log("Blocked:", result.violations);
195
+ }
196
+
197
+ const metrics = enforcer.getMetrics();
198
+ ```
115
199
 
116
200
  ### Skill Management
117
201
 
@@ -126,12 +210,6 @@ tags: [code-review, typescript]
126
210
  sla:
127
211
  p95_latency_ms: 5000
128
212
  max_error_rate: 0.05
129
- schema:
130
- type: object
131
- properties:
132
- code:
133
- type: string
134
- required: [code]
135
213
  agentVault:
136
214
  certification: certified
137
215
  integrity:
@@ -145,57 +223,18 @@ agentVault:
145
223
  allowed: [gpt-4, claude-sonnet-4-20250514]
146
224
  default: claude-sonnet-4-20250514
147
225
  ---
148
- # Code Review Skill
149
-
150
- Review the provided code for bugs, security issues, and style violations...
151
226
  ```
152
227
 
153
- Load and use skills programmatically:
154
-
155
- ```typescript
156
- import { parseSkillMd, loadSkillsFromDirectory, invokeSkill } from "@agentvault/agentvault";
157
-
158
- // Load all SKILL.md files from a directory
159
- const manifest = await loadSkillsFromDirectory("./skills");
160
-
161
- // Invoke a skill with policy enforcement
162
- const result = await invokeSkill("code-review", {
163
- args: { code: "function foo() { eval(input); }" },
164
- });
165
- ```
166
-
167
- ### Policy Enforcement
228
+ ### Telemetry
168
229
 
169
- The PolicyEnforcer validates skill invocations against a 5-stage pipeline:
230
+ The plugin auto-instruments all message operations with OTel-shaped telemetry spans. Spans feed the trust scoring engine and observability dashboard.
170
231
 
171
232
  ```typescript
172
- import { PolicyEnforcer } from "@agentvault/agentvault";
173
-
174
- const enforcer = new PolicyEnforcer();
175
-
176
- // Register a skill with its policy constraints
177
- enforcer.registerSkill({
178
- name: "code-review",
179
- toolsAllowed: ["file.read"],
180
- toolsDenied: ["shell.exec", "network.raw"],
181
- modelRouting: { allowed: ["gpt-4", "claude-sonnet-4-20250514"] },
182
- });
233
+ import { wrapSkillExecution } from "@agentvault/agentvault";
183
234
 
184
- // Evaluate before execution
185
- const result = enforcer.evaluate({
186
- skillName: "code-review",
187
- toolName: "shell.exec",
188
- model: "gpt-4",
235
+ const result = await wrapSkillExecution("code-review", async () => {
236
+ return { issues: 3 };
189
237
  });
190
-
191
- if (!result.allowed) {
192
- console.log("Blocked:", result.violations);
193
- // [{ ruleId: "tool_deny", scope: "tool", message: "shell.exec is forbidden" }]
194
- }
195
-
196
- // Get aggregate metrics
197
- const metrics = enforcer.getMetrics();
198
- // { totalEvaluations: 42, totalBlocks: 3, bySkill: {...}, byRule: {...} }
199
238
  ```
200
239
 
201
240
  ### MCP Server (Embedded)
@@ -207,25 +246,87 @@ import { AgentVaultMcpServer } from "@agentvault/agentvault";
207
246
 
208
247
  const mcpServer = new AgentVaultMcpServer({
209
248
  skills: manifest.skills,
210
- channel, // SecureChannel instance for message relay
211
- enforcer, // PolicyEnforcer for pre-execution checks
249
+ channel,
250
+ enforcer,
212
251
  });
213
252
  ```
214
253
 
215
- ### Telemetry
254
+ ## Shadow Mode
216
255
 
217
- The plugin auto-instruments all message operations with OTel-shaped telemetry spans. Spans are exported to `https://api.agentvault.chat/api/v1/otel/push` and feed the trust scoring engine and observability dashboard.
256
+ Runtime Shadow Mode lets agents observe and recommend without executing. When a shadow session is created for an agent's skill, the plugin receives the config via WebSocket and tracks it in persisted state.
218
257
 
219
- ```typescript
220
- import { wrapSkillExecution, reportSkillInvocation } from "@agentvault/agentvault";
258
+ ### Checking Shadow Status
221
259
 
222
- // Wrap a skill execution to auto-emit spans
223
- const result = await wrapSkillExecution("code-review", async () => {
224
- // Your skill logic here
225
- return { issues: 3 };
226
- });
260
+ ```typescript
261
+ const shadow = channel.getShadowConfig("triage_ticket");
262
+ if (shadow) {
263
+ // Skill is in shadow/supervised mode — send recommendation instead of executing
264
+ const recommendation = await runLLMPipeline(input);
265
+ await channel.deliver({
266
+ type: "shadow_recommendation",
267
+ recommendation: {
268
+ sessionId: shadow.sessionId,
269
+ skillName: "triage_ticket",
270
+ decisionClass: shadow.decisionClass,
271
+ recommendedAction: recommendation,
272
+ observationId: observationId, // from POST /shadow/sessions/{id}/observations
273
+ },
274
+ });
275
+ } else {
276
+ // Normal execution
277
+ await executeAction(input);
278
+ }
227
279
  ```
228
280
 
281
+ ### Shadow Events
282
+
283
+ | Event | Description |
284
+ |-------|-------------|
285
+ | `shadow_config_sync` | Full shadow config received on WS connect |
286
+ | `shadow_session_created` | New shadow session for this agent |
287
+ | `shadow_session_graduated` | Session autonomy level changed |
288
+ | `shadow_session_deleted` | Shadow session removed |
289
+
290
+ ### Autonomy Levels
291
+
292
+ | Level | Behavior |
293
+ |-------|----------|
294
+ | `shadow` | Recommend only — never execute |
295
+ | `supervised` | Recommend + wait for approval (future) |
296
+ | `autonomous` | Normal execution (config removed from plugin) |
297
+
298
+ ## Events
299
+
300
+ The SecureChannel emits the following events:
301
+
302
+ | Event | Payload | Description |
303
+ |-------|---------|-------------|
304
+ | `ready` | -- | Channel established and encrypted |
305
+ | `message` | `(text, metadata)` | Decrypted owner message |
306
+ | `room_message` | `{ roomId, text, ... }` | Decrypted room message |
307
+ | `a2a_message` | `A2AMessage` | Agent-to-agent message |
308
+ | `a2a_channel_approved` | `{ channel_id, ... }` | A2A channel approved |
309
+ | `a2a_channel_activated` | `{ ... }` | A2A channel ready for E2E |
310
+ | `a2a_channel_rejected` | `{ ... }` | A2A channel request rejected |
311
+ | `a2a_channel_revoked` | `{ ... }` | A2A channel revoked |
312
+ | `hub_identity_assigned` | `{ ... }` | DID hub identity assigned |
313
+ | `hub_identity_role_changed` | `{ agent_role }` | Agent role changed (lead/peer) |
314
+ | `hub_identity_removed` | `{ ... }` | Hub identity removed |
315
+ | `room_joined` | `{ roomId, name }` | Joined a multi-agent room |
316
+ | `room_left` | `{ roomId }` | Left a room |
317
+ | `room_participant_added` | `{ roomId, deviceId }` | Participant joined room |
318
+ | `room_participant_removed` | `{ roomId, deviceId }` | Participant left room |
319
+ | `policy_blocked` | `{ ... }` | Message blocked by policy |
320
+ | `message_held` | `{ ... }` | Message held for review |
321
+ | `policy_rejected` | `{ ... }` | Policy rejected message |
322
+ | `scan_blocked` | `{ direction, violations }` | Client-side scan blocked message |
323
+ | `resync_requested` | `{ conversationId, reason }` | Ratchet resync needed |
324
+ | `resync_completed` | `{ conversationId }` | Ratchet resync completed |
325
+ | `state` | `ChannelState` | Connection state change |
326
+ | `error` | `Error` | Error occurred |
327
+ | `http-ready` | `port` | Local HTTP server started |
328
+ | `webhook_registered` | `{ ... }` | Webhook registered with backend |
329
+
229
330
  ## OpenClaw Integration
230
331
 
231
332
  When installed as an OpenClaw plugin, AgentVault registers as the `agentvault` channel:
@@ -242,11 +343,11 @@ When installed as an OpenClaw plugin, AgentVault registers as the `agentvault` c
242
343
 
243
344
  The plugin hooks into OpenClaw's lifecycle:
244
345
 
245
- - **Channel gateway** routes inbound/outbound messages through the E2E encrypted channel
246
- - **Heartbeat wake** keeps the agent alive via OpenClaw's heartbeat system
247
- - **Agent events** listens for session start/end and transcript updates
248
- - **Managed HTTP routes** `/send`, `/status`, `/targets`, `/action`, `/decision`
249
- - **MCP serving** exposes skills as MCP tools via `/mcp` route
346
+ - **Channel gateway** -- routes inbound/outbound messages through the E2E encrypted channel
347
+ - **Heartbeat wake** -- keeps the agent alive via OpenClaw's heartbeat system
348
+ - **Agent events** -- listens for session start/end and transcript updates
349
+ - **Managed HTTP routes** -- `/send`, `/status`, `/targets`, `/action`, `/decision`
350
+ - **MCP serving** -- exposes skills as MCP tools via `/mcp` route
250
351
 
251
352
  ## Security Architecture
252
353
 
@@ -259,7 +360,7 @@ AgentVault is a **zero-knowledge** platform. The server routes ciphertext and NE
259
360
  | Forward Secrecy | Double Ratchet protocol + X3DH key agreement |
260
361
  | Group Crypto | Sender Key distribution with automatic force rekeying |
261
362
  | Audit | BLAKE2b hash-chained entries with W3C TraceContext |
262
- | Policy | 5-stage pipeline: Parse Validate Enforce Log Report |
363
+ | Policy | 5-stage pipeline: Parse, Validate, Enforce, Log, Report |
263
364
 
264
365
  ## Related Packages
265
366
 
package/dist/channel.d.ts CHANGED
@@ -78,6 +78,14 @@ export declare class SecureChannel extends EventEmitter {
78
78
  resolveA2AChannelHub(channelId: string): string | null;
79
79
  /** Returns the TelemetryReporter instance (available after WebSocket connect). */
80
80
  get telemetry(): TelemetryReporter | null;
81
+ /**
82
+ * Check if a skill is in shadow mode. Returns the shadow config if active, undefined otherwise.
83
+ */
84
+ getShadowConfig(skillName: string): {
85
+ sessionId: string;
86
+ autonomyLevel: string;
87
+ decisionClass: string;
88
+ } | undefined;
81
89
  start(): Promise<void>;
82
90
  /**
83
91
  * Fetch scan rules from the server and load them into the ScanEngine.
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C,OAAO,EAWL,iBAAiB,EAClB,MAAM,o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oBAAoB;IAkDlC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAqC5B;;;OAGG;YACW,oBAAoB;IAyBlC;;;OAGG;YACW,uBAAuB;IAkCrC;;;;OAIG;YACW,mBAAmB;IAuEjC;;;;OAIG;YACW,oBAAoB;IA8ElC;;;OAGG;YACW,kBAAkB;IAyNhC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAiBlC;;;;OAIG;YACW,oBAAoB;IAuClC;;;OAGG;YACW,4BAA4B;IA2F1C;;OAEG;YACW,oBAAoB;IAqGlC;;;OAGG;IACH;;;OAGG;YACW,mBAAmB;IAsKjC,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,UAAU;YAMJ,mBAAmB;IAmCjC,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;YAOV,qBAAqB;IAuCnC,OAAO,CAAC,kBAAkB;IA4C1B,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,kBAAkB;IA2H1B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,YAAY;IAKpB;;;OAGG;YACW,aAAa;IAyB3B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;CAqB9B"}
package/dist/cli.js CHANGED
@@ -46919,6 +46919,12 @@ var init_channel = __esm({
46919
46919
  get telemetry() {
46920
46920
  return this._telemetryReporter;
46921
46921
  }
46922
+ /**
46923
+ * Check if a skill is in shadow mode. Returns the shadow config if active, undefined otherwise.
46924
+ */
46925
+ getShadowConfig(skillName) {
46926
+ return this._persisted?.shadowSkills?.[skillName];
46927
+ }
46922
46928
  async start() {
46923
46929
  this._stopped = false;
46924
46930
  await libsodium_wrappers_default.ready;
@@ -48529,6 +48535,46 @@ var init_channel = __esm({
48529
48535
  }
48530
48536
  this.emit("hub_identity_role_changed", data.data);
48531
48537
  }
48538
+ if (data.event === "shadow_config_sync") {
48539
+ if (this._persisted && data.data?.skills) {
48540
+ this._persisted.shadowSkills = data.data.skills;
48541
+ this._persistState();
48542
+ console.log(`[SecureChannel] Shadow config synced: ${Object.keys(data.data.skills).length} skill(s)`);
48543
+ }
48544
+ }
48545
+ if (data.event === "shadow_session_created") {
48546
+ if (this._persisted && data.data?.skill_name) {
48547
+ if (!this._persisted.shadowSkills) this._persisted.shadowSkills = {};
48548
+ this._persisted.shadowSkills[data.data.skill_name] = {
48549
+ sessionId: data.data.session_id,
48550
+ autonomyLevel: data.data.autonomy_level,
48551
+ decisionClass: data.data.decision_class
48552
+ };
48553
+ this._persistState();
48554
+ console.log(`[SecureChannel] Shadow session created for skill: ${data.data.skill_name}`);
48555
+ }
48556
+ this.emit("shadow_session_created", data.data);
48557
+ }
48558
+ if (data.event === "shadow_session_graduated") {
48559
+ if (this._persisted?.shadowSkills && data.data?.skill_name) {
48560
+ if (data.data.autonomy_level === "autonomous") {
48561
+ delete this._persisted.shadowSkills[data.data.skill_name];
48562
+ } else {
48563
+ const entry = this._persisted.shadowSkills[data.data.skill_name];
48564
+ if (entry) entry.autonomyLevel = data.data.autonomy_level;
48565
+ }
48566
+ this._persistState();
48567
+ console.log(`[SecureChannel] Shadow session graduated: ${data.data.skill_name} \u2192 ${data.data.autonomy_level}`);
48568
+ }
48569
+ this.emit("shadow_session_graduated", data.data);
48570
+ }
48571
+ if (data.event === "shadow_session_deleted") {
48572
+ if (this._persisted?.shadowSkills && data.data?.skill_name) {
48573
+ delete this._persisted.shadowSkills[data.data.skill_name];
48574
+ this._persistState();
48575
+ }
48576
+ this.emit("shadow_session_deleted", data.data);
48577
+ }
48532
48578
  if (data.event === "hub_identity_removed") {
48533
48579
  if (this._persisted) {
48534
48580
  delete this._persisted.hubAddress;