The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Viewing files at commit 578449aaa53eCommit detailsView latest

schemas/v0.1/contract_revision.schema.json 324 lines · 8.9 KB · json
1
{
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
  "type": "object",
4
  "properties": {
5
    "revisionId": {
6
      "type": "string",
7
      "format": "uuid",
8
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
9
    },
10
    "interactionId": {
11
      "type": "string",
12
      "format": "uuid",
13
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
14
    },
15
    "revision": {
16
      "type": "integer",
17
      "exclusiveMinimum": 0,
18
      "maximum": 9007199254740991
19
    },
20
    "previousTermsHash": {
21
      "type": "string",
22
      "minLength": 1
23
    },
24
    "termsHash": {
25
      "type": "string",
26
      "minLength": 1
27
    },
28
    "contract": {
29
      "type": "object",
30
      "properties": {
31
        "protocolVersion": {
32
          "type": "string",
33
          "const": "0.1"
34
        },
35
        "interactionId": {
36
          "type": "string",
37
          "format": "uuid",
38
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
39
        },
40
        "purpose": {
41
          "type": "string"
42
        },
43
        "parties": {
44
          "minItems": 1,
45
          "type": "array",
46
          "items": {
47
            "type": "string"
48
          }
49
        },
50
        "taskCategory": {
51
          "type": "string"
52
        },
53
        "requestedOutcome": {
54
          "type": "string"
55
        },
56
        "successCriteria": {
57
          "type": "array",
58
          "items": {
59
            "type": "string"
60
          }
61
        },
62
        "allowedActions": {
63
          "type": "array",
64
          "items": {
65
            "type": "string"
66
          }
67
        },
68
        "prohibitedActions": {
69
          "type": "array",
70
          "items": {
71
            "type": "string"
72
          }
73
        },
74
        "allowedData": {
75
          "type": "array",
76
          "items": {
77
            "type": "string"
78
          }
79
        },
80
        "prohibitedData": {
81
          "type": "array",
82
          "items": {
83
            "type": "string"
84
          }
85
        },
86
        "deadline": {
87
          "type": "string",
88
          "format": "date-time",
89
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
90
        },
91
        "evidenceRequirements": {
92
          "type": "array",
93
          "items": {
94
            "type": "string"
95
          }
96
        },
97
        "delegationRules": {
98
          "type": "array",
99
          "items": {
100
            "type": "string"
101
          }
102
        },
103
        "humanApprovalRequirements": {
104
          "type": "array",
105
          "items": {
106
            "type": "string"
107
          }
108
        },
109
        "factCheckingPolicy": {
110
          "type": "string"
111
        },
112
        "mediationPolicy": {
113
          "type": "string",
114
          "enum": [
115
            "none",
116
            "mutual_consent"
117
          ]
118
        },
119
        "retentionDays": {
120
          "type": "integer",
121
          "minimum": 0,
122
          "maximum": 9007199254740991
123
        },
124
        "completionConditions": {
125
          "type": "array",
126
          "items": {
127
            "type": "string"
128
          }
129
        },
130
        "cancellationConditions": {
131
          "type": "array",
132
          "items": {
133
            "type": "string"
134
          }
135
        },
136
        "signatures": {
137
          "default": {},
138
          "type": "object",
139
          "propertyNames": {
140
            "type": "string"
141
          },
142
          "additionalProperties": {
143
            "type": "object",
144
            "properties": {
145
              "algorithm": {
146
                "type": "string",
147
                "const": "Ed25519"
148
              },
149
              "keyId": {
150
                "type": "string",
151
                "minLength": 1
152
              },
153
              "value": {
154
                "type": "string",
155
                "minLength": 1
156
              }
157
            },
158
            "required": [
159
              "algorithm",
160
              "keyId",
161
              "value"
162
            ],
163
            "additionalProperties": false
164
          }
165
        }
166
      },
167
      "required": [
168
        "protocolVersion",
169
        "interactionId",
170
        "purpose",
171
        "parties",
172
        "taskCategory",
173
        "requestedOutcome",
174
        "successCriteria",
175
        "allowedActions",
176
        "prohibitedActions",
177
        "allowedData",
178
        "prohibitedData",
179
        "evidenceRequirements",
180
        "delegationRules",
181
        "humanApprovalRequirements",
182
        "factCheckingPolicy",
183
        "mediationPolicy",
184
        "retentionDays",
185
        "completionConditions",
186
        "cancellationConditions",
187
        "signatures"
188
      ],
189
      "additionalProperties": false
190
    },
191
    "proposedByAgentId": {
192
      "type": "string",
193
      "minLength": 1
194
    },
195
    "status": {
196
      "type": "string",
197
      "enum": [
198
        "proposed",
199
        "accepted",
200
        "rejected",
201
        "superseded"
202
      ]
203
    },
204
    "acceptances": {
205
      "type": "object",
206
      "propertyNames": {
207
        "type": "string"
208
      },
209
      "additionalProperties": {
210
        "type": "object",
211
        "properties": {
212
          "agentId": {
213
            "type": "string",
214
            "minLength": 1
215
          },
216
          "method": {
217
            "type": "string",
218
            "enum": [
219
              "oauth_installation",
220
              "oauth_account",
221
              "policy_auto_accept",
222
              "ed25519"
223
            ]
224
          },
225
          "termsHash": {
226
            "type": "string",
227
            "minLength": 1
228
          },
229
          "acceptedAt": {
230
            "type": "string",
231
            "format": "date-time",
232
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
233
          },
234
          "signature": {
235
            "type": "object",
236
            "properties": {
237
              "algorithm": {
238
                "type": "string",
239
                "const": "Ed25519"
240
              },
241
              "keyId": {
242
                "type": "string",
243
                "minLength": 1
244
              },
245
              "value": {
246
                "type": "string",
247
                "minLength": 1
248
              }
249
            },
250
            "required": [
251
              "algorithm",
252
              "keyId",
253
              "value"
254
            ],
255
            "additionalProperties": false
256
          }
257
        },
258
        "required": [
259
          "agentId",
260
          "method",
261
          "termsHash",
262
          "acceptedAt"
263
        ],
264
        "additionalProperties": false
265
      }
266
    },
267
    "createdAt": {
268
      "type": "string",
269
      "format": "date-time",
270
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
271
    },
272
    "updatedAt": {
273
      "type": "string",
274
      "format": "date-time",
275
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
276
    },
277
    "expiresAt": {
278
      "type": "string",
279
      "format": "date-time",
280
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
281
    },
282
    "platformAttestation": {
283
      "type": "object",
284
      "properties": {
285
        "algorithm": {
286
          "type": "string",
287
          "const": "Ed25519"
288
        },
289
        "keyId": {
290
          "type": "string",
291
          "minLength": 1
292
        },
293
        "value": {
294
          "type": "string",
295
          "minLength": 1
296
        },
297
        "digest": {
298
          "type": "string",
299
          "pattern": "^[a-zA-Z0-9_-]{43}$"
300
        }
301
      },
302
      "required": [
303
        "algorithm",
304
        "keyId",
305
        "value",
306
        "digest"
307
      ],
308
      "additionalProperties": false
309
    }
310
  },
311
  "required": [
312
    "revisionId",
313
    "interactionId",
314
    "revision",
315
    "termsHash",
316
    "contract",
317
    "proposedByAgentId",
318
    "status",
319
    "acceptances",
320
    "createdAt",
321
    "updatedAt"
322
  ],
323
  "additionalProperties": false
324
}