-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproofpath-guard-service-v0.1.yaml
More file actions
447 lines (445 loc) · 13.9 KB
/
Copy pathproofpath-guard-service-v0.1.yaml
File metadata and controls
447 lines (445 loc) · 13.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
openapi: 3.1.0
info:
title: ProofPath Guard Service API
version: "0.1"
summary: External authorization and evidence API for AI-agent payment proposals.
description: |
ProofPath Guard Service evaluates AI-agent payment proposals before execution.
Core principle: model output is a proposal, not authorization.
This contract is simulation-only. It does not define real wallet custody,
token transfers, RPC calls, payment-provider SDKs, JWS, or EIP-712 signing.
servers:
- url: http://127.0.0.1:8787
description: Local ProofPath Guard Service
tags:
- name: Health
- name: Evaluation
- name: Audit
- name: ReplayStore
paths:
/v1/health:
get:
tags: [Health]
summary: Return service health.
operationId: getHealth
responses:
"200":
description: Service is running.
content:
application/json:
schema:
$ref: "#/components/schemas/HealthResponse"
examples:
ok:
value:
status: ok
surface: agent-payment-guard-service
version: "0.1"
/v1/payment-proposals/evaluate:
post:
tags: [Evaluation]
summary: Evaluate an AI-agent payment proposal before execution.
operationId: evaluatePaymentProposal
description: |
Enforce/shadow semantics:
- enforce + ACCEPT -> execution_allowed=true, would_block=false
- enforce + HOLD/BLOCK -> execution_allowed=false, would_block=true
- shadow + ACCEPT -> execution_allowed=true, would_block=false
- shadow + HOLD/BLOCK -> execution_allowed=true, would_block=true
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EvaluatePaymentProposalRequest"
examples:
accept:
value:
mode: enforce
proposal:
action_type: agent_payment
agent_id: agent_researcher_01
asset: USDC
amount: "0.25"
recipient: market-data-api.example
approved_recipient: market-data-api.example
approved_budget: "5.00"
human_intent_id: intent_market_research_001
causal_parent: task_market_report_001
budget_scope: daily_research_budget
payment_mode: one_time
purpose: buy_market_data_api_call
intent_envelope:
envelope_type: signed_human_intent
version: "0.1"
human_intent_id: intent_market_research_001
subject_agent_id: agent_researcher_01
purpose: buy_market_data_api_call
causal_parent: task_market_report_001
allowed_asset: USDC
max_amount: "5.00"
allowed_recipient: market-data-api.example
budget_scope: daily_research_budget
payment_mode: one_time
nonce: nonce_market_research_001
expires_at: "2027-01-01T00:00:00Z"
signature_alg: demo-sha256-v0
signature: sha256-demo-signature
responses:
"200":
description: Evaluation completed. Decision may be ACCEPT, HOLD, or BLOCK.
content:
application/json:
schema:
$ref: "#/components/schemas/EvaluationResponse"
examples:
accept:
value:
mode: enforce
decision: ACCEPT
reason: PAYMENT_WITHIN_SIGNED_INTENT_ENVELOPE
execution_allowed: true
would_block: false
audit_hash: sha256:6eece8a1...
replay_block:
value:
mode: enforce
decision: BLOCK
reason: INTENT_REPLAYED
execution_allowed: false
would_block: true
audit_hash: sha256:8ab40471...
shadow_block:
value:
mode: shadow
decision: BLOCK
reason: MISSING_INTENT_ENVELOPE
execution_allowed: true
would_block: true
audit_hash: sha256:7ae0d21c...
"400":
description: Malformed request body or invalid mode.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
examples:
invalid_mode:
value:
error: mode must be 'enforce' or 'shadow'
/v1/audit/records:
get:
tags: [Audit]
summary: Return recent hash-chained audit records.
operationId: getAuditRecords
parameters:
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
description: Maximum number of recent records. Values above configured maximum are clamped.
responses:
"200":
description: Recent audit records.
content:
application/json:
schema:
$ref: "#/components/schemas/AuditRecordsResponse"
examples:
recent:
value:
count: 1
limit: 20
records:
- ts: "2026-05-27T00:00:00Z"
surface: agent-payment-guard
decision: ACCEPT
reason: PAYMENT_WITHIN_SIGNED_INTENT_ENVELOPE
agent_id: agent_researcher_01
asset: USDC
amount: "0.25"
approved_budget: "5.00"
recipient: market-data-api.example
causal_parent: task_market_report_001
intent_verified: true
intent_envelope_id: intent_market_research_001
intent_signature_alg: demo-sha256-v0
intent_expires_at: "2027-01-01T00:00:00Z"
intent_nonce: nonce_market_research_001
previous_hash: GENESIS
hash: sha256:6eece8a1...
"400":
description: Invalid limit parameter.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/v1/replay-store:
get:
tags: [ReplayStore]
summary: Return local diagnostic view of spent signed-intent nonces.
operationId: getReplayStore
description: Local diagnostics only. Not an authorization API.
responses:
"200":
description: Replay store entries.
content:
application/json:
schema:
$ref: "#/components/schemas/ReplayStoreResponse"
examples:
replay_store:
value:
nonces: 1
entries:
nonce_market_research_001:
nonce: nonce_market_research_001
human_intent_id: intent_market_research_001
agent_id: agent_researcher_01
used_at: "2026-05-27T00:00:00Z"
decision_hash: sha256:6eece8a1...
status: used
components:
schemas:
HealthResponse:
type: object
required: [status, surface, version]
properties:
status:
type: string
enum: [ok]
surface:
type: string
enum: [agent-payment-guard-service]
version:
type: string
example: "0.1"
EvaluatePaymentProposalRequest:
type: object
required: [proposal]
properties:
mode:
$ref: "#/components/schemas/EvaluationMode"
proposal:
$ref: "#/components/schemas/PaymentProposal"
intent_envelope:
oneOf:
- $ref: "#/components/schemas/IntentEnvelope"
- type: "null"
PaymentProposal:
type: object
required: [action_type, agent_id, asset, amount, recipient, approved_budget, human_intent_id, causal_parent, budget_scope, payment_mode, purpose]
properties:
action_type:
type: string
enum: [agent_payment]
agent_id:
type: string
asset:
type: string
example: USDC
amount:
type: string
example: "0.25"
recipient:
type: string
approved_recipient:
type: string
approved_budget:
type: string
example: "5.00"
human_intent_id:
type: string
causal_parent:
type: string
budget_scope:
type: string
payment_mode:
type: string
enum: [one_time, recurring]
purpose:
type: string
recurring_approval:
type: boolean
IntentEnvelope:
type: object
required: [envelope_type, version, human_intent_id, subject_agent_id, purpose, causal_parent, allowed_asset, max_amount, allowed_recipient, budget_scope, payment_mode, nonce, expires_at, signature_alg, signature]
properties:
envelope_type:
type: string
enum: [signed_human_intent]
version:
type: string
enum: ["0.1"]
human_intent_id:
type: string
subject_agent_id:
type: string
purpose:
type: string
causal_parent:
type: string
allowed_asset:
type: string
max_amount:
type: string
allowed_recipient:
type: string
budget_scope:
type: string
payment_mode:
type: string
enum: [one_time, recurring]
nonce:
type: string
expires_at:
type: string
format: date-time
signature_alg:
type: string
enum: [demo-sha256-v0]
description: Demo algorithm only; not JWS or EIP-712.
signature:
type: string
EvaluationResponse:
type: object
required: [mode, decision, reason, execution_allowed, would_block, audit_hash]
properties:
mode:
$ref: "#/components/schemas/EvaluationMode"
decision:
$ref: "#/components/schemas/Decision"
reason:
$ref: "#/components/schemas/Reason"
execution_allowed:
type: boolean
would_block:
type: boolean
audit_hash:
type: string
pattern: "^sha256:"
AuditRecordsResponse:
type: object
required: [records, count, limit]
properties:
records:
type: array
items:
$ref: "#/components/schemas/AuditRecord"
count:
type: integer
minimum: 0
limit:
type: integer
minimum: 1
AuditRecord:
type: object
required: [ts, surface, decision, reason, previous_hash, hash]
properties:
ts:
type: string
format: date-time
surface:
type: string
decision:
$ref: "#/components/schemas/Decision"
reason:
$ref: "#/components/schemas/Reason"
agent_id:
type: string
asset:
type: string
amount:
type: string
approved_budget:
type: string
recipient:
type: string
causal_parent:
type: string
intent_verified:
type: boolean
intent_envelope_id:
type: string
intent_signature_alg:
type: string
intent_expires_at:
type: string
intent_nonce:
type: string
previous_hash:
type: string
hash:
type: string
pattern: "^sha256:"
ReplayStoreResponse:
type: object
required: [nonces, entries]
properties:
nonces:
type: integer
minimum: 0
entries:
type: object
additionalProperties:
$ref: "#/components/schemas/ReplayStoreEntry"
ReplayStoreEntry:
type: object
required: [nonce, used_at, status]
properties:
nonce:
type: string
human_intent_id:
type: string
agent_id:
type: string
used_at:
type: string
format: date-time
decision_hash:
type: string
pattern: "^sha256:"
status:
type: string
enum: [used]
ErrorResponse:
type: object
required: [error]
properties:
error:
type: string
EvaluationMode:
type: string
enum: [enforce, shadow]
Decision:
type: string
enum: [ACCEPT, HOLD, BLOCK]
Reason:
type: string
enum:
- PAYMENT_WITHIN_SIGNED_INTENT_ENVELOPE
- PAYMENT_WITHIN_SCOPE_AND_BUDGET
- RECURRING_PAYMENT_REQUIRES_APPROVAL
- INVALID_ACTION_TYPE
- ASSET_NOT_ALLOWED
- INVALID_AMOUNT
- INVALID_APPROVED_BUDGET
- OVER_BUDGET
- MISSING_PAYMENT_INTENT
- RECIPIENT_NOT_ALLOWED
- RECIPIENT_MISMATCH
- MISSING_INTENT_ENVELOPE
- INVALID_INTENT_SIGNATURE
- INTENT_EXPIRED
- INTENT_AGENT_MISMATCH
- INTENT_PURPOSE_MISMATCH
- INTENT_CAUSAL_PARENT_MISMATCH
- INTENT_ID_MISMATCH
- INTENT_PAYMENT_MODE_MISMATCH
- INTENT_ASSET_MISMATCH
- INTENT_RECIPIENT_MISMATCH
- INTENT_BUDGET_SCOPE_MISMATCH
- INTENT_AMOUNT_EXCEEDED
- INTENT_REPLAYED