forked from haroldmalikfrimpong-ops/agentid-aps-interop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvector.schema.json
More file actions
261 lines (261 loc) · 11.7 KB
/
Copy pathvector.schema.json
File metadata and controls
261 lines (261 loc) · 11.7 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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/haroldmalikfrimpong-ops/agentid-aps-interop/blob/main/vector.schema.json",
"title": "AgentID + APS Interop Test Vector",
"description": "Schema for interop test vectors in fixtures/{agentid,aps,composed}/v1/ and forward. Supports both structural-shape (v1) and cryptographically-verifiable (v2) fixture forms.",
"type": "object",
"required": [
"scenario",
"description",
"subject",
"expected_result",
"metadata"
],
"properties": {
"scenario": {
"type": "string",
"description": "Kebab-case identifier for the test vector. Must be unique within its directory.",
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
},
"description": {
"type": "string",
"description": "Single-sentence human-readable description of what the vector tests."
},
"subject": {
"type": "object",
"description": "The agent the vector is about.",
"required": ["agent_id", "did"],
"properties": {
"agent_id": {
"type": "string",
"description": "AgentID short identifier."
},
"did": {
"type": "string",
"description": "Full W3C DID for the subject."
},
"bound_addresses": {
"type": "array",
"description": "Wallet addresses bound to this agent (when wallet binding is in scope).",
"items": { "type": "string" }
}
}
},
"inputs": {
"type": "object",
"description": "System-specific input envelopes. At least one of agentid_attestation or aps_delegation must be present.",
"properties": {
"agentid_attestation": {
"type": "object",
"description": "AgentID attestation envelope (verify response, trust-header payload, or attestation envelope).",
"properties": {
"agent_id": { "type": "string" },
"did": { "type": "string" },
"trust_level": { "type": "integer", "minimum": 1, "maximum": 4 },
"trust_level_label": { "type": "string" },
"certificate_valid": { "type": "boolean" },
"active": { "type": "boolean" },
"ed25519_bound": { "type": "boolean" },
"wallet_bound": { "type": "boolean" },
"solana_address": { "type": ["string", "null"] },
"wallet_address": { "type": ["string", "null"] },
"wallet_chain": { "type": ["string", "null"] },
"bound_addresses": {
"type": "array",
"items": { "type": "string" }
},
"subject_binding": {
"type": "string",
"enum": ["wallet_bound", "wallet_acknowledged", "reference"]
},
"issued_at": { "type": "string", "format": "date-time" },
"expires_at": { "type": "string", "format": "date-time" },
"key_status": {
"type": "string",
"enum": ["active", "deprecated", "revoked", "compromised"]
},
"compromised_since": { "type": ["string", "null"], "format": "date-time" },
"revoked_at": { "type": ["string", "null"], "format": "date-time" },
"revocation_reason": { "type": ["string", "null"] },
"version": { "type": "string" }
}
},
"aps_delegation": {
"type": "object",
"description": "APS delegation envelope.",
"properties": {
"version": { "type": "string" },
"delegator": { "type": "string" },
"delegate": { "type": "string" },
"scope": {
"type": "array",
"items": { "type": "string" }
},
"spend_limit": {
"type": "object",
"properties": {
"amount": { "type": "number" },
"currency": { "type": "string" },
"period": { "type": "string" }
}
},
"wallet_ref": {
"type": "array",
"items": {
"type": "object",
"properties": {
"chain": { "type": "string" },
"address": { "type": "string" }
}
}
},
"not_before": { "type": "string", "format": "date-time" },
"not_after": { "type": "string", "format": "date-time" },
"nonce": { "type": "string" },
"revoked_at": { "type": ["string", "null"], "format": "date-time" },
"revocation_reason": { "type": ["string", "null"] }
}
}
},
"anyOf": [
{ "required": ["agentid_attestation"] },
{ "required": ["aps_delegation"] }
]
},
"signed_form": {
"type": "object",
"description": "Cryptographic verification material. Optional in v1 (structural-only). REQUIRED in v2.",
"properties": {
"jws": {
"type": "string",
"description": "Compact JWS representation of the signed envelope."
},
"header": {
"type": "object",
"description": "Decoded JWS header (alg, kid, typ)."
},
"payload_canonical": {
"type": "string",
"description": "Hex or base64url representation of the JCS-canonicalized payload bytes that were signed."
},
"signature": {
"type": "string",
"description": "Hex or base64url representation of the raw signature bytes."
},
"public_key": {
"type": "object",
"description": "Public key for offline signature verification.",
"properties": {
"kty": { "type": "string" },
"crv": { "type": "string" },
"x": { "type": "string" },
"kid": { "type": "string" },
"alg": { "type": "string" }
}
},
"jwks_url": {
"type": "string",
"format": "uri",
"description": "Public JWKS URL where the signing key can be resolved at verification time."
},
"kid": {
"type": "string",
"description": "Key identifier matching the entry in jwks_url."
}
}
},
"expected_result": {
"type": "object",
"description": "Expected gate states, failing gates, and composite decision a conformant verifier should produce. Five-gate model per the converged design (A2A #1672): per-gate failure reporting prevents collapse into a single confidence score, and failing_gates names exactly which gate(s) tipped the verdict.",
"required": ["composite_decision", "reasoning", "failing_gates"],
"properties": {
"identity_gate": {
"type": "string",
"enum": ["passed", "failed", "stale", "not_applicable"],
"description": "AgentID identity gate state. 'passed' means DID resolves and identity is current; 'failed' means unresolvable or invalid; 'stale' means past freshness window but DID still resolves; 'not_applicable' means this vector intentionally does not test identity (must be explicit, not omitted)."
},
"delegation_gate": {
"type": "string",
"enum": ["passed", "failed", "not_applicable"],
"description": "APS delegation gate state. 'passed' means delegation in window with valid scope; 'failed' means revoked, expired, or scope-mismatched; 'not_applicable' means vector does not test delegation."
},
"wallet_state_gate": {
"type": "string",
"enum": ["passed", "failed", "not_applicable"],
"description": "Wallet state gate. 'passed' means the bound wallet matches the signed payload claim; 'failed' means divergence (e.g., AgentID solana_address != APS wallet_ref); 'not_applicable' means vector does not test wallet binding."
},
"revocation_gate": {
"type": "string",
"enum": ["passed", "failed", "not_applicable"],
"description": "Revocation gate. 'passed' means no revocation present at evaluation time; 'failed' means a revocation entry preceded the request (CRED_REVOKED_AT_PROCESS or equivalent); 'not_applicable' means vector does not test revocation."
},
"policy_gate": {
"type": "string",
"enum": ["passed", "failed", "not_applicable"],
"description": "Policy gate. 'passed' means action satisfies the active constraint set; 'failed' means action violates a scope, spend, or other policy constraint; 'not_applicable' means vector does not test policy."
},
"key_lifecycle_gate": {
"type": "string",
"enum": ["passed", "failed", "deprecated", "revoked", "compromised", "not_applicable"],
"description": "AgentID key lifecycle gate state. Richer enum than the strict pass/fail gates because the diagnostic distinction between 'rotated', 'revoked', and 'compromised' carries different consumer responses (e.g., 'compromised' invalidates ALL prior receipts, 'rotated' does not)."
},
"composite_decision": {
"type": "string",
"enum": ["permit", "deny", "conditional_allow", "provisional_allow", "refer"],
"description": "The final decision a verifier should produce given the AND-composition of all gates that were evaluated. AND-composition means a single failed gate produces deny regardless of how many other gates passed."
},
"failing_gates": {
"type": "array",
"description": "Array of gate names that failed (or returned a non-passing state). Empty array when composite_decision is 'permit'. Non-empty when composite_decision is 'deny' / 'conditional_allow' / 'provisional_allow' / 'refer'. This is the structural encoding of per-gate failure reporting — a verifier that produces the right composite for the wrong reason fails the vector.",
"items": {
"type": "string",
"enum": ["identity_gate", "delegation_gate", "wallet_state_gate", "revocation_gate", "policy_gate", "key_lifecycle_gate"]
},
"uniqueItems": true
},
"reasoning": {
"type": "string",
"description": "Human-readable explanation of why the composite_decision was reached."
},
"decisive_gate": {
"type": "string",
"enum": ["identity", "delegation", "wallet_state", "revocation", "policy", "key_lifecycle", "all_passed"],
"description": "Which gate was the deciding factor in the composite decision. Convenience field — derivable from failing_gates but useful for human readers."
}
}
},
"metadata": {
"type": "object",
"description": "Vector metadata for catalog and cross-validation.",
"required": ["signature_alg", "canonicalization", "schema_version"],
"properties": {
"signature_alg": {
"type": "string",
"description": "Signature algorithm used (e.g., 'Ed25519', 'EdDSA', 'ES256').",
"enum": ["Ed25519", "EdDSA", "ES256", "ES256K", "RS256"]
},
"canonicalization": {
"type": "string",
"description": "Canonicalization rule applied before signing.",
"enum": ["JCS (RFC 8785)", "CBOR", "none"]
},
"schema_version": {
"type": "string",
"description": "Version of vector.schema.json this fixture conforms to.",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"fixture_form": {
"type": "string",
"enum": ["structural", "signed"],
"description": "Whether this fixture is structural-shape only (v1) or includes cryptographically verifiable bytes (v2)."
},
"contributors": {
"type": "array",
"description": "GitHub handles of contributors to this fixture.",
"items": { "type": "string" }
}
}
}
},
"additionalProperties": false
}