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

Viewing files at commit b95ad82c1c50Commit detailsView latest

schemas/v0.1/contract_revision.schema.json 293 lines · 8.5 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": ["none", "mutual_consent"]
115
        },
116
        "retentionDays": {
117
          "type": "integer",
118
          "minimum": 0,
119
          "maximum": 9007199254740991
120
        },
121
        "completionConditions": {
122
          "type": "array",
123
          "items": {
124
            "type": "string"
125
          }
126
        },
127
        "cancellationConditions": {
128
          "type": "array",
129
          "items": {
130
            "type": "string"
131
          }
132
        },
133
        "signatures": {
134
          "default": {},
135
          "type": "object",
136
          "propertyNames": {
137
            "type": "string"
138
          },
139
          "additionalProperties": {
140
            "type": "object",
141
            "properties": {
142
              "algorithm": {
143
                "type": "string",
144
                "const": "Ed25519"
145
              },
146
              "keyId": {
147
                "type": "string",
148
                "minLength": 1
149
              },
150
              "value": {
151
                "type": "string",
152
                "minLength": 1
153
              }
154
            },
155
            "required": ["algorithm", "keyId", "value"],
156
            "additionalProperties": false
157
          }
158
        }
159
      },
160
      "required": [
161
        "protocolVersion",
162
        "interactionId",
163
        "purpose",
164
        "parties",
165
        "taskCategory",
166
        "requestedOutcome",
167
        "successCriteria",
168
        "allowedActions",
169
        "prohibitedActions",
170
        "allowedData",
171
        "prohibitedData",
172
        "evidenceRequirements",
173
        "delegationRules",
174
        "humanApprovalRequirements",
175
        "factCheckingPolicy",
176
        "mediationPolicy",
177
        "retentionDays",
178
        "completionConditions",
179
        "cancellationConditions",
180
        "signatures"
181
      ],
182
      "additionalProperties": false
183
    },
184
    "proposedByAgentId": {
185
      "type": "string",
186
      "minLength": 1
187
    },
188
    "status": {
189
      "type": "string",
190
      "enum": ["proposed", "accepted", "rejected", "superseded"]
191
    },
192
    "acceptances": {
193
      "type": "object",
194
      "propertyNames": {
195
        "type": "string"
196
      },
197
      "additionalProperties": {
198
        "type": "object",
199
        "properties": {
200
          "agentId": {
201
            "type": "string",
202
            "minLength": 1
203
          },
204
          "method": {
205
            "type": "string",
206
            "enum": ["oauth_installation", "oauth_account", "policy_auto_accept", "ed25519"]
207
          },
208
          "termsHash": {
209
            "type": "string",
210
            "minLength": 1
211
          },
212
          "acceptedAt": {
213
            "type": "string",
214
            "format": "date-time",
215
            "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))$"
216
          },
217
          "signature": {
218
            "type": "object",
219
            "properties": {
220
              "algorithm": {
221
                "type": "string",
222
                "const": "Ed25519"
223
              },
224
              "keyId": {
225
                "type": "string",
226
                "minLength": 1
227
              },
228
              "value": {
229
                "type": "string",
230
                "minLength": 1
231
              }
232
            },
233
            "required": ["algorithm", "keyId", "value"],
234
            "additionalProperties": false
235
          }
236
        },
237
        "required": ["agentId", "method", "termsHash", "acceptedAt"],
238
        "additionalProperties": false
239
      }
240
    },
241
    "createdAt": {
242
      "type": "string",
243
      "format": "date-time",
244
      "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))$"
245
    },
246
    "updatedAt": {
247
      "type": "string",
248
      "format": "date-time",
249
      "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))$"
250
    },
251
    "expiresAt": {
252
      "type": "string",
253
      "format": "date-time",
254
      "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))$"
255
    },
256
    "platformAttestation": {
257
      "type": "object",
258
      "properties": {
259
        "algorithm": {
260
          "type": "string",
261
          "const": "Ed25519"
262
        },
263
        "keyId": {
264
          "type": "string",
265
          "minLength": 1
266
        },
267
        "value": {
268
          "type": "string",
269
          "minLength": 1
270
        },
271
        "digest": {
272
          "type": "string",
273
          "pattern": "^[a-zA-Z0-9_-]{43}$"
274
        }
275
      },
276
      "required": ["algorithm", "keyId", "value", "digest"],
277
      "additionalProperties": false
278
    }
279
  },
280
  "required": [
281
    "revisionId",
282
    "interactionId",
283
    "revision",
284
    "termsHash",
285
    "contract",
286
    "proposedByAgentId",
287
    "status",
288
    "acceptances",
289
    "createdAt",
290
    "updatedAt"
291
  ],
292
  "additionalProperties": false
293
}