@claude-flow/security 3.0.0-alpha.7 → 3.0.0-alpha.9

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 (61) hide show
  1. package/.claude-flow/data/pending-insights.jsonl +6 -0
  2. package/.claude-flow/neural/stats.json +6 -0
  3. package/README.md +292 -234
  4. package/__tests__/acceptance/security-compliance.test.ts +674 -674
  5. package/__tests__/authorization-propagator.test.ts +155 -0
  6. package/__tests__/credential-generator.test.ts +310 -310
  7. package/__tests__/fixtures/configurations.ts +425 -425
  8. package/__tests__/fixtures/index.ts +21 -21
  9. package/__tests__/helpers/create-mock.ts +469 -469
  10. package/__tests__/helpers/index.ts +32 -32
  11. package/__tests__/input-validator.test.ts +382 -382
  12. package/__tests__/integration/security-flow.test.ts +606 -606
  13. package/__tests__/password-hasher.test.ts +239 -239
  14. package/__tests__/path-validator.test.ts +302 -302
  15. package/__tests__/plugin-integrity-verifier.test.ts +199 -0
  16. package/__tests__/safe-executor.test.ts +292 -292
  17. package/__tests__/token-generator.test.ts +371 -371
  18. package/__tests__/tool-output-guardrail.test.ts +256 -0
  19. package/__tests__/unit/credential-generator.test.ts +182 -182
  20. package/__tests__/unit/password-hasher.test.ts +359 -359
  21. package/__tests__/unit/path-validator.test.ts +509 -509
  22. package/__tests__/unit/safe-executor.test.ts +667 -667
  23. package/__tests__/unit/token-generator.test.ts +310 -310
  24. package/dist/authorization/propagator.d.ts +148 -0
  25. package/dist/authorization/propagator.d.ts.map +1 -0
  26. package/dist/authorization/propagator.js +182 -0
  27. package/dist/authorization/propagator.js.map +1 -0
  28. package/dist/credential-generator.js +9 -9
  29. package/dist/index.d.ts +3 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +10 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/plugins/integrity-verifier.d.ts +125 -0
  34. package/dist/plugins/integrity-verifier.d.ts.map +1 -0
  35. package/dist/plugins/integrity-verifier.js +186 -0
  36. package/dist/plugins/integrity-verifier.js.map +1 -0
  37. package/dist/tool-output-guardrail.d.ts +126 -0
  38. package/dist/tool-output-guardrail.d.ts.map +1 -0
  39. package/dist/tool-output-guardrail.js +257 -0
  40. package/dist/tool-output-guardrail.js.map +1 -0
  41. package/package.json +27 -27
  42. package/ruvector.db +0 -0
  43. package/src/CVE-REMEDIATION.ts +251 -251
  44. package/src/application/index.ts +10 -10
  45. package/src/application/services/security-application-service.ts +193 -193
  46. package/src/authorization/propagator.ts +279 -0
  47. package/src/credential-generator.ts +368 -368
  48. package/src/domain/entities/security-context.ts +173 -173
  49. package/src/domain/index.ts +17 -17
  50. package/src/domain/services/security-domain-service.ts +296 -296
  51. package/src/index.ts +314 -271
  52. package/src/input-validator.ts +466 -466
  53. package/src/password-hasher.ts +277 -277
  54. package/src/path-validator.ts +525 -525
  55. package/src/plugins/integrity-verifier.ts +265 -0
  56. package/src/safe-executor.ts +546 -546
  57. package/src/token-generator.ts +463 -463
  58. package/src/tool-output-guardrail.ts +360 -0
  59. package/tsconfig.json +9 -9
  60. package/tsconfig.tsbuildinfo +1 -1
  61. package/vitest.config.ts +20 -20
