Skip to content

Commit 89aa35e

Browse files
committed
schemas: add SourceAudit event contract
1 parent 7b3adb8 commit 89aa35e

1 file changed

Lines changed: 83 additions & 0 deletions

File tree

schemas/AuditEvent.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.srcos.ai/v2/AuditEvent.json",
4+
"title": "AuditEvent",
5+
"description": "Append-only SourceAudit event for graph writes, sync decisions, policy decisions, agent leases, memory lifecycle, shell/browser bridge calls, relays, and runtime actions.",
6+
"type": "object",
7+
"additionalProperties": false,
8+
"required": [
9+
"id",
10+
"type",
11+
"specVersion",
12+
"eventType",
13+
"occurredAt",
14+
"actorId",
15+
"subjectId",
16+
"policyDomain",
17+
"outcome",
18+
"reasonCode",
19+
"eventHash"
20+
],
21+
"properties": {
22+
"id": {
23+
"type": "string",
24+
"pattern": "^urn:srcos:audit:"
25+
},
26+
"type": {
27+
"const": "AuditEvent"
28+
},
29+
"specVersion": {
30+
"type": "string"
31+
},
32+
"eventType": {
33+
"type": "string",
34+
"pattern": "^[a-z0-9_.-]+$"
35+
},
36+
"occurredAt": {
37+
"type": "string",
38+
"format": "date-time"
39+
},
40+
"actorId": {
41+
"type": "string",
42+
"pattern": "^urn:srcos:"
43+
},
44+
"subjectId": {
45+
"type": "string",
46+
"pattern": "^urn:srcos:"
47+
},
48+
"workspaceId": {
49+
"type": "string",
50+
"pattern": "^urn:srcos:workspace:"
51+
},
52+
"deviceId": {
53+
"type": "string",
54+
"pattern": "^urn:srcos:device:"
55+
},
56+
"policyDomain": {
57+
"type": "string",
58+
"pattern": "^[a-z0-9_.-]+$"
59+
},
60+
"outcome": {
61+
"type": "string",
62+
"enum": ["allow", "deny", "require_review", "quarantine", "error", "informational"]
63+
},
64+
"reasonCode": {
65+
"type": "string"
66+
},
67+
"details": {
68+
"type": "object",
69+
"additionalProperties": true
70+
},
71+
"previousEventHash": {
72+
"type": "string",
73+
"pattern": "^sha256:"
74+
},
75+
"eventHash": {
76+
"type": "string",
77+
"pattern": "^sha256:"
78+
},
79+
"signature": {
80+
"type": "string"
81+
}
82+
}
83+
}

0 commit comments

Comments
 (0)