agent-passport-system 1.10.2 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -6
- package/dist/src/core/gateway.d.ts +41 -0
- package/dist/src/core/gateway.d.ts.map +1 -0
- package/dist/src/core/gateway.js +457 -0
- package/dist/src/core/gateway.js.map +1 -0
- package/dist/src/core/principal.d.ts.map +1 -1
- package/dist/src/core/principal.js +14 -12
- package/dist/src/core/principal.js.map +1 -1
- package/dist/src/core/reputation-authority.d.ts +147 -0
- package/dist/src/core/reputation-authority.d.ts.map +1 -0
- package/dist/src/core/reputation-authority.js +431 -0
- package/dist/src/core/reputation-authority.js.map +1 -0
- package/dist/src/core/vc.d.ts.map +1 -1
- package/dist/src/core/vc.js +3 -2
- package/dist/src/core/vc.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/gateway.d.ts +117 -0
- package/dist/src/types/gateway.d.ts.map +1 -0
- package/dist/src/types/gateway.js +12 -0
- package/dist/src/types/gateway.js.map +1 -0
- package/dist/src/types/reputation-authority.d.ts +137 -0
- package/dist/src/types/reputation-authority.d.ts.map +1 -0
- package/dist/src/types/reputation-authority.js +9 -0
- package/dist/src/types/reputation-authority.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/agent-passport-system)
|
|
4
4
|
[](https://github.com/aeoess/agent-passport-system/blob/main/LICENSE)
|
|
5
|
-
[](https://github.com/aeoess/agent-passport-system)
|
|
6
6
|
[](https://doi.org/10.5281/zenodo.18749779)
|
|
7
7
|
|
|
8
8
|
Cryptographic identity, ethical governance, economic attribution, protocol-native communication, intent architecture, cascade revocation, coordination primitives, and agentic commerce for autonomous AI agents.
|
|
9
9
|
|
|
10
|
-
**8 layers.
|
|
10
|
+
**8 layers. 511 tests. Zero heavy dependencies. Running code. MCP server included.**
|
|
11
11
|
|
|
12
12
|
> *As AI agents from different creators, running different models, serving different humans begin to collaborate — who is responsible, under what authority, according to what values, and who benefits?*
|
|
13
13
|
|
|
@@ -374,7 +374,7 @@ The protocol ships with a coordination-native MCP server — any MCP client (Cla
|
|
|
374
374
|
npm install agent-passport-system-mcp
|
|
375
375
|
```
|
|
376
376
|
|
|
377
|
-
**
|
|
377
|
+
**55 tools across all 8 layers, role-scoped access control.** Identity, delegation, agora, values/policy, coordination, and commerce — all accessible via MCP. Every operation Ed25519 signed.
|
|
378
378
|
|
|
379
379
|
```json
|
|
380
380
|
{
|
|
@@ -412,7 +412,7 @@ PyPI: [agent-passport-system](https://pypi.org/project/agent-passport-system/)
|
|
|
412
412
|
|
|
413
413
|
```bash
|
|
414
414
|
npm test
|
|
415
|
-
#
|
|
415
|
+
# 511 tests across 26 files, 145 suites, 0 failures
|
|
416
416
|
```
|
|
417
417
|
|
|
418
418
|
Includes 23 adversarial tests: Merkle tree tampering, attribution gaming resistance, compliance violations, floor negotiation attacks, wrong-key attestations.
|
|
@@ -444,7 +444,7 @@ By Tymofii Pidlisnyi — Published on Zenodo
|
|
|
444
444
|
| Communication | Signed Agora | — | — | — | — |
|
|
445
445
|
| Coordination | Task units + MCP server | — | — | — | — |
|
|
446
446
|
| Commerce | ACP + 4-gate enforcement | — | — | — | — |
|
|
447
|
-
| Tests |
|
|
447
|
+
| Tests | 481 (23 adversarial) | None | Limited | None | None |
|
|
448
448
|
| Dependencies | Node.js crypto + uuid | — | Multi-LLM | — | Consensus network |
|
|
449
449
|
|
|
450
450
|
## Structure
|
|
@@ -455,13 +455,23 @@ src/ 22 source files
|
|
|
455
455
|
core/
|
|
456
456
|
passport.ts — Ed25519 identity
|
|
457
457
|
delegation.ts — Scoped delegation, receipts, cascade revocation
|
|
458
|
+
canonical.ts — Deterministic JSON serialization
|
|
458
459
|
values.ts — Floor attestation, compliance, negotiation
|
|
459
460
|
attribution.ts — Merkle trees, beneficiary tracing
|
|
460
461
|
agora.ts — Protocol-native signed communication
|
|
461
462
|
intent.ts — Intent architecture, deliberation, roles
|
|
462
463
|
policy.ts — 3-signature chain, policy validation
|
|
463
464
|
coordination.ts — Task briefs, evidence, review, handoff, deliverables
|
|
465
|
+
integration.ts — Cross-layer bridges
|
|
464
466
|
commerce.ts — ACP checkout, 4-gate enforcement, spend tracking
|
|
467
|
+
context.ts — Agent context enforcement middleware
|
|
468
|
+
routing.ts — Task routing protocol
|
|
469
|
+
did.ts — W3C DID method (did:aps)
|
|
470
|
+
vc.ts — Verifiable Credentials
|
|
471
|
+
a2a.ts — Google A2A bridge
|
|
472
|
+
euaiact.ts — EU AI Act compliance
|
|
473
|
+
principal.ts — Principal identity, endorsement, fleet
|
|
474
|
+
reputation-authority.ts — Bayesian trust, tier authority, promotions
|
|
465
475
|
cli/
|
|
466
476
|
index.ts — CLI (14 commands)
|
|
467
477
|
crypto/
|
|
@@ -473,7 +483,13 @@ src/ 22 source files
|
|
|
473
483
|
policy.ts — Layer 6 types
|
|
474
484
|
coordination.ts — Layer 7 types
|
|
475
485
|
commerce.ts — Layer 8 types
|
|
476
|
-
|
|
486
|
+
context.ts — Agent context types
|
|
487
|
+
routing.ts — Routing types
|
|
488
|
+
did.ts — DID/VC types
|
|
489
|
+
euaiact.ts — EU AI Act types
|
|
490
|
+
principal.ts — Principal identity types
|
|
491
|
+
reputation-authority.ts — Reputation/tier types
|
|
492
|
+
tests/ 27 test files, 511 tests (145 suites)
|
|
477
493
|
adversarial.ts — 23 adversarial cases
|
|
478
494
|
agora.test.ts — 15 Agora tests
|
|
479
495
|
contract.test.ts — High-level API tests
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Delegation, FloorAttestation } from '../types/passport.js';
|
|
2
|
+
import type { PolicyDecision } from '../types/policy.js';
|
|
3
|
+
import type { ToolCallRequest, ToolCallResult, GatewayApproval, ToolExecutor, GatewayConfig, RegisteredAgent, GatewayStats } from '../types/gateway.js';
|
|
4
|
+
export declare class ProxyGateway {
|
|
5
|
+
private config;
|
|
6
|
+
private validator;
|
|
7
|
+
private agents;
|
|
8
|
+
private approvals;
|
|
9
|
+
private usedNonces;
|
|
10
|
+
private usedRequestIds;
|
|
11
|
+
private executor;
|
|
12
|
+
private stats;
|
|
13
|
+
constructor(config: GatewayConfig, executor: ToolExecutor);
|
|
14
|
+
registerAgent(passport: RegisteredAgent['passport'], attestation: FloorAttestation, delegations: Delegation[]): {
|
|
15
|
+
registered: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
};
|
|
18
|
+
unregisterAgent(agentId: string): boolean;
|
|
19
|
+
addDelegation(agentId: string, delegation: Delegation): {
|
|
20
|
+
added: boolean;
|
|
21
|
+
error?: string;
|
|
22
|
+
};
|
|
23
|
+
revokeDelegation(agentId: string, delegationId: string): boolean;
|
|
24
|
+
processToolCall(request: ToolCallRequest): Promise<ToolCallResult>;
|
|
25
|
+
approve(request: ToolCallRequest): {
|
|
26
|
+
approved: boolean;
|
|
27
|
+
approval?: GatewayApproval;
|
|
28
|
+
denial?: {
|
|
29
|
+
reason: string;
|
|
30
|
+
decision?: PolicyDecision;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
executeApproval(approvalId: string): Promise<ToolCallResult>;
|
|
34
|
+
clearExpired(): number;
|
|
35
|
+
getStats(): GatewayStats;
|
|
36
|
+
getAgentApprovals(agentId: string): GatewayApproval[];
|
|
37
|
+
private findDelegation;
|
|
38
|
+
private buildValidationContext;
|
|
39
|
+
}
|
|
40
|
+
export declare function createProxyGateway(config: GatewayConfig, executor: ToolExecutor): ProxyGateway;
|
|
41
|
+
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../src/core/gateway.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,UAAU,EAA8B,gBAAgB,EA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AAC,QAAQ,CAAC,EAAE,cAAc,CAAA;SAAE,CAAA;KAAE;IA4DtI,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA6DlE,YAAY,IAAI,MAAM;IAStB,QAAQ,IAAI,YAAY;IAExB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE;IAIrD,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,sBAAsB;CAgB/B;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,GAAG,YAAY,CAE9F"}
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
// ══════════════════════════════════════════════════════════════════
|
|
2
|
+
// Proxy Gateway — Enforcement Boundary
|
|
3
|
+
// ══════════════════════════════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// The gateway solves the core unsolved problem in the protocol:
|
|
6
|
+
// the enforcement boundary.
|
|
7
|
+
//
|
|
8
|
+
// Without gateway: SDK is an optional library. Agent can bypass it.
|
|
9
|
+
// With gateway: agent sends requests, gateway executes and proves.
|
|
10
|
+
// The agent never touches the receipt. Receipt generation moves
|
|
11
|
+
// from the agent to the enforcement layer.
|
|
12
|
+
//
|
|
13
|
+
// Architecture:
|
|
14
|
+
// Agent → [signed request] → Gateway → [policy check]
|
|
15
|
+
// → [execute tool] → [generate receipt] → [return result + proof]
|
|
16
|
+
//
|
|
17
|
+
// Six properties (from GPT/Gemini hostile review):
|
|
18
|
+
// 1. Gateway is the executor (not just the approver)
|
|
19
|
+
// 2. Exact parameter binding (tool + params + target + spend)
|
|
20
|
+
// 3. Revocation recheck at execution time
|
|
21
|
+
// 4. Gateway generates the receipt (not the agent)
|
|
22
|
+
// 5. Replay protection (same request can't be used twice)
|
|
23
|
+
// 6. Timeout on approvals (approval expires after N seconds)
|
|
24
|
+
//
|
|
25
|
+
// ══════════════════════════════════════════════════════════════════
|
|
26
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
27
|
+
import { verify } from '../crypto/keys.js';
|
|
28
|
+
import { canonicalize } from './canonical.js';
|
|
29
|
+
import { createActionIntent, evaluateIntent, createPolicyReceipt, FloorValidatorV1 } from './policy.js';
|
|
30
|
+
import { verifyDelegation, createReceipt, scopeAuthorizes, getRevocation } from './delegation.js';
|
|
31
|
+
import { verifyPassport } from '../verification/verify.js';
|
|
32
|
+
import { verifyAttestation } from './values.js';
|
|
33
|
+
// ══════════════════════════════════════
|
|
34
|
+
// PROXY GATEWAY CLASS
|
|
35
|
+
// ══════════════════════════════════════
|
|
36
|
+
export class ProxyGateway {
|
|
37
|
+
config;
|
|
38
|
+
validator;
|
|
39
|
+
agents = new Map();
|
|
40
|
+
approvals = new Map();
|
|
41
|
+
usedNonces = new Set();
|
|
42
|
+
usedRequestIds = new Set();
|
|
43
|
+
executor;
|
|
44
|
+
stats = {
|
|
45
|
+
totalRequests: 0,
|
|
46
|
+
totalPermitted: 0,
|
|
47
|
+
totalDenied: 0,
|
|
48
|
+
totalExecuted: 0,
|
|
49
|
+
totalToolErrors: 0,
|
|
50
|
+
replayAttemptsBlocked: 0,
|
|
51
|
+
expiredApprovalsCleared: 0,
|
|
52
|
+
revocationRechecksTriggered: 0,
|
|
53
|
+
activeAgents: 0,
|
|
54
|
+
pendingApprovals: 0
|
|
55
|
+
};
|
|
56
|
+
constructor(config, executor) {
|
|
57
|
+
this.config = {
|
|
58
|
+
approvalTTLSeconds: config.approvalTTLSeconds ?? 30,
|
|
59
|
+
maxPendingPerAgent: config.maxPendingPerAgent ?? 10,
|
|
60
|
+
recheckRevocationOnExecute: config.recheckRevocationOnExecute ?? true,
|
|
61
|
+
...config
|
|
62
|
+
};
|
|
63
|
+
this.validator = config.validator || new FloorValidatorV1();
|
|
64
|
+
this.executor = executor;
|
|
65
|
+
}
|
|
66
|
+
// ── Agent Registration ──
|
|
67
|
+
registerAgent(passport, attestation, delegations) {
|
|
68
|
+
// Verify passport (SignedPassport wraps AgentPassport)
|
|
69
|
+
const passportCheck = verifyPassport(passport);
|
|
70
|
+
if (!passportCheck.valid) {
|
|
71
|
+
return { registered: false, error: `Invalid passport: ${passportCheck.errors.join(', ')}` };
|
|
72
|
+
}
|
|
73
|
+
// Verify floor attestation
|
|
74
|
+
const attestationCheck = verifyAttestation(attestation);
|
|
75
|
+
if (!attestationCheck.valid) {
|
|
76
|
+
return { registered: false, error: `Invalid floor attestation: ${attestationCheck.errors.join(', ')}` };
|
|
77
|
+
}
|
|
78
|
+
// Verify each delegation
|
|
79
|
+
const delegationMap = new Map();
|
|
80
|
+
for (const d of delegations) {
|
|
81
|
+
const status = verifyDelegation(d);
|
|
82
|
+
if (status.valid && !status.expired && !status.revoked) {
|
|
83
|
+
delegationMap.set(d.delegationId, d);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const agentId = passport.passport.agentId;
|
|
87
|
+
this.agents.set(agentId, {
|
|
88
|
+
passport, attestation, delegations: delegationMap
|
|
89
|
+
});
|
|
90
|
+
this.stats.activeAgents = this.agents.size;
|
|
91
|
+
return { registered: true };
|
|
92
|
+
}
|
|
93
|
+
unregisterAgent(agentId) {
|
|
94
|
+
for (const [id, approval] of this.approvals) {
|
|
95
|
+
if (approval.agentId === agentId) {
|
|
96
|
+
this.approvals.delete(id);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const deleted = this.agents.delete(agentId);
|
|
100
|
+
this.stats.activeAgents = this.agents.size;
|
|
101
|
+
this.stats.pendingApprovals = Array.from(this.approvals.values()).filter(a => !a.consumed).length;
|
|
102
|
+
return deleted;
|
|
103
|
+
}
|
|
104
|
+
addDelegation(agentId, delegation) {
|
|
105
|
+
const agent = this.agents.get(agentId);
|
|
106
|
+
if (!agent)
|
|
107
|
+
return { added: false, error: 'Agent not registered' };
|
|
108
|
+
const status = verifyDelegation(delegation);
|
|
109
|
+
if (!status.valid)
|
|
110
|
+
return { added: false, error: `Invalid delegation: ${status.errors?.join(', ')}` };
|
|
111
|
+
if (status.expired)
|
|
112
|
+
return { added: false, error: 'Delegation expired' };
|
|
113
|
+
if (status.revoked)
|
|
114
|
+
return { added: false, error: 'Delegation revoked' };
|
|
115
|
+
agent.delegations.set(delegation.delegationId, delegation);
|
|
116
|
+
return { added: true };
|
|
117
|
+
}
|
|
118
|
+
revokeDelegation(agentId, delegationId) {
|
|
119
|
+
const agent = this.agents.get(agentId);
|
|
120
|
+
if (!agent)
|
|
121
|
+
return false;
|
|
122
|
+
const deleted = agent.delegations.delete(delegationId);
|
|
123
|
+
this.stats.pendingApprovals = Array.from(this.approvals.values()).filter(a => !a.consumed).length;
|
|
124
|
+
return deleted;
|
|
125
|
+
}
|
|
126
|
+
// ── Core: Process Tool Call ──
|
|
127
|
+
async processToolCall(request) {
|
|
128
|
+
this.stats.totalRequests++;
|
|
129
|
+
// Step 0: Replay protection
|
|
130
|
+
if (this.usedRequestIds.has(request.requestId)) {
|
|
131
|
+
this.stats.replayAttemptsBlocked++;
|
|
132
|
+
this.config.onSuspicious?.(request.agentId, `Replay attempt: requestId ${request.requestId}`);
|
|
133
|
+
return {
|
|
134
|
+
executed: false,
|
|
135
|
+
requestId: request.requestId,
|
|
136
|
+
denialReason: 'Replay detected: this requestId has already been processed'
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
// Step 1: Verify agent identity
|
|
140
|
+
const agent = this.agents.get(request.agentId);
|
|
141
|
+
if (!agent) {
|
|
142
|
+
this.stats.totalDenied++;
|
|
143
|
+
return { executed: false, requestId: request.requestId, denialReason: 'Agent not registered with gateway' };
|
|
144
|
+
}
|
|
145
|
+
// Verify request signature
|
|
146
|
+
const requestPayload = canonicalize({
|
|
147
|
+
requestId: request.requestId,
|
|
148
|
+
agentId: request.agentId,
|
|
149
|
+
tool: request.tool,
|
|
150
|
+
params: request.params,
|
|
151
|
+
scopeRequired: request.scopeRequired,
|
|
152
|
+
spend: request.spend
|
|
153
|
+
});
|
|
154
|
+
const sigValid = verify(requestPayload, request.signature, request.agentPublicKey);
|
|
155
|
+
if (!sigValid) {
|
|
156
|
+
this.stats.totalDenied++;
|
|
157
|
+
this.config.onSuspicious?.(request.agentId, 'Invalid request signature');
|
|
158
|
+
return { executed: false, requestId: request.requestId, denialReason: 'Invalid request signature' };
|
|
159
|
+
}
|
|
160
|
+
// Step 2: Find and verify delegation
|
|
161
|
+
const delegation = this.findDelegation(agent, request);
|
|
162
|
+
if (!delegation) {
|
|
163
|
+
this.stats.totalDenied++;
|
|
164
|
+
return {
|
|
165
|
+
executed: false, requestId: request.requestId,
|
|
166
|
+
denialReason: `No valid delegation covers scope "${request.scopeRequired}" for tool "${request.tool}"`
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const delegationStatus = verifyDelegation(delegation);
|
|
170
|
+
if (!delegationStatus.valid || delegationStatus.expired || delegationStatus.revoked) {
|
|
171
|
+
this.stats.totalDenied++;
|
|
172
|
+
return { executed: false, requestId: request.requestId, denialReason: `Delegation ${delegation.delegationId} is no longer valid` };
|
|
173
|
+
}
|
|
174
|
+
// Step 3: Create intent
|
|
175
|
+
const intent = createActionIntent({
|
|
176
|
+
agentId: this.config.gatewayId,
|
|
177
|
+
agentPublicKey: this.config.gatewayPublicKey,
|
|
178
|
+
privateKey: this.config.gatewayPrivateKey,
|
|
179
|
+
delegationId: delegation.delegationId,
|
|
180
|
+
action: {
|
|
181
|
+
type: request.tool,
|
|
182
|
+
target: JSON.stringify(request.params),
|
|
183
|
+
scopeRequired: request.scopeRequired,
|
|
184
|
+
spend: request.spend
|
|
185
|
+
},
|
|
186
|
+
context: `[Gateway ${this.config.gatewayId}] Proxy for ${request.agentId}: ${request.context || 'Tool call via proxy gateway'}`
|
|
187
|
+
});
|
|
188
|
+
// Step 4: Evaluate intent against policy
|
|
189
|
+
const validationCtx = this.buildValidationContext(agent, delegation);
|
|
190
|
+
const decision = evaluateIntent({
|
|
191
|
+
intent,
|
|
192
|
+
evaluatorId: this.config.gatewayId,
|
|
193
|
+
evaluatorPublicKey: this.config.gatewayPublicKey,
|
|
194
|
+
evaluatorPrivateKey: this.config.gatewayPrivateKey,
|
|
195
|
+
validator: this.validator,
|
|
196
|
+
validationContext: validationCtx
|
|
197
|
+
});
|
|
198
|
+
if (decision.verdict === 'deny') {
|
|
199
|
+
this.stats.totalDenied++;
|
|
200
|
+
this.usedRequestIds.add(request.requestId);
|
|
201
|
+
const result = { executed: false, requestId: request.requestId, denialReason: decision.reason, decision };
|
|
202
|
+
this.config.onToolCall?.(request, result);
|
|
203
|
+
return result;
|
|
204
|
+
}
|
|
205
|
+
// Step 5: Revocation recheck (paranoid mode)
|
|
206
|
+
if (this.config.recheckRevocationOnExecute) {
|
|
207
|
+
this.stats.revocationRechecksTriggered++;
|
|
208
|
+
const revocation = getRevocation(delegation.delegationId);
|
|
209
|
+
if (revocation) {
|
|
210
|
+
this.stats.totalDenied++;
|
|
211
|
+
this.usedRequestIds.add(request.requestId);
|
|
212
|
+
return { executed: false, requestId: request.requestId, denialReason: 'Delegation was revoked between approval and execution', decision };
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// Step 6: Execute the tool (GATEWAY executes, not agent)
|
|
216
|
+
this.stats.totalPermitted++;
|
|
217
|
+
let toolResult;
|
|
218
|
+
try {
|
|
219
|
+
toolResult = await this.executor(request.tool, request.params);
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
this.stats.totalToolErrors++;
|
|
223
|
+
this.usedRequestIds.add(request.requestId);
|
|
224
|
+
const result = { executed: true, requestId: request.requestId, toolError: err instanceof Error ? err.message : String(err), decision };
|
|
225
|
+
this.config.onToolCall?.(request, result);
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
if (!toolResult.success) {
|
|
229
|
+
this.stats.totalToolErrors++;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
this.stats.totalExecuted++;
|
|
233
|
+
}
|
|
234
|
+
// Step 7: Generate receipt (GATEWAY signs, not agent)
|
|
235
|
+
const receipt = createReceipt({
|
|
236
|
+
agentId: this.config.gatewayId,
|
|
237
|
+
delegationId: delegation.delegationId,
|
|
238
|
+
delegation: delegation,
|
|
239
|
+
action: {
|
|
240
|
+
type: `gateway:${request.tool}`,
|
|
241
|
+
target: JSON.stringify(request.params),
|
|
242
|
+
scopeUsed: request.scopeRequired,
|
|
243
|
+
spend: request.spend
|
|
244
|
+
},
|
|
245
|
+
result: {
|
|
246
|
+
status: toolResult.success ? 'success' : 'failure',
|
|
247
|
+
summary: toolResult.success
|
|
248
|
+
? `Executed ${request.tool} successfully`
|
|
249
|
+
: `Executed ${request.tool} with error: ${toolResult.error}`
|
|
250
|
+
},
|
|
251
|
+
delegationChain: [this.config.gatewayPublicKey],
|
|
252
|
+
privateKey: this.config.gatewayPrivateKey
|
|
253
|
+
});
|
|
254
|
+
// Step 8: Create policy receipt (links all 3 signatures)
|
|
255
|
+
const policyReceipt = createPolicyReceipt({
|
|
256
|
+
intent,
|
|
257
|
+
decision,
|
|
258
|
+
receipt,
|
|
259
|
+
verifierPrivateKey: this.config.gatewayPrivateKey
|
|
260
|
+
});
|
|
261
|
+
this.usedRequestIds.add(request.requestId);
|
|
262
|
+
const proof = {
|
|
263
|
+
requestSignature: request.signature, decisionSignature: decision.signature,
|
|
264
|
+
receiptSignature: receipt.signature, policyReceipt
|
|
265
|
+
};
|
|
266
|
+
const result = {
|
|
267
|
+
executed: true, requestId: request.requestId,
|
|
268
|
+
result: toolResult.result, toolError: toolResult.success ? undefined : toolResult.error,
|
|
269
|
+
proof, receipt, decision
|
|
270
|
+
};
|
|
271
|
+
this.config.onToolCall?.(request, result);
|
|
272
|
+
return result;
|
|
273
|
+
}
|
|
274
|
+
// ── Two-Phase: Approve then Execute ──
|
|
275
|
+
approve(request) {
|
|
276
|
+
this.stats.totalRequests++;
|
|
277
|
+
if (this.usedRequestIds.has(request.requestId)) {
|
|
278
|
+
this.stats.replayAttemptsBlocked++;
|
|
279
|
+
return { approved: false, denial: { reason: 'Replay detected' } };
|
|
280
|
+
}
|
|
281
|
+
const agent = this.agents.get(request.agentId);
|
|
282
|
+
if (!agent) {
|
|
283
|
+
this.stats.totalDenied++;
|
|
284
|
+
return { approved: false, denial: { reason: 'Agent not registered' } };
|
|
285
|
+
}
|
|
286
|
+
const requestPayload = canonicalize({
|
|
287
|
+
requestId: request.requestId, agentId: request.agentId, tool: request.tool,
|
|
288
|
+
params: request.params, scopeRequired: request.scopeRequired, spend: request.spend
|
|
289
|
+
});
|
|
290
|
+
if (!verify(requestPayload, request.signature, request.agentPublicKey)) {
|
|
291
|
+
this.stats.totalDenied++;
|
|
292
|
+
return { approved: false, denial: { reason: 'Invalid signature' } };
|
|
293
|
+
}
|
|
294
|
+
const delegation = this.findDelegation(agent, request);
|
|
295
|
+
if (!delegation) {
|
|
296
|
+
this.stats.totalDenied++;
|
|
297
|
+
return { approved: false, denial: { reason: `No delegation covers scope "${request.scopeRequired}"` } };
|
|
298
|
+
}
|
|
299
|
+
const pendingCount = Array.from(this.approvals.values()).filter(a => a.agentId === request.agentId && !a.consumed).length;
|
|
300
|
+
if (pendingCount >= this.config.maxPendingPerAgent) {
|
|
301
|
+
this.stats.totalDenied++;
|
|
302
|
+
return { approved: false, denial: { reason: 'Too many pending approvals' } };
|
|
303
|
+
}
|
|
304
|
+
const intent = createActionIntent({
|
|
305
|
+
agentId: this.config.gatewayId, agentPublicKey: this.config.gatewayPublicKey, privateKey: this.config.gatewayPrivateKey,
|
|
306
|
+
delegationId: delegation.delegationId,
|
|
307
|
+
action: { type: request.tool, target: JSON.stringify(request.params), scopeRequired: request.scopeRequired, spend: request.spend },
|
|
308
|
+
context: `[Gateway ${this.config.gatewayId}] Proxy for ${request.agentId}: ${request.context || ''}`
|
|
309
|
+
});
|
|
310
|
+
const validationCtx = this.buildValidationContext(agent, delegation);
|
|
311
|
+
const decision = evaluateIntent({
|
|
312
|
+
intent, evaluatorId: this.config.gatewayId, evaluatorPublicKey: this.config.gatewayPublicKey,
|
|
313
|
+
evaluatorPrivateKey: this.config.gatewayPrivateKey, validator: this.validator,
|
|
314
|
+
validationContext: validationCtx
|
|
315
|
+
});
|
|
316
|
+
if (decision.verdict === 'deny') {
|
|
317
|
+
this.stats.totalDenied++;
|
|
318
|
+
return { approved: false, denial: { reason: decision.reason, decision } };
|
|
319
|
+
}
|
|
320
|
+
this.stats.totalPermitted++;
|
|
321
|
+
const nonce = uuidv4();
|
|
322
|
+
const ttlMs = this.config.approvalTTLSeconds * 1000;
|
|
323
|
+
const approval = {
|
|
324
|
+
approvalId: uuidv4(), requestId: request.requestId, agentId: request.agentId,
|
|
325
|
+
tool: request.tool, params: request.params, scopeRequired: request.scopeRequired,
|
|
326
|
+
delegationId: delegation.delegationId, intent, decision,
|
|
327
|
+
expiresAt: new Date(Date.now() + ttlMs).toISOString(), nonce, consumed: false
|
|
328
|
+
};
|
|
329
|
+
this.approvals.set(approval.approvalId, approval);
|
|
330
|
+
this.stats.pendingApprovals = Array.from(this.approvals.values()).filter(a => !a.consumed).length;
|
|
331
|
+
return { approved: true, approval };
|
|
332
|
+
}
|
|
333
|
+
async executeApproval(approvalId) {
|
|
334
|
+
const approval = this.approvals.get(approvalId);
|
|
335
|
+
if (!approval)
|
|
336
|
+
return { executed: false, requestId: '', denialReason: 'Approval not found' };
|
|
337
|
+
if (approval.consumed) {
|
|
338
|
+
this.stats.replayAttemptsBlocked++;
|
|
339
|
+
return { executed: false, requestId: approval.requestId, denialReason: 'Approval already consumed (replay)' };
|
|
340
|
+
}
|
|
341
|
+
if (new Date(approval.expiresAt) < new Date()) {
|
|
342
|
+
this.stats.expiredApprovalsCleared++;
|
|
343
|
+
this.approvals.delete(approvalId);
|
|
344
|
+
return { executed: false, requestId: approval.requestId, denialReason: 'Approval expired' };
|
|
345
|
+
}
|
|
346
|
+
if (this.config.recheckRevocationOnExecute) {
|
|
347
|
+
this.stats.revocationRechecksTriggered++;
|
|
348
|
+
const agent = this.agents.get(approval.agentId);
|
|
349
|
+
if (!agent)
|
|
350
|
+
return { executed: false, requestId: approval.requestId, denialReason: 'Agent unregistered since approval' };
|
|
351
|
+
const delegation = agent.delegations.get(approval.delegationId);
|
|
352
|
+
if (!delegation)
|
|
353
|
+
return { executed: false, requestId: approval.requestId, denialReason: 'Delegation removed since approval' };
|
|
354
|
+
const delegationStatus = verifyDelegation(delegation);
|
|
355
|
+
if (!delegationStatus.valid || delegationStatus.expired || delegationStatus.revoked)
|
|
356
|
+
return { executed: false, requestId: approval.requestId, denialReason: 'Delegation invalidated since approval' };
|
|
357
|
+
}
|
|
358
|
+
approval.consumed = true;
|
|
359
|
+
this.usedRequestIds.add(approval.requestId);
|
|
360
|
+
let toolResult;
|
|
361
|
+
try {
|
|
362
|
+
toolResult = await this.executor(approval.tool, approval.params);
|
|
363
|
+
}
|
|
364
|
+
catch (err) {
|
|
365
|
+
this.stats.totalToolErrors++;
|
|
366
|
+
return { executed: true, requestId: approval.requestId, toolError: err instanceof Error ? err.message : String(err), decision: approval.decision };
|
|
367
|
+
}
|
|
368
|
+
if (toolResult.success) {
|
|
369
|
+
this.stats.totalExecuted++;
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
this.stats.totalToolErrors++;
|
|
373
|
+
}
|
|
374
|
+
const agent = this.agents.get(approval.agentId);
|
|
375
|
+
const delegation = agent?.delegations.get(approval.delegationId);
|
|
376
|
+
const receipt = createReceipt({
|
|
377
|
+
agentId: this.config.gatewayId,
|
|
378
|
+
delegationId: approval.delegationId,
|
|
379
|
+
delegation: delegation,
|
|
380
|
+
action: {
|
|
381
|
+
type: `gateway:${approval.tool}`,
|
|
382
|
+
target: JSON.stringify(approval.params),
|
|
383
|
+
scopeUsed: approval.scopeRequired,
|
|
384
|
+
},
|
|
385
|
+
result: {
|
|
386
|
+
status: toolResult.success ? 'success' : 'failure',
|
|
387
|
+
summary: toolResult.success
|
|
388
|
+
? `Executed ${approval.tool} successfully`
|
|
389
|
+
: `Executed ${approval.tool} with error: ${toolResult.error}`
|
|
390
|
+
},
|
|
391
|
+
delegationChain: [this.config.gatewayPublicKey],
|
|
392
|
+
privateKey: this.config.gatewayPrivateKey
|
|
393
|
+
});
|
|
394
|
+
const policyReceipt = createPolicyReceipt({
|
|
395
|
+
intent: approval.intent,
|
|
396
|
+
decision: approval.decision,
|
|
397
|
+
receipt,
|
|
398
|
+
verifierPrivateKey: this.config.gatewayPrivateKey
|
|
399
|
+
});
|
|
400
|
+
const proof = { requestSignature: approval.intent.signature, decisionSignature: approval.decision.signature, receiptSignature: receipt.signature, policyReceipt };
|
|
401
|
+
this.stats.pendingApprovals = Array.from(this.approvals.values()).filter(a => !a.consumed).length;
|
|
402
|
+
return { executed: true, requestId: approval.requestId, result: toolResult.result, toolError: toolResult.success ? undefined : toolResult.error, proof, receipt, decision: approval.decision };
|
|
403
|
+
}
|
|
404
|
+
clearExpired() {
|
|
405
|
+
const now = new Date();
|
|
406
|
+
let cleared = 0;
|
|
407
|
+
for (const [id, approval] of this.approvals) {
|
|
408
|
+
if (new Date(approval.expiresAt) < now) {
|
|
409
|
+
this.approvals.delete(id);
|
|
410
|
+
cleared++;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
this.stats.expiredApprovalsCleared += cleared;
|
|
414
|
+
this.stats.pendingApprovals = this.approvals.size;
|
|
415
|
+
return cleared;
|
|
416
|
+
}
|
|
417
|
+
getStats() { return { ...this.stats }; }
|
|
418
|
+
getAgentApprovals(agentId) {
|
|
419
|
+
return Array.from(this.approvals.values()).filter(a => a.agentId === agentId);
|
|
420
|
+
}
|
|
421
|
+
findDelegation(agent, request) {
|
|
422
|
+
if (request.delegationId) {
|
|
423
|
+
const d = agent.delegations.get(request.delegationId);
|
|
424
|
+
if (d && scopeAuthorizes(d.scope, request.scopeRequired))
|
|
425
|
+
return d;
|
|
426
|
+
return null;
|
|
427
|
+
}
|
|
428
|
+
for (const [, d] of agent.delegations) {
|
|
429
|
+
if (scopeAuthorizes(d.scope, request.scopeRequired)) {
|
|
430
|
+
if (request.spend && d.spendLimit !== undefined && request.spend.amount > d.spendLimit)
|
|
431
|
+
continue;
|
|
432
|
+
return d;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
437
|
+
buildValidationContext(agent, delegation) {
|
|
438
|
+
return {
|
|
439
|
+
floorVersion: agent.attestation.floorVersion,
|
|
440
|
+
floorPrinciples: this.config.floor.floor.map((p) => ({
|
|
441
|
+
id: p.id, name: p.name,
|
|
442
|
+
enforcement: { mode: p.enforcement?.mode, technical: p.enforcement?.technical, mechanism: p.enforcement?.mechanism || 'unknown' },
|
|
443
|
+
weight: p.weight || 'mandatory'
|
|
444
|
+
})),
|
|
445
|
+
delegation: {
|
|
446
|
+
scope: delegation.scope, spendLimit: delegation.spendLimit, spentAmount: 0,
|
|
447
|
+
expiresAt: delegation.expiresAt, revoked: !!getRevocation(delegation.delegationId),
|
|
448
|
+
currentDepth: delegation.currentDepth, maxDepth: delegation.maxDepth
|
|
449
|
+
},
|
|
450
|
+
agentRegistered: true, agentAttestationValid: true
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
export function createProxyGateway(config, executor) {
|
|
455
|
+
return new ProxyGateway(config, executor);
|
|
456
|
+
}
|
|
457
|
+
//# sourceMappingURL=gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../src/core/gateway.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,uCAAuC;AACvC,qEAAqE;AACrE,EAAE;AACF,gEAAgE;AAChE,4BAA4B;AAC5B,EAAE;AACF,oEAAoE;AACpE,mEAAmE;AACnE,gEAAgE;AAChE,2CAA2C;AAC3C,EAAE;AACF,gBAAgB;AAChB,wDAAwD;AACxD,sEAAsE;AACtE,EAAE;AACF,mDAAmD;AACnD,uDAAuD;AACvD,gEAAgE;AAChE,4CAA4C;AAC5C,qDAAqD;AACrD,4DAA4D;AAC5D,+DAA+D;AAC/D,EAAE;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