@@ -0,0 +1,148 @@
1
+ /**
2
+ * AgentAuthorizationPropagator — action-layer security for agent delegation.
3
+ *
4
+ * Implements P1 of ADR-144 (ruvnet/ruflo#2248): scope-envelope on SendMessage
5
+ * + per-action authorization checks. P2-P5 wire this into the comms layer,
6
+ * MCP dispatcher, MCP auth validator, and provenance log respectively.
7
+ *
8
+ * Threat model
9
+ * ------------
10
+ * When agent A delegates a task to agent B via SendMessage, B can today
11
+ * escalate the granted scope by calling tools A was never authorized to
12
+ * invoke. RBAC/ABAC on agent roles do not solve this — roles don't compose
13
+ * under dynamic LLM delegation (arXiv:2605.05440, Grade A formal analysis).
14
+ *
15
+ * The fix is scope-based propagation: every SendMessage carries an
16
+ * `AuthScope` that is *monotonically reducing* — each hop can drop tools or
17
+ * servers from the granted set but never add them. This is the same shape
18
+ * as OAuth scope reduction; adding back a tool requires talking to the
19
+ * original principal out-of-band.
20
+ *
21
+ * Scope
22
+ * -----
23
+ * - P1 (this file): the component, the envelope, the type-level invariants.
24
+ * No call sites yet — adding the wrapping/enforcement in P2-P4.
25
+ * - All operations synchronous, pure, allocation-light. Targets < 1 ms p99
26
+ * for `wrapOutbound` + `checkToolCall` so it can sit on every SendMessage.
27
+ *
28
+ * Backwards compatibility
29
+ * -----------------------
30
+ * `scope` on the envelope is optional in v1. Agents without scope set
31
+ * operate in legacy permissive mode (all tools allowed, depth unlimited,
32
+ * server auth unchecked). `CLAUDE_FLOW_STRICT_AUTH=true` enables enforcement.
33
+ *
34
+ * Reference: ADR-144, arXiv:2605.05440 (Authorization Propagation),
35
+ * arXiv:2605.28914 (AIRGuard), arXiv:2605.22333 (MCP auth survey).
36
+ */
37
+ /** Scope granted to an agent at a delegation hop. Monotonically reducing. */
38
+ export interface AuthScope {
39
+ /** Stable identifier of the originating principal (agent or user). */
40
+ readonly principalId: string;
41
+ /** MCP tool IDs this scope is allowed to call. */
42
+ readonly grantedTools: ReadonlyArray<string>;
43
+ /** MCP server IDs whose tool responses this scope will accept. */
44
+ readonly grantedServers: ReadonlyArray<string>;
45
+ /** Max remaining delegation hops. Decrements on every `wrapOutbound`. */
46
+ readonly delegationDepth: number;
47
+ /** Unix ms after which this scope is no longer valid. */
48
+ readonly expiresAt: number;
49
+ /**
50
+ * Optional opaque ID for cross-referencing with ADR-144 P5 provenance log
51
+ * and ADR-146 telemetry events. Callers should treat as a correlation
52
+ * handle, not a security claim.
53
+ */
54
+ readonly scopeId?: string;
55
+ }
56
+ /** Envelope shape attached to every SendMessage when strict-auth is on. */
57
+ export interface SendMessageEnvelope<T = unknown> {
58
+ /** Authorization scope governing what the receiver may do. */
59
+ readonly scope: AuthScope;
60
+ /** The original SendMessage payload, untouched. */
61
+ readonly payload: T;
62
+ }
63
+ /** Decision returned by `checkToolCall`. Never throws. */
64
+ export interface ToolCallDecision {
65
+ readonly allowed: boolean;
66
+ /** Human-readable reason; stable enough to match in tests/telemetry. */
67
+ readonly reason?: 'tool-not-in-scope' | 'server-not-in-scope' | 'scope-expired' | 'delegation-depth-exhausted' | 'principal-mismatch';
68
+ }
69
+ /**
70
+ * Wrap-failure reasons surfaced to callers as a typed error. We use a
71
+ * discriminated union rather than throwing so the comms layer (P2) can
72
+ * decide whether to drop the SendMessage or surface to the user.
73
+ */
74
+ export declare class AuthorizationPropagationError extends Error {
75
+ readonly code: 'scope-cannot-grow' | 'depth-underflow' | 'scope-expired' | 'principal-mismatch';
76
+ constructor(code: 'scope-cannot-grow' | 'depth-underflow' | 'scope-expired' | 'principal-mismatch', message: string);
77
+ }
78
+ /**
79
+ * Construct a default permissive scope. Used in legacy mode when no scope
80
+ * was attached upstream. Callers SHOULD migrate to explicit scopes; this is
81
+ * here so the propagator never has to special-case "no scope".
82
+ */
83
+ export declare function makeLegacyPermissiveScope(principalId?: string): AuthScope;
84
+ /**
85
+ * `AgentAuthorizationPropagator` — the load-bearing component for ADR-144.
86
+ *
87
+ * Construction is intentionally cheap (no I/O, no async). Callers can build
88
+ * a fresh instance per task without overhead, or share one — it holds no
89
+ * mutable state beyond the optional provenance buffer.
90
+ */
91
+ export declare class AgentAuthorizationPropagator {
92
+ private readonly opts;
93
+ /**
94
+ * In-memory provenance buffer. P5 will flush this to the structured
95
+ * telemetry sink (ADR-146 GuardrailEvent shape). For P1 we just retain
96
+ * the last N events for inspection/tests.
97
+ */
98
+ private readonly provenance;
99
+ constructor(opts?: {
100
+ provenanceBufferMax?: number;
101
+ });
102
+ /**
103
+ * Attach a reduced scope to an outbound SendMessage.
104
+ *
105
+ * Invariants enforced (throws `AuthorizationPropagationError` on violation):
106
+ * - newly granted tools MUST be a subset of `currentScope.grantedTools`
107
+ * - newly granted servers MUST be a subset of `currentScope.grantedServers`
108
+ * - delegationDepth MUST decrement by ≥ 1 (must remain ≥ 0)
109
+ * - principalId is propagated unchanged
110
+ * - expiresAt cannot be extended; copied from the holder
111
+ */
112
+ wrapOutbound<T>(payload: T, currentScope: AuthScope, requested?: {
113
+ tools?: ReadonlyArray<string>;
114
+ servers?: ReadonlyArray<string>;
115
+ }): SendMessageEnvelope<T>;
116
+ /**
117
+ * Validate a single tool call against a scope. Pure; never throws. Use the
118
+ * result's `allowed` to make the dispatch decision.
119
+ */
120
+ checkToolCall(toolId: string, scope: AuthScope, opts?: {
121
+ serverId?: string;
122
+ now?: number;
123
+ }): ToolCallDecision;
124
+ /**
125
+ * Verify an MCP server presented a valid credential before its response is
126
+ * consumed. P1 ships a permissive default (any non-empty credential is
127
+ * accepted) so the API is stable; P4 wires this to a real validator.
128
+ *
129
+ * Returns `false` on missing/empty credential; callers MUST treat `false`
130
+ * as a hard reject (same rule as ADR-131 reject findings).
131
+ */
132
+ verifyServerAuth(serverId: string, credential: unknown): boolean;
133
+ /**
134
+ * Record an action in the provenance buffer. P5 will route to telemetry;
135
+ * P1 keeps the last N events for test inspection and post-incident audit.
136
+ */
137
+ recordAction(agentId: string, toolId: string, scope: AuthScope, outcome: 'allowed' | 'denied', reason?: string): void;
138
+ /** Read-only view of recorded provenance for tests + audit CLI (P5). */
139
+ getProvenance(): ReadonlyArray<{
140
+ agentId: string;
141
+ toolId: string;
142
+ scope: AuthScope;
143
+ outcome: 'allowed' | 'denied';
144
+ reason?: string;
145
+ ts: number;
146
+ }>;
147
+ }
148
+ //# sourceMappingURL=propagator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/authorization/propagator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,SAAS;IACxB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,kEAAkE;IAClE,QAAQ,CAAC,cAAc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AE,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;KAAO,GACjF,mBAAmB,CAAC,CAAC,CAAC;IAsCzB;;;OAGG;IACH,aAAa,CACX,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7C,gBAAgB;IAanB;;;;;;;OAOG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO;IAOhE;;;OAGG;IACH,YAAY,CACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,GAAG,QAAQ,EAC7B,MAAM,CAAC,EAAE,MAAM,GACd,IAAI;IAMP,wEAAwE;IACxE,aAAa,IAAI,aAAa,CAAC;QAC7B,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,SAAS,CAAC;QACjB,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAC;QAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CAGH"}
@@ -0,0 +1,182 @@
1
+ /**
2
+ * AgentAuthorizationPropagator — action-layer security for agent delegation.
3
+ *
4
+ * Implements P1 of ADR-144 (ruvnet/ruflo#2248): scope-envelope on SendMessage
5
+ * + per-action authorization checks. P2-P5 wire this into the comms layer,
6
+ * MCP dispatcher, MCP auth validator, and provenance log respectively.
7
+ *
8
+ * Threat model
9
+ * ------------
10
+ * When agent A delegates a task to agent B via SendMessage, B can today
11
+ * escalate the granted scope by calling tools A was never authorized to
12
+ * invoke. RBAC/ABAC on agent roles do not solve this — roles don't compose
13
+ * under dynamic LLM delegation (arXiv:2605.05440, Grade A formal analysis).
14
+ *
15
+ * The fix is scope-based propagation: every SendMessage carries an
16
+ * `AuthScope` that is *monotonically reducing* — each hop can drop tools or
17
+ * servers from the granted set but never add them. This is the same shape
18
+ * as OAuth scope reduction; adding back a tool requires talking to the
19
+ * original principal out-of-band.
20
+ *
21
+ * Scope
22
+ * -----
23
+ * - P1 (this file): the component, the envelope, the type-level invariants.
24
+ * No call sites yet — adding the wrapping/enforcement in P2-P4.
25
+ * - All operations synchronous, pure, allocation-light. Targets < 1 ms p99
26
+ * for `wrapOutbound` + `checkToolCall` so it can sit on every SendMessage.
27
+ *
28
+ * Backwards compatibility
29
+ * -----------------------
30
+ * `scope` on the envelope is optional in v1. Agents without scope set
31
+ * operate in legacy permissive mode (all tools allowed, depth unlimited,
32
+ * server auth unchecked). `CLAUDE_FLOW_STRICT_AUTH=true` enables enforcement.
33
+ *
34
+ * Reference: ADR-144, arXiv:2605.05440 (Authorization Propagation),
35
+ * arXiv:2605.28914 (AIRGuard), arXiv:2605.22333 (MCP auth survey).
36
+ */
37
+ /**
38
+ * Wrap-failure reasons surfaced to callers as a typed error. We use a
39
+ * discriminated union rather than throwing so the comms layer (P2) can
40
+ * decide whether to drop the SendMessage or surface to the user.
41
+ */
42
+ export class AuthorizationPropagationError extends Error {
43
+ code;
44
+ constructor(code, message) {
45
+ super(message);
46
+ this.code = code;
47
+ this.name = 'AuthorizationPropagationError';
48
+ }
49
+ }
50
+ /**
51
+ * Construct a default permissive scope. Used in legacy mode when no scope
52
+ * was attached upstream. Callers SHOULD migrate to explicit scopes; this is
53
+ * here so the propagator never has to special-case "no scope".
54
+ */
55
+ export function makeLegacyPermissiveScope(principalId = 'legacy') {
56
+ return {
57
+ principalId,
58
+ grantedTools: ['*'], // sentinel — see `checkToolCall`
59
+ grantedServers: ['*'],
60
+ delegationDepth: Number.MAX_SAFE_INTEGER,
61
+ expiresAt: Number.MAX_SAFE_INTEGER,
62
+ };
63
+ }
64
+ /**
65
+ * `AgentAuthorizationPropagator` — the load-bearing component for ADR-144.
66
+ *
67
+ * Construction is intentionally cheap (no I/O, no async). Callers can build
68
+ * a fresh instance per task without overhead, or share one — it holds no
69
+ * mutable state beyond the optional provenance buffer.
70
+ */
71
+ export class AgentAuthorizationPropagator {
72
+ opts;
73
+ /**
74
+ * In-memory provenance buffer. P5 will flush this to the structured
75
+ * telemetry sink (ADR-146 GuardrailEvent shape). For P1 we just retain
76
+ * the last N events for inspection/tests.
77
+ */
78
+ provenance = [];
79
+ constructor(opts = {}) {
80
+ this.opts = opts;
81
+ }
82
+ /**
83
+ * Attach a reduced scope to an outbound SendMessage.
84
+ *
85
+ * Invariants enforced (throws `AuthorizationPropagationError` on violation):
86
+ * - newly granted tools MUST be a subset of `currentScope.grantedTools`
87
+ * - newly granted servers MUST be a subset of `currentScope.grantedServers`
88
+ * - delegationDepth MUST decrement by ≥ 1 (must remain ≥ 0)
89
+ * - principalId is propagated unchanged
90
+ * - expiresAt cannot be extended; copied from the holder
91
+ */
92
+ wrapOutbound(payload, currentScope, requested = {}) {
93
+ if (currentScope.delegationDepth <= 0) {
94
+ throw new AuthorizationPropagationError('depth-underflow', `cannot delegate further — delegationDepth=${currentScope.delegationDepth}`);
95
+ }
96
+ const now = Date.now();
97
+ if (currentScope.expiresAt <= now) {
98
+ throw new AuthorizationPropagationError('scope-expired', `scope expired at ${new Date(currentScope.expiresAt).toISOString()}`);
99
+ }
100
+ const reducedTools = subsetOrThrow(currentScope.grantedTools, requested.tools ?? currentScope.grantedTools, 'tools');
101
+ const reducedServers = subsetOrThrow(currentScope.grantedServers, requested.servers ?? currentScope.grantedServers, 'servers');
102
+ const reducedScope = {
103
+ principalId: currentScope.principalId,
104
+ grantedTools: reducedTools,
105
+ grantedServers: reducedServers,
106
+ delegationDepth: currentScope.delegationDepth - 1,
107
+ expiresAt: currentScope.expiresAt,
108
+ scopeId: currentScope.scopeId,
109
+ };
110
+ return { scope: reducedScope, payload };
111
+ }
112
+ /**
113
+ * Validate a single tool call against a scope. Pure; never throws. Use the
114
+ * result's `allowed` to make the dispatch decision.
115
+ */
116
+ checkToolCall(toolId, scope, opts = {}) {
117
+ const now = opts.now ?? Date.now();
118
+ if (scope.expiresAt <= now)
119
+ return { allowed: false, reason: 'scope-expired' };
120
+ if (!matchesScopeList(scope.grantedTools, toolId)) {
121
+ return { allowed: false, reason: 'tool-not-in-scope' };
122
+ }
123
+ if (opts.serverId && !matchesScopeList(scope.grantedServers, opts.serverId)) {
124
+ return { allowed: false, reason: 'server-not-in-scope' };
125
+ }
126
+ return { allowed: true };
127
+ }
128
+ /**
129
+ * Verify an MCP server presented a valid credential before its response is
130
+ * consumed. P1 ships a permissive default (any non-empty credential is
131
+ * accepted) so the API is stable; P4 wires this to a real validator.
132
+ *
133
+ * Returns `false` on missing/empty credential; callers MUST treat `false`
134
+ * as a hard reject (same rule as ADR-131 reject findings).
135
+ */
136
+ verifyServerAuth(serverId, credential) {
137
+ if (!serverId || typeof serverId !== 'string')
138
+ return false;
139
+ if (credential == null)
140
+ return false;
141
+ if (typeof credential === 'string' && credential.trim().length === 0)
142
+ return false;
143
+ return true;
144
+ }
145
+ /**
146
+ * Record an action in the provenance buffer. P5 will route to telemetry;
147
+ * P1 keeps the last N events for test inspection and post-incident audit.
148
+ */
149
+ recordAction(agentId, toolId, scope, outcome, reason) {
150
+ const max = this.opts.provenanceBufferMax ?? 1024;
151
+ this.provenance.push({ agentId, toolId, scope, outcome, reason, ts: Date.now() });
152
+ if (this.provenance.length > max)
153
+ this.provenance.splice(0, this.provenance.length - max);
154
+ }
155
+ /** Read-only view of recorded provenance for tests + audit CLI (P5). */
156
+ getProvenance() {
157
+ return this.provenance.slice();
158
+ }
159
+ }
160
+ // ─── helpers ────────────────────────────────────────────────────────────
161
+ function subsetOrThrow(parent, requested, kind) {
162
+ if (parent.includes('*'))
163
+ return Array.from(new Set(requested));
164
+ for (const item of requested) {
165
+ if (!parent.includes(item) && item !== '*') {
166
+ throw new AuthorizationPropagationError('scope-cannot-grow', `cannot grant ${kind} '${item}' — not in parent scope`);
167
+ }
168
+ }
169
+ // De-duplicate; preserve requested order
170
+ const seen = new Set();
171
+ const out = [];
172
+ for (const r of requested)
173
+ if (!seen.has(r))
174
+ (seen.add(r), out.push(r));
175
+ return out;
176
+ }
177
+ function matchesScopeList(list, item) {
178
+ if (list.includes('*'))
179
+ return true;
180
+ return list.includes(item);
181
+ }
182
+ //# sourceMappingURL=propagator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propagator.js","sourceRoot":"","sources":["../../src/authorization/propagator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AA0CH;;;;GAIG;AACH,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IAEpC;IADlB,YACkB,IAIQ,EACxB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAPC,SAAI,GAAJ,IAAI,CAII;QAIxB,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAC9C,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,WAAW,GAAG,QAAQ;IAC9D,OAAO;QACL,WAAW;QACX,YAAY,EAAE,CAAC,GAAG,CAAC,EAAM,iCAAiC;QAC1D,cAAc,EAAE,CAAC,GAAG,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC,gBAAgB;QACxC,SAAS,EAAE,MAAM,CAAC,gBAAgB;KACnC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;IAeV;IAd7B;;;;OAIG;IACc,UAAU,GAOtB,EAAE,CAAC;IAER,YAA6B,OAAyC,EAAE;QAA3C,SAAI,GAAJ,IAAI,CAAuC;IAAG,CAAC;IAE5E;;;;;;;;;OASG;IACH,YAAY,CACV,OAAU,EACV,YAAuB,EACvB,YAAgF,EAAE;QAElF,IAAI,YAAY,CAAC,eAAe,IAAI,CAAC,EAAE,CAAC;YACtC,MAAM,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xE,aAAa;QAQX,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CACF;AAED,2EAA2E;AAE3E,SAAS,aAAa,CACpB,MAA6B,EAC7B,SAAgC,EAChC,IAAyB;IAEzB,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAChE,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YAC3C,MAAM,IAAI,6BAA6B,CACrC,mBAAmB,EACnB,gBAAgB,IAAI,KAAK,IAAI,yBAAyB,CACvD,CAAC;QACJ,CAAC;IACH,CAAC;IACD,yCAAyC;IACzC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,SAAS;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,gBAAgB,CAAC,IAA2B,EAAE,IAAY;IACjE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
@@ -223,15 +223,15 @@ export class CredentialGenerator {
223
223
  * @returns Environment variable export script
224
224
  */
225
225
  createEnvScript(credentials) {
226
- return `# Claude Flow V3 - Generated Credentials
227
- # Generated: ${credentials.generatedAt.toISOString()}
228
- # IMPORTANT: Store these securely and delete this file after use
229
-
230
- export CLAUDE_FLOW_ADMIN_PASSWORD="${credentials.adminPassword}"
231
- export CLAUDE_FLOW_SERVICE_PASSWORD="${credentials.servicePassword}"
232
- export CLAUDE_FLOW_JWT_SECRET="${credentials.jwtSecret}"
233
- export CLAUDE_FLOW_SESSION_SECRET="${credentials.sessionSecret}"
234
- export CLAUDE_FLOW_ENCRYPTION_KEY="${credentials.encryptionKey}"
226
+ return `# Claude Flow V3 - Generated Credentials
227
+ # Generated: ${credentials.generatedAt.toISOString()}
228
+ # IMPORTANT: Store these securely and delete this file after use
229
+
230
+ export CLAUDE_FLOW_ADMIN_PASSWORD="${credentials.adminPassword}"
231
+ export CLAUDE_FLOW_SERVICE_PASSWORD="${credentials.servicePassword}"
232
+ export CLAUDE_FLOW_JWT_SECRET="${credentials.jwtSecret}"
233
+ export CLAUDE_FLOW_SESSION_SECRET="${credentials.sessionSecret}"
234
+ export CLAUDE_FLOW_ENCRYPTION_KEY="${credentials.encryptionKey}"
235
235
  `;
236
236
  }
237
237
  /**
package/dist/index.d.ts CHANGED
@@ -19,6 +19,9 @@ export { SafeExecutor, SafeExecutorError, createDevelopmentExecutor, createReadO
19
19
  export { PathValidator, PathValidatorError, createProjectPathValidator, createFullProjectPathValidator, type PathValidatorConfig, type PathValidationResult, } from './path-validator.js';
20
20
  export { InputValidator, sanitizeString, sanitizeHtml, sanitizePath, SafeStringSchema, IdentifierSchema, FilenameSchema, EmailSchema, PasswordSchema, UUIDSchema, HttpsUrlSchema, UrlSchema, SemverSchema, PortSchema, IPv4Schema, IPSchema, UserRoleSchema, PermissionSchema, LoginRequestSchema, CreateUserSchema, CreateApiKeySchema, AgentTypeSchema, SpawnAgentSchema, TaskInputSchema, CommandArgumentSchema, PathSchema, SecurityConfigSchema, ExecutorConfigSchema, PATTERNS, LIMITS, z, } from './input-validator.js';
21
21
  export { TokenGenerator, TokenGeneratorError, createTokenGenerator, getDefaultGenerator, quickGenerate, type TokenConfig, type Token, type SignedToken, type VerificationCode, } from './token-generator.js';
22
+ export { ToolOutputGuardrail, createToolOutputGuardrail, isToolOutputSafe, type GuardrailConfig, type GuardrailResult, type GuardrailAction, type InjectionFinding, type InjectionSeverity, type InjectionCategory, } from './tool-output-guardrail.js';
23
+ export { AgentAuthorizationPropagator, AuthorizationPropagationError, makeLegacyPermissiveScope, type AuthScope, type SendMessageEnvelope, type ToolCallDecision, } from './authorization/propagator.js';
24
+ export { PluginIntegrityVerifier, canonicalize, hashManifest, fingerprint, findAnchor, type PluginManifest, type SignedPluginManifest, type TrustAnchor, type TrustAnchors, type VerificationStatus, type VerificationResult, type VerifierConfig, } from './plugins/integrity-verifier.js';
22
25
  import { PasswordHasher } from './password-hasher.js';
23
26
  import { CredentialGenerator } from './credential-generator.js';
24
27
  import { SafeExecutor } from './safe-executor.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,0BAA0B,EAC1B,8BAA8B,EAC9B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EAEZ,g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@@ -37,6 +37,16 @@ SecurityConfigSchema, ExecutorConfigSchema,
37
37
  PATTERNS, LIMITS, z, } from './input-validator.js';
38
38
  // Token Generation
39
39
  export { TokenGenerator, TokenGeneratorError, createTokenGenerator, getDefaultGenerator, quickGenerate, } from './token-generator.js';
40
+ // Tool-Output Guardrail (ADR-131 — closes OWASP ASI01 gap; ruvnet/ruflo#2149)
41
+ export { ToolOutputGuardrail, createToolOutputGuardrail, isToolOutputSafe, } from './tool-output-guardrail.js';
42
+ // Agent Authorization Propagation (ADR-144 P1 — ruvnet/ruflo#2248)
43
+ // Action-layer: SendMessage envelope + per-action scope check + MCP server
44
+ // identity probe. Wraps the comms layer in P2; wraps the dispatcher in P3.
45
+ export { AgentAuthorizationPropagator, AuthorizationPropagationError, makeLegacyPermissiveScope, } from './authorization/propagator.js';
46
+ // Plugin Integrity Verifier (ADR-145 P1 — ruvnet/ruflo#2254)
47
+ // Install-layer: Ed25519 signature verification + trust-anchor allowlist.
48
+ // Stage-2 semantic-intent scan (SCH defence) lands in P2.
49
+ export { PluginIntegrityVerifier, canonicalize, hashManifest, fingerprint, findAnchor, } from './plugins/integrity-verifier.js';
40
50
  // ============================================================================
41
51
  // Convenience Factory Functions
42
52
  // ============================================================================
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,+BAA+B;AAC/B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,oBAAoB,GAGrB,MAAM,sBAAsB,CAAC;AAE9B,oCAAoC;AACpC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,GAIpB,MAAM,2BAA2B,CAAC;AAEnC,sCAAsC;AACtC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,GAIvB,MAAM,oBAAoB,CAAC;AAE5B,+BAA+B;AAC/B,OAA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6C,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClE,QAAQ,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * PluginIntegrityVerifier — install-layer security for plugin supply chain.
3
+ *
4
+ * Implements P1 of ADR-145 (ruvnet/ruflo#2254): Stage-1 Ed25519 signature
5
+ * verification at `plugins install`. Stage-2 (semantic-intent scan against
6
+ * SCH attacks) lands in P2; per-namespace write ACLs land in P3-P4.
7
+ *
8
+ * Threat model
9
+ * ------------
10
+ * Ruflo's plugin install path fetches manifests from IPFS via Pinata with
11
+ * NO signature verification and NO intent analysis. Two attacks land today:
12
+ *
13
+ * - DDIPE (arXiv:2604.03081): malicious logic embedded in plugin docs and
14
+ * config templates. 11.6-33.5% bypass rate across 4 frameworks/5 models;
15
+ * 2.5% evade both detection and alignment. Stage-1 signing blocks the
16
+ * static-payload variants.
17
+ *
18
+ * - SCH (arXiv:2605.14460): malicious intent wrapped as natural-language
19
+ * "compliance rules" in plugin descriptions. The agent generates the
20
+ * harmful code at runtime — no static payload exists. 77.67% breach
21
+ * success, 0.00% scanner detection. Stage-2 (P2) catches this; Stage-1
22
+ * does not.
23
+ *
24
+ * Scope (P1)
25
+ * ----------
26
+ * - Ed25519 signature verification of a detached signature over the manifest.
27
+ * - Trust-anchor allowlist: the publisher's signing key fingerprint must be
28
+ * in `trust-anchors.json`, gated on CODEOWNERS review.
29
+ * - Backwards compatible: default mode is warn-only. `CLAUDE_FLOW_STRICT_PLUGINS=true`
30
+ * makes verification a hard gate.
31
+ *
32
+ * Non-goals (P1)
33
+ * --------------
34
+ * - Semantic intent scan (SCH defence). Lands in P2 with a pattern-rule
35
+ * fallback for environments without LLM credentials.
36
+ * - Sandboxing the plugin runtime. Orthogonal blast-radius concern.
37
+ *
38
+ * Reference: ADR-145, arXiv:2605.14460 (SCH), arXiv:2604.03081 (DDIPE),
39
+ * arXiv:2604.16548 (Mnemonic Sovereignty survey).
40
+ */
41
+ export interface PluginManifest {
42
+ readonly id: string;
43
+ readonly version: string;
44
+ /** Anything else; only `id` + `version` matter for the integrity hash. */
45
+ readonly [extra: string]: unknown;
46
+ }
47
+ export interface SignedPluginManifest {
48
+ readonly manifest: PluginManifest;
49
+ /** Hex-encoded SHA-256 of the canonical JSON serialisation of manifest. */
50
+ readonly manifestHash: string;
51
+ /** Hex-encoded detached Ed25519 signature over `manifestHash` bytes. */
52
+ readonly signature: string;
53
+ /** Hex-encoded Ed25519 public key of the signer. */
54
+ readonly publicKey: string;
55
+ }
56
+ export interface TrustAnchor {
57
+ /** Hex-encoded Ed25519 public key the publisher signs with. */
58
+ readonly publicKey: string;
59
+ /** Human-readable owner — for audit, not for trust decisions. */
60
+ readonly owner: string;
61
+ /** Optional ISO 8601 date after which this anchor is no longer trusted. */
62
+ readonly expiresAt?: string;
63
+ /** Optional plugin id glob this anchor is authoritative for (e.g. `@claude-flow/*`). */
64
+ readonly scope?: string;
65
+ }
66
+ export interface TrustAnchors {
67
+ readonly version: 1;
68
+ readonly anchors: ReadonlyArray<TrustAnchor>;
69
+ }
70
+ export type VerificationStatus = 'pass' | 'signature-missing' | 'signature-invalid' | 'manifest-hash-mismatch' | 'unknown-signer' | 'signer-expired' | 'signer-out-of-scope';
71
+ export interface VerificationResult {
72
+ readonly status: VerificationStatus;
73
+ readonly pluginId: string;
74
+ readonly signerFingerprint?: string;
75
+ /** Verification timestamp — useful for telemetry correlation. */
76
+ readonly ts: number;
77
+ /** Operator-facing detail; do not parse — log only. */
78
+ readonly detail?: string;
79
+ }
80
+ export interface VerifierConfig {
81
+ readonly trustAnchors: TrustAnchors;
82
+ /**
83
+ * When true, `verify` returns the actual failure status. When false (legacy
84
+ * mode), `verify` returns the failure status BUT callers may choose to
85
+ * proceed with a warning — the strictness gate lives at the caller, not
86
+ * here, so the verifier itself is always pure.
87
+ */
88
+ readonly strict?: boolean;
89
+ /** Optional now-provider for tests. */
90
+ readonly now?: () => number;
91
+ }
92
+ /**
93
+ * Canonical JSON serialisation for hashing. Deterministic key ordering at
94
+ * every nesting level. Pure; identical input → identical output bytes.
95
+ */
96
+ export declare function canonicalize(value: unknown): string;
97
+ /** Hex-encoded SHA-256 of the canonical-JSON manifest. */
98
+ export declare function hashManifest(manifest: PluginManifest): string;
99
+ /** Short fingerprint for telemetry — first 16 hex chars of the key. */
100
+ export declare function fingerprint(publicKey: string): string;
101
+ /**
102
+ * Find the trust anchor that vouches for a manifest. Returns the matched
103
+ * anchor (with anchor.publicKey === signer.publicKey) or null.
104
+ *
105
+ * Scope-matching uses a minimal glob: `*` at the end of the scope string
106
+ * matches any suffix. Empty/missing scope matches every plugin id.
107
+ */
108
+ export declare function findAnchor(anchors: ReadonlyArray<TrustAnchor>, pluginId: string, signerPublicKey: string, now: number): TrustAnchor | null;
109
+ /**
110
+ * `PluginIntegrityVerifier` — Stage-1 verifier (signature + trust anchor).
111
+ *
112
+ * Pure-ish: holds the trust-anchor list and clock, no other state. Safe to
113
+ * construct per-invocation or share.
114
+ */
115
+ export declare class PluginIntegrityVerifier {
116
+ private readonly config;
117
+ constructor(config: VerifierConfig);
118
+ /**
119
+ * Verify a signed manifest. Returns the verification status; the caller
120
+ * decides what to do with `signature-missing` / `manifest-hash-mismatch`
121
+ * etc. based on its strict-mode policy.
122
+ */
123
+ verify(signed: SignedPluginManifest): Promise<VerificationResult>;
124
+ }
125
+ //# sourceMappingURL=integrity-verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrity-verifier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