@cygnuxlabs/tracekit 1.7.3 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/verify.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-CrGVVBeDJZ+9XrI+RkBx1lPQW8b45d4O1uuz6U2oRc0='; style-src 'sha256-41aEPfNKIK0vxFn3JTgv68G+SOVBoDbHT4QPLHGL360='; worker-src blob:; connect-src 'none'">
6
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-kuXu/QmuZxstsErPCI4BucGSOayQdbymU5Aim0DVWVM='; style-src 'sha256-41aEPfNKIK0vxFn3JTgv68G+SOVBoDbHT4QPLHGL360='; worker-src blob:; connect-src 'none'">
7
7
  <title>tracekit verify</title>
8
8
  <style>
9
9
  :root {
@@ -105,7 +105,7 @@ footer { margin-top: 32px; font-size: 12px; color: var(--muted); }
105
105
  <footer>tracekit <span id="version"></span> · same checks as <code>tracekit verify</code> · files never leave this
106
106
  page</footer>
107
107
  </main>
108
- <script id="verifier" type="module">const SAMPLES = {"sample.tkb":"UEsDBBQAAAAIAKhNU13VJSVdPgEAAP0BAAANAAAAbWFuaWZlc3QuanNvbm2Oy07sMAyG9/MUVdeoE9u5OOdlUGI7oszQorYgHSHenVQsEBLL/+LP/8dlGNu6vZRj/DeMx1bEbvMx1bdF7za94/jQC++2zW227fFlXh672Od1Oesw4eR+N/5M23y3vVsfl2EYt7dlvxIxaDMRzwEd1KqZok+US7SQgKfnfV3uJ6WaabJkmAmgAQZuPjhzTiSCN0XfiDupcSyFoQi1ELiQJEdeMJ8DhvFm//frZrJuuv+wPbKXUpCpVhaRrMGxAyiueyGfMrmMJeUGhME1TUwuQRc+a23fbHkyub2u83LsV6BpWQ874eoDVucYkQxEPR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AATTgAACsAAAAAAAAAAAAAAIABXwEAAHJ1bnMvMzM4MWRmZWNjNDg1MjAxYmJkOTM2NDczOWE2ZTU3MTguanNvbmxQSwECFAMUAAAACAAAACFcsppxGP8BAAC4AwAAEgAAAAAAAAAAAAAAgAEmEQAAa2V5cy9yZWNvcmRzLmpzb25sUEsBAhQDFAAAAAgAAAAhXDx09XXCAAAA8gAAABMAAAAAAAAAAAAAAIABVRMAAGNoZWNrcG9pbnRzLzEzLm5vdGVQSwECFAMUAAAACAAAACFcwFygZmABAAA7AgAAEwAAAAAAAAAAAAAAgAFIFAAAcHJvb2ZzL3JlY29yZHMuanNvblBLBQYAAAAABQAFAFYBAADZFQAAAAA=","sample.trust.json":"ewogImxvZ3MiOiBbCiAgInRyYWNla2l0LmxvY2FsLzRkYTFjZDk2MjAzYjM0ZDc5YmYwMmI4Mjk2ODM3NzA0KzI4NjEwNDI4K0FXaTVIMGFSWGpYQmRuSElwektXcTJXeWZsM2h5R0RhRTlsRHVBMzByY0hwIgogXSwKICJ3aXRuZXNzZXMiOiBbXSwKICJhbGdzIjogWwogICJlZDI1NTE5IgogXSwKICJ3aXRuZXNzZXNfcmVxdWlyZWQiOiAwCn0="};
108
+ <script id="verifier" type="module">const SAMPLES = {"sample.tkb":"UEsDBBQAAAAIAAAAIQAn43VFdAEAAJUCAAANAAAAbWFuaWZlc3QuanNvbqXPwWrkMAwG4Ps8Rch5yViWLct9mWLZEpudaVKStLCUvnsdWnYp7G2Pln8+/Xq7DKOt21M5xodhPLZS9TYfk7ws7a7Tqx9/9MCrbrPNuj0+zctjf+zzupxxmPzkvif++WvzXfc+ersMw7i9LPsVMDeqoolja1mJo5IUx5JRQsg2/drX5X4qSQ0TJCfeUShOWVNhBUqeAIP2vs3nFrLzpbWC1B1fW7bkoEUufBYYxpv+3q+b1nVr+1+bnLaIzQpQADC1WM2Dpii5sTJBqdGrgcPK2fr+IBFIOh0yZ8RPu/7Uente5+U475qW9dATN/PBZYmJEkk0L2TRWSYt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AAgAAAAhXHIRdwrXAAAANAEAABMAAAAAAAAAAAAAAIABlRMAAGNoZWNrcG9pbnRzLzEzLm5vdGVQSwECFAMUAAAACAAAACFcwrElDWABAAA7AgAAEwAAAAAAAAAAAAAAgAGdFAAAcHJvb2ZzL3JlY29yZHMuanNvblBLAQIUAxQAAAAIAAAAIVyqOtZSLwAAADEAAABOAAAAAAAAAAAAAACAAS4WAABwb2xpY2llcy83ZjEzOGMwMWFhN2U1MTc1YTAzM2U4MmUxNzNhOTRmOTBiN2RhYmYxNjYyZWNmODYwMDdmY2YzMDYzMzUzMmJjLmpzb25QSwUGAAAAAAYABgDSAQAAyRYAAAAA","sample.trust.json":"ewogImxvZ3MiOiBbCiAgInRyYWNla2l0LmxvY2FsL2s5NjkxMDhlM2Q1NWVlMjhhMjc3YTc2MmRlNjM0ZWEyZWRkMjhhNmUwNDU5ZWM2MGRjNDFkOTg1ODUwNDhhMzZkKzQwOTJmMGY5K0FVU0FGNUlkclR1Q0NTa29KRXFWVE9yTS80MzdzY3FackJacTlFSDVhUDhDIgogXSwKICJ3aXRuZXNzZXMiOiBbXSwKICJhbGdzIjogWwogICJlZDI1NTE5IgogXSwKICJ3aXRuZXNzZXNfcmVxdWlyZWQiOiAwCn0="};
109
109
  const __jcs = (() => {
110
110
  /**
111
111
  * JCS (RFC 8785) and the strict parser of docs/format-v2.md §1, byte for byte (tests/vectors/jcs.jsonl).
@@ -897,10 +897,611 @@ class Detector {
897
897
  }
898
898
  }
899
899
 
900
- return { Detector };
900
+ return { Detector, glob };
901
+ })();
902
+ const __rx = (() => {
903
+ /**
904
+ * tracekit/policy2/linear.py's Pattern: a linear-time search for the patterns tracekit/policy2/compile.py check_pattern
905
+ * accepts, with RE2's semantics, for the verifier's label patterns (labels.ts): a bundle's own policy may hold any
906
+ * pattern, and JavaScript's RegExp backtracks, so a hostile one would hang the verifier. A pattern outside the subset
907
+ * (translate's lexical rules, sre's syntax, a repeat of a repeat, nested repeat counts past 1000) throws PolicyError;
908
+ * every search spends a Budget the verification shares and throws Spent when it runs out. A port kept in step with the
909
+ * reference by tests/test_run_conditions.py.
910
+ */
911
+ class PolicyError extends Error {
912
+ }
913
+ class Spent extends Error {
914
+ }
915
+ const MAX_REPEAT = 1000, MAX_PROGRAM = 20000;
916
+ const STEPS = 20_000_000;
917
+ const ESCAPES = new Set("dDwWsSbAntrfv"), CLASS_ESCAPES = new Set("dDwWsntrfv"); // compile.py's (no \B)
918
+ const CONTROL = { n: "\n", t: "\t", r: "\r", f: "\f", v: "\v" };
919
+ const isWord = (c) => /^[0-9A-Za-z_]$/.test(c);
920
+ const SPACE = "\t\n\f\r ";
921
+ const CATS = {
922
+ d: (c) => c >= "0" && c <= "9", D: (c) => !(c >= "0" && c <= "9"), w: isWord, W: (c) => !isWord(c),
923
+ s: (c) => SPACE.includes(c), S: (c) => !SPACE.includes(c),
924
+ };
925
+ class Budget {
926
+ steps;
927
+ left;
928
+ constructor(steps = STEPS) {
929
+ this.steps = steps;
930
+ this.left = steps;
931
+ }
932
+ spend(n) {
933
+ this.left -= n;
934
+ if (this.left < 0)
935
+ throw new Spent(`the label patterns took more than ${this.steps} steps to replay`);
936
+ }
937
+ }
938
+ const uniq = (items) => [...new Map(items.map((x) => [JSON.stringify(x), x])).values()];
939
+ const key = (n) => n.op === "char" ? n.kind + JSON.stringify(n.items) : n.op === "at" ? "@" + n.kind : null;
940
+ function charTest(n) {
941
+ if (n.kind === "any")
942
+ return (x) => x !== "\n";
943
+ const tests = n.items.map((it) => it[0] === "L" ? (x) => x.codePointAt(0) === it[1]
944
+ : it[0] === "R" ? (x) => x.codePointAt(0) >= it[1] && x.codePointAt(0) <= it[2] : CATS[it[1]]);
945
+ const negate = n.kind === "notlit" || n.kind === "notin";
946
+ return (x) => tests.some((t) => t(x)) !== negate;
947
+ }
948
+ /** sre's parse of a pattern translate() lets through, as Nodes; PolicyError for what either refuses. */
949
+ class Parser {
950
+ s;
951
+ i = 0;
952
+ names = new Set();
953
+ constructor(s) {
954
+ this.s = s;
955
+ }
956
+ fail(why) { throw new PolicyError(why); }
957
+ /** sre's _parse_sub: the alternatives, their common first nodes moved out, and alternatives of one literal or class
958
+ * each as one class. */
959
+ alternation() {
960
+ const alts = [this.sequence()];
961
+ while (this.s[this.i] === "|") {
962
+ this.i++;
963
+ alts.push(this.sequence());
964
+ }
965
+ if (alts.length === 1)
966
+ return alts[0];
967
+ const out = [];
968
+ while (alts.every((a) => a.length) && key(alts[0][0]) !== null && alts.every((a) => key(a[0]) === key(alts[0][0]))) {
969
+ out.push(alts[0][0]);
970
+ for (const a of alts)
971
+ a.shift();
972
+ }
973
+ if (alts.every((a) => a.length === 1 && a[0].op === "char" && (a[0].kind === "lit" || a[0].kind === "in")))
974
+ return [...out, { op: "char", kind: "in", items: uniq(alts.flatMap((a) => a[0].items)) }];
975
+ return [...out, { op: "branch", alts }];
976
+ }
977
+ sequence() {
978
+ const out = [];
979
+ while (this.i < this.s.length && this.s[this.i] !== "|" && this.s[this.i] !== ")") {
980
+ const c = this.s[this.i];
981
+ if ("*+?{".includes(c)) {
982
+ const [min, max] = this.repeat();
983
+ if (this.s[this.i] === "?")
984
+ this.i++; // lazy: the same whether it matches
985
+ if (this.i < this.s.length && "*+?{".includes(this.s[this.i]))
986
+ this.fail("multiple repeat");
987
+ const last = out.pop();
988
+ if (!last || last.op === "at")
989
+ this.fail("nothing to repeat");
990
+ if (last.op === "repeat")
991
+ this.fail("multiple repeat");
992
+ out.push({ op: "repeat", min, max, body: last.op === "group" ? last.body : [last] });
993
+ continue;
994
+ }
995
+ out.push(this.atom());
996
+ }
997
+ // sre's _parse: a non-capturing group no repeat took is its nodes, in its place (`(?:a)|b` is a class)
998
+ return out.flatMap((n) => n.op === "group" && !n.capture ? n.body : [n]);
999
+ }
1000
+ repeat() {
1001
+ const c = this.s[this.i++];
1002
+ if (c === "*")
1003
+ return [0, Infinity];
1004
+ if (c === "+")
1005
+ return [1, Infinity];
1006
+ if (c === "?")
1007
+ return [0, 1];
1008
+ const m = /^\{(\d+)(,(\d*))?\}/.exec(this.s.slice(this.i - 1, this.i + 40).join(""));
1009
+ if (!m)
1010
+ this.fail("a literal { must be escaped, and a repeat needs a lower bound");
1011
+ this.i += m[0].length - 1;
1012
+ const min = Number(m[1]), max = m[2] === undefined ? min : m[3] === "" ? Infinity : Number(m[3]);
1013
+ if (max < min)
1014
+ this.fail("min repeat greater than max repeat");
1015
+ return [min, max];
1016
+ }
1017
+ atom() {
1018
+ const c = this.s[this.i++];
1019
+ if (c === "(") {
1020
+ const capture = this.s[this.i] !== "?" || this.s[this.i + 1] !== ":";
1021
+ if (this.s[this.i] === "?") {
1022
+ if (this.s[this.i + 1] === ":")
1023
+ this.i += 2;
1024
+ else if (this.s[this.i + 1] === "P" && this.s[this.i + 2] === "<") {
1025
+ const end = this.s.indexOf(">", this.i + 3);
1026
+ const name = end < 0 ? "" : this.s.slice(this.i + 3, end).join("");
1027
+ // (Python's str.isidentifier, near enough: a letter or _, then letters, digits, marks or _)
1028
+ if (!/^[\p{L}\p{Nl}_][\p{L}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}]*$/u.test(name))
1029
+ this.fail(`bad character in group name ${name}`);
1030
+ if (this.names.has(name))
1031
+ this.fail(`redefinition of group name ${name}`);
1032
+ this.names.add(name);
1033
+ this.i = end + 1;
1034
+ }
1035
+ else
1036
+ this.fail("only (?: and (?P< groups are allowed (no flags, lookaround or comments)");
1037
+ }
1038
+ const body = this.alternation();
1039
+ if (this.s[this.i++] !== ")")
1040
+ this.fail("missing ), unterminated subpattern");
1041
+ return { op: "group", body, capture };
1042
+ }
1043
+ if (c === ")")
1044
+ this.fail("unbalanced parenthesis");
1045
+ if (c === "[")
1046
+ return this.set();
1047
+ if (c === ".")
1048
+ return { op: "char", kind: "any", items: [] };
1049
+ if (c === "^")
1050
+ return { op: "at", kind: "begin" };
1051
+ if (c === "$")
1052
+ return { op: "at", kind: "end" };
1053
+ if (c === "\\") {
1054
+ const e = this.escape(false);
1055
+ return typeof e === "string" ? { op: "at", kind: e } : e[0] === "C" ? { op: "char", kind: "in", items: [e] }
1056
+ : { op: "char", kind: "lit", items: [e] };
1057
+ }
1058
+ return { op: "char", kind: "lit", items: [["L", c.codePointAt(0)]] };
1059
+ }
1060
+ /** The class item an escape names; outside a class \A \b are the assertions "beginstr", "boundary". */
1061
+ escape(inClass) {
1062
+ const e = this.s[this.i++];
1063
+ if (e === undefined)
1064
+ this.fail("bad escape (end of pattern)");
1065
+ if (e === "x") {
1066
+ const h = this.s.slice(this.i, this.i + 2).join("");
1067
+ if (!/^[0-9a-fA-F]{2}$/.test(h))
1068
+ this.fail("escape \\x is outside the RE2 subset");
1069
+ this.i += 2;
1070
+ return ["L", parseInt(h, 16)];
1071
+ }
1072
+ if (/^[0-9A-Za-z]$/.test(e) && !(inClass ? CLASS_ESCAPES : ESCAPES).has(e) || e.codePointAt(0) > 127)
1073
+ this.fail(`escape \\${e} is outside the RE2 subset`);
1074
+ if (CONTROL[e])
1075
+ return ["L", CONTROL[e].codePointAt(0)];
1076
+ if (CATS[e])
1077
+ return ["C", e];
1078
+ if (e === "A")
1079
+ return "beginstr";
1080
+ if (e === "b")
1081
+ return "boundary";
1082
+ return ["L", e.codePointAt(0)]; // punctuation, as itself
1083
+ }
1084
+ /** sre's character set: its items, each once; one literal is a literal (negated: notlit). */
1085
+ set() {
1086
+ const negate = this.s[this.i] === "^";
1087
+ if (negate)
1088
+ this.i++;
1089
+ const items = [];
1090
+ const one = (c) => {
1091
+ if (c === "[")
1092
+ this.fail("nested sets and [: :] classes are outside the RE2 subset; escape a literal [");
1093
+ return c === "\\" ? this.escape(true) : ["L", c.codePointAt(0)];
1094
+ };
1095
+ for (;;) {
1096
+ const c = this.s[this.i++];
1097
+ if (c === undefined)
1098
+ this.fail("unterminated character set");
1099
+ if (c === "]" && items.length)
1100
+ break;
1101
+ const lo = one(c);
1102
+ if (this.s[this.i] === "-" && this.s[this.i + 1] !== "]" && this.s[this.i + 1] !== undefined) {
1103
+ this.i++;
1104
+ const hi = one(this.s[this.i++]);
1105
+ if (lo[0] !== "L" || hi[0] !== "L" || hi[1] < lo[1])
1106
+ this.fail("bad character range");
1107
+ items.push(["R", lo[1], hi[1]]);
1108
+ }
1109
+ else
1110
+ items.push(lo);
1111
+ }
1112
+ const u = uniq(items);
1113
+ const cat = (x) => u.some((it) => it[0] === "C" && it[1] === x);
1114
+ if (negate && (cat("d") && cat("D") || cat("w") && cat("W"))) // compile.py _walk's
1115
+ this.fail("a negated class of an escape and its complement ([^\\w\\W]) matches nothing, and the fallback engine "
1116
+ + "reads it as any character");
1117
+ return u.length === 1 && u[0][0] === "L" ? { op: "char", kind: negate ? "notlit" : "lit", items: u }
1118
+ : { op: "char", kind: negate ? "notin" : "in", items: u };
1119
+ }
1120
+ }
1121
+ /** compile.py _risky: an unbounded repeat whose body itself begins with an unbounded repeat ((a+)+). */
1122
+ function risky(items) {
1123
+ const unbounded = (n) => n.op === "repeat" && n.max === Infinity;
1124
+ const starts = (seq) => seq.length > 0 && (unbounded(seq[0]) || seq[0].op === "group"
1125
+ && starts(seq[0].body) || seq[0].op === "branch" && seq[0].alts.some(starts));
1126
+ return items.some((n) => n.op === "repeat" ? unbounded(n) && starts(n.body) || risky(n.body)
1127
+ : n.op === "group" ? risky(n.body) : n.op === "branch" && n.alts.some(risky));
1128
+ }
1129
+ /** compile.py _walk: nested repeat counts multiply to at most MAX_REPEAT. */
1130
+ function walk(items, room = MAX_REPEAT) {
1131
+ for (const n of items) {
1132
+ if (n.op === "repeat") {
1133
+ const count = n.max === Infinity ? n.min : n.max;
1134
+ if (count > room)
1135
+ throw new PolicyError(`repeat counts above ${MAX_REPEAT}, nested ones multiplied, are outside the RE2 subset`);
1136
+ walk(n.body, Math.floor(room / Math.max(count, 1)));
1137
+ }
1138
+ else if (n.op === "group")
1139
+ walk(n.body, room);
1140
+ else if (n.op === "branch")
1141
+ for (const a of n.alts)
1142
+ walk(a, room);
1143
+ }
1144
+ }
1145
+ function emit(items, prog) {
1146
+ for (const n of items) {
1147
+ if (prog.length > MAX_PROGRAM)
1148
+ throw new PolicyError(`the pattern compiles to more than ${MAX_PROGRAM} instructions`);
1149
+ if (n.op === "char")
1150
+ prog.push(["char", charTest(n)]);
1151
+ else if (n.op === "at")
1152
+ prog.push(["at", n.kind]);
1153
+ else if (n.op === "group")
1154
+ emit(n.body, prog);
1155
+ else if (n.op === "branch") {
1156
+ const ends = [];
1157
+ for (const alt of n.alts.slice(0, -1)) {
1158
+ const at = prog.length;
1159
+ prog.push(null);
1160
+ emit(alt, prog);
1161
+ ends.push(prog.length);
1162
+ prog.push(null);
1163
+ prog[at] = ["split", at + 1, prog.length];
1164
+ }
1165
+ emit(n.alts[n.alts.length - 1], prog);
1166
+ for (const at of ends)
1167
+ prog[at] = ["jmp", prog.length];
1168
+ }
1169
+ else {
1170
+ for (let k = 0; k < n.min; k++)
1171
+ emit(n.body, prog);
1172
+ if (n.max === Infinity) {
1173
+ const at = prog.length;
1174
+ prog.push(null);
1175
+ emit(n.body, prog);
1176
+ prog.push(["jmp", at]);
1177
+ prog[at] = ["split", at + 1, prog.length];
1178
+ }
1179
+ else {
1180
+ const outs = [];
1181
+ for (let k = n.min; k < n.max; k++) {
1182
+ outs.push(prog.length);
1183
+ prog.push(null);
1184
+ emit(n.body, prog);
1185
+ }
1186
+ for (const at of outs)
1187
+ prog[at] = ["split", at + 1, prog.length];
1188
+ }
1189
+ }
1190
+ }
1191
+ }
1192
+ class Pattern {
1193
+ prog;
1194
+ found = new Map();
1195
+ constructor(pattern) {
1196
+ const p = new Parser([...pattern]);
1197
+ const items = p.alternation();
1198
+ if (p.i < p.s.length)
1199
+ p.fail("unbalanced parenthesis");
1200
+ if (risky(items))
1201
+ throw new PolicyError("regex has a repeat of a repeat (e.g. '(a+)+'), which can hang matching");
1202
+ walk(items);
1203
+ const prog = [];
1204
+ emit(items, prog);
1205
+ prog.push(["match"]);
1206
+ if (prog.length > MAX_PROGRAM)
1207
+ throw new PolicyError(`the pattern compiles to more than ${MAX_PROGRAM} instructions`);
1208
+ this.prog = prog;
1209
+ }
1210
+ at(kind, t, i) {
1211
+ if (kind === "begin" || kind === "beginstr")
1212
+ return i === 0;
1213
+ if (kind === "end")
1214
+ return i === t.length;
1215
+ return (i > 0 && isWord(t[i - 1])) !== (i < t.length && isWord(t[i])); // \b
1216
+ }
1217
+ /** Whether the pattern matches somewhere in `text`, spending `budget`; a text searched before is answered again. */
1218
+ search(text, budget) {
1219
+ if (!this.found.has(text))
1220
+ this.found.set(text, this.run([...text], budget));
1221
+ return this.found.get(text);
1222
+ }
1223
+ run(t, budget) {
1224
+ let threads = [];
1225
+ for (let i = 0; i <= t.length; i++) {
1226
+ const seen = new Set(), ready = [];
1227
+ for (const start of [...threads, 0]) {
1228
+ const stack = [start];
1229
+ while (stack.length) {
1230
+ const pc = stack.pop();
1231
+ if (seen.has(pc))
1232
+ continue;
1233
+ seen.add(pc);
1234
+ budget.spend(1);
1235
+ const ins = this.prog[pc];
1236
+ if (ins[0] === "match")
1237
+ return true;
1238
+ if (ins[0] === "jmp")
1239
+ stack.push(ins[1]);
1240
+ else if (ins[0] === "split")
1241
+ stack.push(ins[2], ins[1]);
1242
+ else if (ins[0] === "at") {
1243
+ if (this.at(ins[1], t, i))
1244
+ stack.push(pc + 1);
1245
+ }
1246
+ else
1247
+ ready.push(pc);
1248
+ }
1249
+ }
1250
+ if (i === t.length)
1251
+ return false;
1252
+ budget.spend(ready.length);
1253
+ threads = ready.filter((pc) => this.prog[pc][1](t[i])).map((pc) => pc + 1);
1254
+ }
1255
+ return false;
1256
+ }
1257
+ }
1258
+
1259
+ return { Budget, Pattern, PolicyError, STEPS, Spent };
1260
+ })();
1261
+ const __labels = (() => {
1262
+ /**
1263
+ * tracekit/signer/labels.py's Sources and tracekit/verify/v2.py's _run_labels: which run labels a run's records set,
1264
+ * replayed under its compiled policy, for the verifier's `run labels` check (docs/policy-v2.md#run-conditions). A port
1265
+ * kept in step with the reference by tests/test_run_conditions.py.
1266
+ */
1267
+ const { Detector: Detector, glob: glob } = __detect;
1268
+ const { Budget: Budget, Pattern: Pattern, PolicyError: PolicyError } = __rx;
1269
+ const SECTIONS = ["deny", "ask", "flag"];
1270
+ const UNTRUSTED = "untrusted_content";
1271
+ const UNREAD = "TK-OVERSIZE"; // a call the policy couldn't read: it sets every label the policy reads
1272
+ // tracekit/signer/labels.py LOST: the gaps of calls the signer never decided
1273
+ const LOST = ["client_counter_gap", "signer_unavailable", "tailer_lost", "observer_lost"];
1274
+ // tracekit/policy2/compile.py CLASSES: an `untrusted` entry that names one is a class, any other a tool name glob
1275
+ const CLASSES = ["shell", "fs", "http", "sql", "payment", "email", "mcp", "browser", "a2a", "app", "unknown", "harness"];
1276
+ const cut = (s, n) => [...s].slice(0, n).join("");
1277
+ const str = (v) => v === null || v === undefined ? "None" : v === true ? "True" : v === false ? "False"
1278
+ : typeof v === "string" ? v : JSON.stringify(v);
1279
+ const key = (v) => typeof v === "string" ? v : null; // a schema-invalid id names nothing
1280
+ /** Python's order of strings, by code point (JavaScript's `<` and sort() compare UTF-16 code units, which put a
1281
+ * character above U+FFFF before one in U+E000..U+FFFF). */
1282
+ const byCodePoint = (a, b) => {
1283
+ const unit = (u) => u >= 0xd800 && u < 0xe000 ? u + 0x2000 : u >= 0xe000 ? u - 0x800 : u;
1284
+ for (let i = 0; i < Math.min(a.length, b.length); i++)
1285
+ if (a.charCodeAt(i) !== b.charCodeAt(i))
1286
+ return unit(a.charCodeAt(i)) - unit(b.charCodeAt(i));
1287
+ return a.length - b.length;
1288
+ };
1289
+ /** tracekit/policy2/compile.py subject_labels: {rule id: label} of the rules whose labels a rule on the labels field
1290
+ * reads, each rule's non-empty label but a run condition rule's and another labels field rule's. */
1291
+ function subjectLabels(policy) {
1292
+ return new Map(SECTIONS.flatMap((sec) => policy[sec] ?? []).filter((r) => typeof r.label === "string" && r.label
1293
+ && !Object.hasOwn(r, "when") && r.field !== "labels").map((r) => [r.id, r.label]));
1294
+ }
1295
+ /** tracekit/policy2/compile.py labels_subject: the labels `labels` gives `ids`, each once, sorted by code point and
1296
+ * joined by a space; "" when none has one. */
1297
+ const labelsSubject = (ids, labels) => [...new Set(ids.filter((i) => labels.has(i)).map((i) => labels.get(i)))].sort(byCodePoint).join(" ");
1298
+ /** A tool name as CrewAI's sanitize_tool_name leaves it, without its `_` (tracekit/policy2/engine.py _spelling). */
1299
+ function spelling(name) {
1300
+ return name.normalize("NFKD").replace(/[^\x00-\x7f]/g, "").toLowerCase().replace(/[^0-9a-z]/g, "");
1301
+ }
1302
+ class Sources {
1303
+ when = new Map();
1304
+ tracked = new Set();
1305
+ label = new Map();
1306
+ subjectLabels;
1307
+ onLabels = [];
1308
+ refused = new Map(); // rule id -> why its labels pattern can't be compiled as the signer does
1309
+ untrusted;
1310
+ tools;
1311
+ spelled = new Map();
1312
+ classes;
1313
+ constructor(policy) {
1314
+ const rules = SECTIONS.flatMap((sec) => policy[sec] ?? []);
1315
+ for (const r of rules)
1316
+ if (Object.hasOwn(r, "when"))
1317
+ this.when.set(r.id, new Set(r.when.run_has));
1318
+ for (const ls of this.when.values())
1319
+ for (const x of ls)
1320
+ this.tracked.add(x);
1321
+ for (const x of policy.approval_agent?.run?.clean ?? [])
1322
+ this.tracked.add(x); // the AI approver's run bound
1323
+ for (const r of rules)
1324
+ if (this.tracked.has(r.label))
1325
+ this.label.set(r.id, r.label);
1326
+ this.subjectLabels = subjectLabels(policy);
1327
+ const compiled = (p) => {
1328
+ if (typeof p !== "string")
1329
+ throw new PolicyError("the pattern is not a string");
1330
+ return new Pattern(p);
1331
+ };
1332
+ for (const r of rules)
1333
+ if (r.field === "labels" && Object.hasOwn(r, "when") && !Object.hasOwn(r, "tool")) {
1334
+ try { // a bundle's own policy may hold any pattern: searched in linear time, as RE2 reads it (rx.ts)
1335
+ this.onLabels.push([r.id, compiled(r.pattern), Object.hasOwn(r, "unless") ? compiled(r.unless) : null,
1336
+ r.class ?? null]);
1337
+ }
1338
+ catch (e) {
1339
+ if (!(e instanceof PolicyError))
1340
+ throw e;
1341
+ this.refused.set(r.id, e.message);
1342
+ }
1343
+ }
1344
+ this.untrusted = policy.untrusted ?? [];
1345
+ this.tools = policy.tools ?? {};
1346
+ this.classes = new Detector(policy);
1347
+ for (const t of Object.keys(this.tools))
1348
+ if (!/[*?[]/.test(t) && spelling(t))
1349
+ this.spelled.set(spelling(t), [...this.spelled.get(spelling(t)) ?? [], t]);
1350
+ }
1351
+ /** The names `tools:` lists that `tool` spells, when it lists neither the tool nor a glob that takes it. */
1352
+ listed(tool) {
1353
+ if (Object.hasOwn(this.tools, tool) || this.classes.toolClass(tool) !== "unknown")
1354
+ return [];
1355
+ return this.spelled.get(spelling(tool)) ?? [];
1356
+ }
1357
+ untrustedResults(tool) {
1358
+ return [tool, ...this.listed(tool)].some((name) => this.untrusted.some((u) => CLASSES.includes(u) ? u === this.classes.toolClass(name) : glob(u).test(name)));
1359
+ }
1360
+ ofCall(tool, ruleIds) {
1361
+ if (typeof tool === "string" && this.classes.toolClass(tool) === "harness")
1362
+ return new Set();
1363
+ if (ruleIds.includes(UNREAD))
1364
+ return new Set(this.tracked);
1365
+ const out = new Set(ruleIds.filter((i) => this.label.has(i)).map((i) => this.label.get(i)));
1366
+ if (this.tracked.has(UNTRUSTED) && typeof tool === "string" && this.untrustedResults(tool))
1367
+ out.add(UNTRUSTED);
1368
+ return out;
1369
+ }
1370
+ /** The labels record `e` sets; `requested`, `decided`: {tool, rule_ids} of an approval's call and a call's latest
1371
+ * decision, or undefined. */
1372
+ sets(e, requested, decided) {
1373
+ const t = e.type, d = e.data;
1374
+ if (t === "policy.decision" && (d.decision === "allow" || d.decision === "flag"))
1375
+ return this.ofCall(d.tool, d.rule_ids);
1376
+ const call = t === "approval.consumed" ? requested(d.approval_id ?? null)
1377
+ : t === "capture.gap" && d.kind === "executed_against_policy" ? decided(e.tool_call_id ?? null) : undefined;
1378
+ if (call)
1379
+ return this.ofCall(call.tool, call.rule_ids);
1380
+ if (t === "input.observed" && d.trust === "untrusted" && this.tracked.has(UNTRUSTED))
1381
+ return new Set([UNTRUSTED]);
1382
+ if (t === "capture.gap" && LOST.includes(d.kind) || t === "reconcile.hook_missing")
1383
+ return new Set(this.tracked);
1384
+ return new Set();
1385
+ }
1386
+ }
1387
+ /** The policies each of a run's records is replayed under (tracekit/verify/v2.py _policies_at): a decision's own; another
1388
+ * record's, that of the decision before it (the first one's before any) and, between two decisions under different
1389
+ * policies, the next one's too. */
1390
+ function policiesAt(events, srcs) {
1391
+ if (srcs.size === 1)
1392
+ return events.map(() => [...srcs.values()]);
1393
+ const named = events.map((e) => e.type === "policy.decision" && Object.hasOwn(e.data, "policy_hash")
1394
+ ? str(e.data.policy_hash) : null);
1395
+ const next = [];
1396
+ let after = null, before = null;
1397
+ for (let i = named.length - 1; i >= 0; i--)
1398
+ next[i] = after = named[i] ?? after;
1399
+ return named.map((h, i) => {
1400
+ before = h ?? before;
1401
+ return [...new Set([before ?? next[i], next[i] ?? before])].map((x) => srcs.get(x));
1402
+ });
1403
+ }
1404
+ /** The problems of one run's labels under `srcs` (policy_hash -> Sources), each record under its policy
1405
+ * (tracekit/verify/v2.py _run_labels); each inherited add of a label its policy reads goes to `inherited` as [where,
1406
+ * label, the add it cites]. */
1407
+ function runLabels(events, srcs, inherited, budget = new Budget()) {
1408
+ const problems = [], carried = new Set(), asked = new Map(), decided = new Map();
1409
+ const seqs = new Map(), at = policiesAt(events, srcs);
1410
+ let owed = new Map(), may = new Map(), owner = null;
1411
+ const callers = new Set();
1412
+ for (const [n, e] of events.entries()) {
1413
+ const t = e.type, d = e.data, where = `seq ${str(e.seq)}`, cands = at[n], src = cands[0];
1414
+ if (!Number.isInteger(e.run_seq))
1415
+ continue; // schema-invalid: its schema check fails it
1416
+ seqs.set(e.run_seq, e.seq ?? null);
1417
+ if (t === "run.registered" && typeof d.identity === "object" && d.identity !== null && !Array.isArray(d.identity))
1418
+ owner = `${str(d.identity.scheme ?? null)}:${str(d.identity.subject ?? null)}`;
1419
+ // the client a gateway registered it for, a writer: requesters of the run
1420
+ if (t === "run.registered" || t === "run.writer")
1421
+ callers.add(t === "run.registered" ? d.caller : d.identity);
1422
+ if (t === "run.label" && d.action === "clear" && Object.hasOwn(d, "run_id"))
1423
+ continue; // an ended run's
1424
+ if (t === "run.label") {
1425
+ const x = key(d.label);
1426
+ if (d.action === "add") {
1427
+ if (x !== null && carried.has(x))
1428
+ problems.push(`${where}: adds ${cut(str(x), 32)}, which the run carries already`);
1429
+ else if (Object.hasOwn(d, "inherited") && x !== null && cands.some((c) => c.tracked.has(x)))
1430
+ inherited.push([where, x, d.inherited]);
1431
+ else if (Object.hasOwn(d, "inherited"))
1432
+ problems.push(`${where}: inherits ${cut(str(x), 32)}, which the run's policy doesn't read`);
1433
+ else if (x === null || d.source === undefined || d.source === null
1434
+ || (owed.get(x) !== d.source && may.get(x) !== d.source))
1435
+ problems.push(`${where}: adds ${cut(str(x), 32)} citing run_seq ${cut(str(d.source ?? null), 20)}, which doesn't `
1436
+ + "set it under the run's policy");
1437
+ if (x !== null) {
1438
+ owed.delete(x);
1439
+ may.delete(x);
1440
+ carried.add(x);
1441
+ }
1442
+ }
1443
+ else if (x === null || !carried.has(x))
1444
+ problems.push(`${where}: clears ${cut(str(x), 32)}, which the run doesn't carry`);
1445
+ else if ((d.identity ?? null) === owner && d.self_cleared !== true)
1446
+ problems.push(`${where}: ${cut(str(x), 32)} cleared by the run's own owner`);
1447
+ else if (callers.has(d.identity) && d.self_cleared !== true)
1448
+ problems.push(`${where}: ${cut(str(x), 32)} cleared by a requester of the run (a writer or a gateway's caller)`);
1449
+ else
1450
+ carried.delete(x);
1451
+ continue;
1452
+ }
1453
+ if (t === "policy.decision" || t === "approval.consumed") {
1454
+ for (const [x, s] of owed)
1455
+ problems.push(`seq ${str(seqs.get(s) ?? null)}: sets ${x}, which no run.label adds before ${where}`);
1456
+ for (const x of owed.keys())
1457
+ carried.add(x);
1458
+ owed = new Map();
1459
+ may = new Map();
1460
+ }
1461
+ const ids = Array.isArray(d.rule_ids) ? d.rule_ids.filter((i) => typeof i === "string") : [];
1462
+ if (t === "policy.decision") {
1463
+ const have = new Set([...carried, ...ids.filter((i) => src.label.has(i)).map((i) => src.label.get(i))]);
1464
+ const used = new Set(Array.isArray(d.run_labels) ? d.run_labels.filter((x) => typeof x === "string") : []);
1465
+ for (const x of [...used].filter((x) => !have.has(x)).sort(byCodePoint))
1466
+ problems.push(`${where}: run_labels names ${cut(x, 32)}, which the run didn't carry`);
1467
+ for (const i of ids)
1468
+ if (src.when.has(i) && ![...src.when.get(i)].every((x) => used.has(x)))
1469
+ problems.push(`${where}: ${i} applied without run_labels naming ${[...src.when.get(i)].sort(byCodePoint).join(", ")}`);
1470
+ // a run condition on the labels field, replayed from the call's rule ids as Engine.condition matches it
1471
+ // (labels.py, verify/v2.py _run_labels)
1472
+ const subject = labelsSubject(ids, src.subjectLabels);
1473
+ const tool = typeof d.tool === "string" ? d.tool : null;
1474
+ if (subject && !decided.has(key(e.tool_call_id ?? null)) && tool && src.classes.toolClass(tool) !== "harness")
1475
+ for (const [rid, rx, unless, cls] of src.onLabels)
1476
+ if (!ids.includes(rid) && [...src.when.get(rid)].every((x) => have.has(x))
1477
+ && (cls === null || cls === src.classes.toolClass(tool)) && rx.search(subject, budget)
1478
+ && !(unless && unless.search(subject, budget)))
1479
+ problems.push(`${where}: ${rid} applies (the call's labels ${subject}; the run carried `
1480
+ + `${[...src.when.get(rid)].sort(byCodePoint).join(", ")}) but the decision doesn't name it`);
1481
+ if (typeof d.caller === "string")
1482
+ callers.add(d.caller);
1483
+ decided.set(key(e.tool_call_id ?? null), { tool: d.tool ?? null, rule_ids: ids });
1484
+ }
1485
+ else if (t === "approval.request" && typeof d.binding === "object" && d.binding !== null && !Array.isArray(d.binding))
1486
+ asked.set(key(d.approval_id ?? null), { tool: d.binding.tool ?? null, rule_ids: ids });
1487
+ const call = t === "policy.decision" ? { ...d, rule_ids: ids } : d;
1488
+ const sets = cands.map((c) => c.sets({ ...e, data: call }, (a) => asked.get(key(a)), (c) => decided.get(key(c))));
1489
+ const need = [...sets[0]].filter((x) => sets.every((s) => s.has(x)));
1490
+ for (const x of need.filter((x) => !carried.has(x) && !owed.has(x)).sort(byCodePoint))
1491
+ owed.set(x, e.run_seq);
1492
+ for (const x of [...new Set(sets.flatMap((s) => [...s]))].filter((x) => !need.includes(x) && !carried.has(x)
1493
+ && !owed.has(x) && !may.has(x)).sort(byCodePoint))
1494
+ may.set(x, e.run_seq);
1495
+ }
1496
+ for (const [x, s] of owed)
1497
+ problems.push(`seq ${str(seqs.get(s) ?? null)}: sets ${x}, which no run.label adds`);
1498
+ return problems;
1499
+ }
1500
+
1501
+ return { Sources, byCodePoint, labelsSubject, policiesAt, runLabels, subjectLabels };
901
1502
  })();
902
1503
  const __schema = (() => {
903
- const SCHEMA = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/Cygnux-Labs/Tracekit/schema/tracekit.event.v2.json","title":"Tracekit event v2","description":"One event in a format v2 record log. Additive over tracekit.event.v1: new optional fields and types, and bounds on every string and array. Validated with full-match ASCII patterns.","type":"object","additionalProperties":false,"required":["schema_version","id","seq","prev_hash","ts","run_id","agent_id","parent_id","source","type","data","log_id","tenant","run_seq","run_prev_hash"],"properties":{"schema_version":{"const":"tracekit.event.v2"},"id":{"type":"string","pattern":"^[0-9a-f]{32}$","description":"Random 128-bit id, hex.","maxLength":4096},"seq":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Signer's monotonic counter. Assigned by tracekitd, never by the client."},"prev_hash":{"$ref":"#/$defs/hash","description":"Hash of the previous record in this log; sha256: and 64 zeros for seq 0."},"ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","description":"Client-reported time, UTC, microseconds.","maxLength":4096},"ts_signed":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","description":"Time the signer accepted the event.","maxLength":4096},"run_id":{"type":"string","minLength":1,"maxLength":200},"agent_id":{"type":"string","minLength":1,"maxLength":200,"description":"\"main\" for the top-level agent, otherwise the harness's sub-agent id."},"parent_id":{"type":["string","null"],"maxLength":200,"description":"agent_id of the spawning agent, or null."},"source":{"enum":["hook","proxy","transcript","signer","sdk","migrated","import","gateway"],"description":"Capture path. transcript = harness-reported, lower trust; import = received over OTLP, or another system's decision (decision_import) (tier T3): receipt only; gateway = model.exchange recorded by the LLM gateway, or a tool call (policy.decision, approval.request, tool.result) or an input (input.observed) the MCP gateway or a tool executor decided, ran or received for its client (tier T2)."},"type":{"enum":["run.start","run.end","tool.call","policy.decision","approval","tool.result","error","review","trace.tamper","capture.gap","checkpoint","user.prompt","model.message","model.exchange","run.registered","run.closing","run.final","approval.request","approval.consumed","approval.expired","approval.refused","approval.binding_mismatch","approval.abandoned","approval.escalated","approval.revoked","approval.suggested","approval.agents","input.observed","state.write","signer.epoch","key.retire","log.closed","reconcile.hook_missing","reconcile.fabricated","reconcile.args_mismatch","reconcile.result_without_call","reconcile.unexplained_effect","reconcile.args_unparseable","reconcile.result_mismatch","refusal.summary","policy.external","content.accessed","content.erased","why.finding","run.child","incident.opened","incident.updated","incident.capped","run.held","run.resumed","run.quarantined","incident.resolved","incident.response","identity.suspension","effect.observed","constraint.added","ext"]},"data":{"type":"object"},"transcript":{"type":"object","additionalProperties":false,"required":["path","length","hash"],"description":"C2: what the hook read of the harness transcript at this point (prefix hash). Lets the signer detect later edits, truncation or deletion.","properties":{"path":{"type":"string","maxLength":4096},"length":{"type":"integer","minimum":0},"hash":{"$ref":"#/$defs/commitment"},"prefix_length":{"type":["integer","null"],"minimum":0,"description":"Length the signer last acknowledged for this path."},"prefix_hash":{"oneOf":[{"$ref":"#/$defs/commitment"},{"type":"null"}],"description":"Hash of the first prefix_length bytes as read now."},"missing":{"type":"boolean"}}},"log_id":{"type":"string","pattern":"^[0-9a-f]{32}$","description":"The record log this event belongs to.","maxLength":4096},"tenant":{"$ref":"#/$defs/id"},"tenant_attested":{"type":"boolean"},"principal":{"type":"string","maxLength":256},"principal_attested":{"type":"boolean"},"request_id":{"$ref":"#/$defs/id"},"stream":{"$ref":"#/$defs/id"},"client_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"tool_call_id":{"$ref":"#/$defs/id"},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991},"step":{"type":"integer","minimum":0,"maximum":9007199254740991},"run_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"run_prev_hash":{"$ref":"#/$defs/hash"},"capture_layer":{"enum":["L1","L2","L3","L4","L5","L6"]},"tier":{"enum":["T1","T2","T3"]},"span_id":{"type":"string","pattern":"^[0-9a-f]{16}$","maxLength":16,"description":"source import: the OpenTelemetry span the record was imported from"},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":4096},"args_source":{"enum":["raw","parsed","coerced"]},"engine":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9._-]+@[A-Za-z0-9._+-]+$","description":"Policy engine id@version."},"ext":{"type":"object","propertyNames":{"$ref":"#/$defs/ext_name"},"description":"Non-critical fields (format 1.4), on any record: {name: any strict JSON value}. A verifier that does not interpret a name still checks the record's signature, chain and inclusion, and says it did not interpret the name (docs/format-v2.md section 9)."}},"allOf":[{"if":{"properties":{"type":{"const":"run.start"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_start"}}}},{"if":{"properties":{"type":{"const":"run.end"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_end"}}}},{"if":{"properties":{"type":{"const":"tool.call"}}},"then":{"properties":{"data":{"$ref":"#/$defs/tool_call"}}}},{"if":{"properties":{"type":{"const":"policy.decision"}}},"then":{"properties":{"data":{"$ref":"#/$defs/policy_decision"}}}},{"if":{"properties":{"type":{"const":"approval"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval"}}}},{"if":{"properties":{"type":{"const":"tool.result"}}},"then":{"properties":{"data":{"$ref":"#/$defs/tool_result"}}}},{"if":{"properties":{"type":{"const":"error"}}},"then":{"properties":{"data":{"$ref":"#/$defs/error"}}}},{"if":{"properties":{"type":{"const":"review"}}},"then":{"properties":{"data":{"$ref":"#/$defs/review"}}}},{"if":{"properties":{"type":{"const":"trace.tamper"}}},"then":{"properties":{"data":{"$ref":"#/$defs/trace_tamper"}}}},{"if":{"properties":{"type":{"const":"capture.gap"}}},"then":{"properties":{"data":{"$ref":"#/$defs/capture_gap"}}}},{"if":{"properties":{"type":{"const":"checkpoint"}}},"then":{"properties":{"data":{"$ref":"#/$defs/checkpoint"}}}},{"if":{"properties":{"type":{"const":"user.prompt"}}},"then":{"properties":{"data":{"$ref":"#/$defs/user_prompt"}}}},{"if":{"properties":{"type":{"const":"model.message"}}},"then":{"properties":{"data":{"$ref":"#/$defs/model_message"}}}},{"if":{"properties":{"type":{"const":"model.exchange"}}},"then":{"properties":{"data":{"$ref":"#/$defs/model_exchange"}}}},{"if":{"properties":{"type":{"const":"run.registered"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_registered"}}}},{"if":{"properties":{"type":{"const":"run.closing"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_closing"}}}},{"if":{"properties":{"type":{"const":"run.final"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_final"}}}},{"if":{"properties":{"type":{"const":"approval.request"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_request"}}}},{"if":{"properties":{"type":{"const":"approval.consumed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_consumed"}}}},{"if":{"properties":{"type":{"const":"approval.expired"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_expired"}}}},{"if":{"properties":{"type":{"const":"approval.refused"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_refused"}}}},{"if":{"properties":{"type":{"const":"approval.binding_mismatch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_binding_mismatch"}}}},{"if":{"properties":{"type":{"const":"approval.abandoned"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_abandoned"}}}},{"if":{"properties":{"type":{"const":"approval.escalated"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_escalated"}}}},{"if":{"properties":{"type":{"const":"approval.revoked"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_revoked"}}}},{"if":{"properties":{"type":{"const":"approval.suggested"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_suggested"}}}},{"if":{"properties":{"type":{"const":"approval.agents"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_agents"}}}},{"if":{"properties":{"type":{"const":"input.observed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/input_observed"}}}},{"if":{"properties":{"type":{"const":"state.write"}}},"then":{"properties":{"data":{"$ref":"#/$defs/state_write"}}}},{"if":{"properties":{"type":{"const":"signer.epoch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/signer_epoch"}}}},{"if":{"properties":{"type":{"const":"key.retire"}}},"then":{"properties":{"data":{"$ref":"#/$defs/key_retire"}}}},{"if":{"properties":{"type":{"const":"log.closed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/log_closed"}}}},{"if":{"properties":{"type":{"const":"reconcile.hook_missing"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.fabricated"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.args_mismatch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.result_without_call"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.unexplained_effect"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile_effect"}}}},{"if":{"properties":{"type":{"const":"reconcile.args_unparseable"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.result_mismatch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"refusal.summary"}}},"then":{"properties":{"data":{"$ref":"#/$defs/refusal_summary"}}}},{"if":{"properties":{"type":{"const":"policy.external"}}},"then":{"properties":{"data":{"$ref":"#/$defs/policy_external"}}}},{"if":{"properties":{"type":{"const":"content.accessed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/content_accessed"}}}},{"if":{"properties":{"type":{"const":"content.erased"}}},"then":{"properties":{"data":{"$ref":"#/$defs/content_erased"}}}},{"if":{"properties":{"type":{"const":"why.finding"}}},"then":{"properties":{"data":{"$ref":"#/$defs/why_finding"}}}},{"if":{"properties":{"type":{"const":"run.child"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_child"}}}},{"if":{"properties":{"type":{"const":"incident.opened"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_opened"}}}},{"if":{"properties":{"type":{"const":"incident.updated"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_updated"}}}},{"if":{"properties":{"type":{"const":"incident.capped"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_capped"}}}},{"if":{"properties":{"type":{"const":"run.held"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_held"}}}},{"if":{"properties":{"type":{"const":"run.resumed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_resumed"}}}},{"if":{"properties":{"type":{"const":"run.quarantined"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_quarantined"}}}},{"if":{"properties":{"type":{"const":"incident.resolved"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_resolved"}}}},{"if":{"properties":{"type":{"const":"incident.response"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_response"}}}},{"if":{"properties":{"type":{"const":"identity.suspension"}}},"then":{"properties":{"data":{"$ref":"#/$defs/identity_suspension"}}}},{"if":{"properties":{"type":{"const":"effect.observed"}}},"then":{"properties":{"data":{"oneOf":[{"$ref":"#/$defs/effect_observed"},{"$ref":"#/$defs/sensor_effect"}]}}}},{"if":{"properties":{"type":{"const":"constraint.added"}}},"then":{"properties":{"data":{"$ref":"#/$defs/constraint_added"}}}},{"if":{"properties":{"type":{"const":"ext"}}},"then":{"properties":{"data":{"$ref":"#/$defs/ext"}}}}],"$defs":{"hash":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$","maxLength":71},"commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76,"description":"HMAC-SHA256 of a sha256: digest of agent content under a per-record salt the signer keeps and can reveal for that one record (tracekit signer reveal)"},"redaction":{"type":"object","additionalProperties":false,"required":["rules","count","client_claimed"],"description":"what the signer redacted from this record's content before committing to it; never the values","properties":{"rules":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":64},"description":"the redaction rules that fired"},"count":{"type":"integer","minimum":0},"client_claimed":{"type":"boolean","description":"the client said it redacted the content already"},"client":{"type":"object","additionalProperties":false,"description":"the client's own manifest, as it claimed it","properties":{"rules":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64}},"count":{"type":"integer","minimum":0}}},"client_redaction_incomplete":{"const":true,"description":"the client claimed redaction and the signer still found a secret"}}},"content":{"description":"Either the (redacted) value or a reference to it. Which one is decided by docs/privacy.md, never by the caller.","oneOf":[{"type":"object","additionalProperties":false,"required":["value","redacted"],"properties":{"value":{},"redacted":{"type":"boolean"}}},{"type":"object","additionalProperties":false,"required":["hash","size","redacted"],"properties":{"hash":{"$ref":"#/$defs/commitment"},"size":{"type":"integer","minimum":0},"redacted":{"type":"boolean"}}}]},"run_start":{"type":"object","additionalProperties":false,"required":["agent","host","os_user","fail_mode","policy","capture_sources","sandbox","content_capture","signer_isolation"],"properties":{"agent":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":4096},"version":{"type":["string","null"],"maxLength":4096}}},"model":{"type":["string","null"],"maxLength":4096},"repo":{"type":["string","null"],"maxLength":4096},"commit":{"type":["string","null"],"maxLength":4096},"cwd":{"type":["string","null"],"maxLength":4096},"host":{"type":"string","maxLength":4096},"os_user":{"type":"string","maxLength":4096},"fail_mode":{"enum":["open","closed"]},"policy":{"type":"object","additionalProperties":false,"required":["version","hash"],"properties":{"version":{"type":"string","maxLength":4096},"hash":{"$ref":"#/$defs/hash"}}},"capture_sources":{"type":"array","items":{"enum":["hook","proxy","transcript","sdk"]},"maxItems":1024},"sandbox":{"enum":["none","unknown","self-reported-active"]},"content_capture":{"enum":["hashed","full"]},"reasoning_capture":{"type":"boolean"},"signer_isolation":{"enum":["separate-user","same-user"]},"os_user_attested":{"type":"boolean","description":"true when tracekitd set os_user from the socket peer's credentials rather than trusting the client."},"harness":{"type":"object","additionalProperties":false,"description":"0.3: set only by the signer. The registered harness instance the run.start came from (pid + kernel start time), found from the kernel's view of the sender's process tree.","required":["name","exe","pid","attested"],"properties":{"name":{"type":"string","maxLength":4096},"exe":{"type":"string","maxLength":4096},"pid":{"type":"integer"},"start_time":{"type":["integer","null"]},"attested":{"type":"boolean"}}}}},"run_end":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"reason":{"type":"string","maxLength":4096}}},"tool_call":{"type":"object","additionalProperties":false,"required":["tool_use_id","name","input"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"name":{"type":"string","maxLength":4096},"input":{"type":"object","additionalProperties":{"$ref":"#/$defs/content"}},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"}}},"policy_decision":{"type":"object","additionalProperties":false,"required":["tool_use_id","decision","rule_ids"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"decision":{"enum":["allow","deny","flag","ask"]},"rule_ids":{"type":"array","items":{"type":"string","maxLength":4096},"maxItems":1024},"reasons":{"type":"array","items":{"type":"string","maxLength":4096},"maxItems":1024},"policy_hash":{"$ref":"#/$defs/hash","description":"hash of the policy that produced this decision"},"policy_version":{"type":"string","maxLength":4096},"tool":{"type":"string","maxLength":256,"description":"tool name the decision is for"},"decision_id":{"$ref":"#/$defs/id","description":"signer-assigned; `complete` consumes it once"},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76,"description":"HMAC of the signer's args digest under a per-decision salt the signer can reveal to an auditor; absent when the args failed strict parsing"},"engine":{"type":"string","maxLength":64,"description":"matching engine id@version"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$","maxLength":32},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"nondeterministic":{"type":"boolean","description":"a fallback-engine match ran out of time and denied"},"provenance":{"type":"array","maxItems":16,"description":"argument values that only untrusted content brought into the run: the top-level argument, the kind of value and the record that brought it; never the value","items":{"type":"object","additionalProperties":false,"required":["field","kind","source"],"properties":{"field":{"type":"string","maxLength":256},"kind":{"enum":["email","url","host","path","digits","string"]},"source":{"type":"object","additionalProperties":false,"required":["run_seq"],"properties":{"run_seq":{"type":"integer","minimum":0},"tool":{"type":"string","maxLength":256},"tool_call_id":{"$ref":"#/$defs/id"}}}}}},"provenance_state":{"enum":["complete","partial","truncated","unavailable","timeout"],"description":"the run's provenance index: complete, partial (an untrusted tool's result came as a digest), truncated (more values than it reads), unavailable (lost in a signer restart) or timeout (this call's values took past the decision's deadline); when not complete, from: untrusted rules match whenever their pattern does"},"provenance_reason":{"type":"string","maxLength":256,"description":"why provenance_state is not complete"},"detect":{"type":"object","additionalProperties":false,"required":["sequences","limits","state"],"description":"format 1.2: what the policy's sequences and limits saw of this call (signer/detect.py): the step each sequence it advanced reached, the count (a sum limit: the total of the call's currency) and window start of each limit it counted, and whether the detector's state is complete or was lost in a restart (unavailable)","properties":{"rule_ids":{"type":"array","maxItems":1024,"items":{"type":"string","maxLength":256},"description":"the rule ids of both class readings, when the client's class hint disagreed and they differ from rule_ids"},"sums":{"type":"object","description":"per sum limit: [amount in minor units, currency] of this call","additionalProperties":{"type":"array","minItems":2,"maxItems":2,"items":{"type":["integer","string"],"maxLength":16}}},"sequences":{"type":"array","maxItems":1024,"items":{"type":"object","additionalProperties":false,"required":["id","step"],"properties":{"id":{"type":"string","maxLength":256},"step":{"type":"integer","minimum":1}}}},"limits":{"type":"array","maxItems":1024,"items":{"type":"object","additionalProperties":false,"required":["id","count","window_start"],"properties":{"id":{"type":"string","maxLength":256},"count":{"type":"integer"},"window_start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27}}}},"state":{"enum":["complete","unavailable"]}}},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"},"caller":{"type":"string","maxLength":256,"description":"format 1.2, with via: the client (scheme:subject) the gateway or tool executor decided the call for"},"incident_id":{"$ref":"#/$defs/id","description":"format 1.2: the incident whose hold (ask, TK-HOLD) or quarantine (deny, TK-QUARANTINE) decided the call"}}},"approval":{"type":"object","additionalProperties":false,"required":["tool_use_id","decision","approver","channel"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"decision":{"enum":["approve","reject","timeout","self_approval_refused"]},"approver":{"type":"string","maxLength":4096},"channel":{"type":"string","maxLength":4096},"approver_uid":{"type":["integer","null"]},"wait_ms":{"type":["integer","null"]},"same_user":{"type":["boolean","null"],"description":"true when the approver is the agent's own OS user (dev mode only; not trustworthy)"},"approval_id":{"$ref":"#/$defs/id"},"self_approved":{"type":"boolean","description":"the approver is the requester (dev mode only); caps assurance at dev"},"reason":{"type":"string","maxLength":1024},"approver_identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the approver as the signer's transport established it"},"break_glass":{"type":"boolean","description":"answered under the break-glass role, which may answer any approval"},"via":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the bridge (Slack, or the viewer's approval pages) that answered for the approver, as the signer's transport established it"},"groups":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64},"description":"user groups the bridge found the approver in"},"person":{"type":"string","maxLength":4096,"description":"the person id the signer's config maps the approver to"},"passkey":{"type":"object","additionalProperties":false,"required":["credential_id","user_verified"],"properties":{"credential_id":{"type":"string","maxLength":4096},"user_verified":{"const":true}},"description":"the WebAuthn credential whose assertion over the approval's binding digest the signer verified"},"approver_kind":{"const":"agent","description":"format 1.2: an agent approver (approvals.agents) answered; absent for people"},"asserted":{"type":"object","additionalProperties":false,"required":["attested"],"properties":{"model":{"type":"string","maxLength":128},"version":{"type":"string","maxLength":64},"prompt_hash":{"$ref":"#/$defs/hash"},"attested":{"const":false}},"description":"format 1.2: what the agent approver says it runs; its own word, never checked"},"spent":{"type":"object","additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"format 1.2: rule id -> the argument value this agent approval takes from the rule's sum budget"},"not_before":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096,"description":"format 1.2: an agent's approval is consumed from then on (after the rule's veto_s), so people may revoke it first"},"consume_by":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096,"description":"format 1.2: an agent's approval is consumed before then (approvals.agent_consume_s), or never"},"incident_id":{"$ref":"#/$defs/id","description":"format 1.2: the answer to a call held by this incident, by the person `person`"}}},"tool_result":{"type":"object","additionalProperties":false,"required":["tool_use_id","ok","output"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"ok":{"type":"boolean"},"output":{"$ref":"#/$defs/content"},"duration_ms":{"type":["integer","null"]},"decision_id":{"$ref":"#/$defs/id","description":"the policy.decision this result consumes"},"redaction":{"$ref":"#/$defs/redaction"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"}}},"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string","maxLength":4096}}},"review":{"type":"object","required":["reviewer","verdict"],"properties":{"reviewer":{"type":"string","maxLength":4096},"verdict":{"type":"object"},"cites":{"type":"array","maxItems":256,"items":{"type":"object","additionalProperties":false,"required":["run_seq","hash"],"properties":{"run_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"hash":{"$ref":"#/$defs/hash"}}},"description":"A signed finding (format 1.4; review_finding), in a findings run: the records of the analysed run it rests on, by run_seq and record hash. A review without cites (a migrated v1 judge verdict) is imported, not checked."}}},"trace_tamper":{"type":"object","additionalProperties":false,"required":["path","before","after"],"properties":{"tenant_level":{"type":"boolean"},"path":{"type":"string","maxLength":4096},"before":{"type":"object","properties":{"hash":{"$ref":"#/$defs/hash"},"length":{"type":"integer"}}},"after":{"type":"object","properties":{"hash":{"type":["string","null"],"maxLength":4096},"length":{"type":["integer","null"]}}},"kind":{"enum":["deleted","truncated","edited","prefix_unverifiable","rollback"]}}},"capture_gap":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"tenant_level":{"type":"boolean"},"reason":{"type":"string","maxLength":4096},"from_ts":{"type":["string","null"],"maxLength":4096},"to_ts":{"type":["string","null"],"maxLength":4096},"missed_events":{"type":["integer","null"]},"kind":{"enum":["signer_unavailable","client_counter_gap","retry_conflict","run_abandoned","witness_late","witness_failed","degraded_unanchored","format_upgrade","policy_timeout","decision_flip","class_mismatch","args_coerced","reconcile.hook_missing","reconcile.fabricated","reconcile.args_mismatch","reconcile.result_without_call","reconcile.unexplained_effect","state_tamper","tailer_lost","rollback","clock_skew","key_retired","key_revoked","log_closed","quota_refused","identity_refused","approval_expired","executed_against_policy","decision_mismatch","decided_not_completed","late_activity","concurrent_run","tailer_redelegated","reask_after_reject","held_call_unresolved","observer_lost","effect_outside_run","result_unchecked","constraint_refused"],"description":"Gap and tamper kinds (signer-written only)."},"run_id":{"$ref":"#/$defs/id","description":"format 1.2: the other run the gap is about (late_activity: the final run that was written to; concurrent_run: the open run this one overlaps; client_counter_gap in a tenant's signer run: the final run whose stream it is; effect_outside_run: the run the client named, its token valid or not, or the effect was attributed to)"},"tool_use_id":{"type":["string","null"],"maxLength":4096},"sensor":{"enum":["tetragon","falco","openshell"],"description":"format 1.4: the sensor (a kernel sensor, or OpenShell) whose import an observer_lost gap is about"}}},"checkpoint":{"type":"object","additionalProperties":false,"required":["head_seq","head_hash","kid","witnesses"],"properties":{"head_seq":{"type":"integer"},"head_hash":{"type":"string","pattern":"^[0-9a-f]{64}$","maxLength":4096},"kid":{"type":"string","maxLength":4096},"witnesses":{"type":"array","items":{"type":"string","maxLength":4096},"maxItems":1024}}},"user_prompt":{"type":"object","additionalProperties":false,"required":["content"],"properties":{"content":{"$ref":"#/$defs/content"}}},"model_message":{"type":"object","additionalProperties":false,"required":["kind","content"],"description":"Self-reported model output read from the harness transcript. Opt-in, off by default, lower trust.","properties":{"kind":{"enum":["text","thinking","thinking_withheld"]},"message_id":{"type":["string","null"],"maxLength":4096},"content":{"$ref":"#/$defs/content"}}},"model_exchange":{"type":"object","additionalProperties":false,"required":["exchange_id","phase","streamed"],"description":"C3: one model API request/response recorded by the proxy (source=proxy) before the request was forwarded and when the response completed.","properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"exchange_id":{"type":"string","maxLength":4096},"phase":{"enum":["request","response"]},"model":{"type":["string","null"],"maxLength":4096},"request":{"$ref":"#/$defs/content"},"response":{"$ref":"#/$defs/content"},"status":{"type":["integer","null"]},"streamed":{"type":"boolean"},"duration_ms":{"type":["integer","null"]},"first_byte_ms":{"type":["integer","null"]},"added_latency_ms":{"type":["number","null"]},"tool_uses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","maxLength":4096},"name":{"type":"string","maxLength":4096},"executed_by":{"enum":["client","provider"]},"args_source":{"enum":["raw","parsed","coerced"]},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"args_unparseable":{"const":true,"description":"the raw arguments string failed strict parsing"},"id_synthetic":{"const":true,"description":"the provider gave no id; the reporting client made this one"}}},"maxItems":1024},"said_only":{"const":true,"description":"format 1.4: a response recorded with what the model said and without the calls it asked for (a harness whose hooks name no call); reconciliation reads no call from it"},"tool_results_sent":{"type":"array","items":{"type":"string","maxLength":4096},"description":"tool_use ids whose results the harness sent back in this request","maxItems":1024},"stop_reason":{"type":["string","null"],"maxLength":4096},"upstream":{"type":"string","maxLength":4096},"error":{"type":["string","null"],"maxLength":4096},"attribution":{"enum":["metadata","tool_use_id","none"]},"usage":{"type":"object","additionalProperties":false,"required":["input_tokens","output_tokens"],"description":"Token usage on the response (optional). input_tokens excludes cache reads; reasoning_tokens is part of output_tokens.","properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"cache_read_tokens":{"type":["integer","null"],"minimum":0},"cache_write_tokens":{"type":["integer","null"],"minimum":0},"reasoning_tokens":{"type":["integer","null"],"minimum":0}}},"content_digest":{"$ref":"#/$defs/commitment"}}},"id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"run_registered":{"type":"object","additionalProperties":false,"required":["agent","identity"],"properties":{"agent":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"version":{"type":"string","maxLength":64}}},"identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"enum":["uid","harness","token","k8s_sa","mtls","oidc"]},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}}},"signer_isolation":{"enum":["same-user","separate-user","remote","unknown"],"description":"measured by the signer from the caller's identity, never taken from the client"},"harness":{"type":"object","additionalProperties":false,"required":["name","exe","pid","start_time","attested"],"properties":{"name":{"type":"string","maxLength":64},"exe":{"type":"string","maxLength":4096},"pid":{"type":"integer","minimum":1},"start_time":{"type":["integer","null"]},"attested":{"const":true}},"description":"the registered harness process the caller descends from, found by the signer through the harness helper"},"fail_modes":{"type":"object","additionalProperties":{"enum":["open","closed"]},"description":"tool class -> fail mode, from the signer's config, never from the client"},"analyzes":{"$ref":"#/$defs/id","description":"a findings run: the run_id of the run of the same tenant it analyses"},"replay_of":{"$ref":"#/$defs/id","description":"a tracekit why replay run: the run_id of the run of the same tenant it replays"},"investigation":{"$ref":"#/$defs/id","description":"with replay_of: the investigation the replay run is an arm of"},"parent_run":{"$ref":"#/$defs/id","description":"format 1.2: the run of the same tenant that started this one, whose run token the caller presented"},"session":{"$ref":"#/$defs/id","description":"with parent_run: the root run of the chain of parents (a run without parent_run is its own session)"},"fidelity":{"enum":["none"],"description":"an imported run (source import): what its records say about the calls beyond their receipt"},"posture":{"type":"object","additionalProperties":false,"required":["network","tool_calls","gateway_mandatory","attested"],"description":"format 1.2: the deployment's posture as the operator asserts it in signer.yaml: whether the agent's network is enforced through the egress proxy, whether it acts only through the executor and the MCP gateway, and whether the LLM gateway is its only way to its model (gateway_mandatory); never attested","properties":{"network":{"enum":["enforced","open"]},"tool_calls":{"enum":["enforced","open"]},"gateway_mandatory":{"type":"boolean"},"attested":{"const":false}}}}},"run_closing":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"reason":{"enum":["close_run","idle_timeout","quarantine"]}}},"run_child":{"type":"object","additionalProperties":false,"required":["run_id"],"description":"format 1.2: a run bound to the same harness process registered with this run as its parent_run (signer-written)","properties":{"run_id":{"$ref":"#/$defs/id"}}},"run_final":{"type":"object","additionalProperties":false,"required":["head_run_seq","head_hash"],"properties":{"head_run_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"head_hash":{"$ref":"#/$defs/hash"},"provider_executed":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"format 1.2: tool uses the model's provider ran itself (executed_by provider), which no decide covers"},"coverage":{"type":"object","additionalProperties":false,"required":["layers","reconciled","unreconciled"],"description":"the capture layers that reported for the run and the tool calls the signer reconciled","properties":{"layers":{"type":"array","maxItems":6,"items":{"enum":["L1","L2","L3","L4","L5","L6"]}},"reconciled":{"type":"integer","minimum":0,"maximum":9007199254740991},"unreconciled":{"type":"object","additionalProperties":false,"description":"reconcile.* records of the run, by kind","properties":{"hook_missing":{"type":"integer","minimum":1,"maximum":9007199254740991},"fabricated":{"type":"integer","minimum":1,"maximum":9007199254740991},"args_mismatch":{"type":"integer","minimum":1,"maximum":9007199254740991},"args_unparseable":{"type":"integer","minimum":1,"maximum":9007199254740991},"result_without_call":{"type":"integer","minimum":1,"maximum":9007199254740991},"unexplained_effect":{"type":"integer","minimum":1,"maximum":9007199254740991},"result_mismatch":{"type":"integer","minimum":1,"maximum":9007199254740991}}}}},"paired_by_args":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"format 1.2: calls reconciled by pairing a decide with the model's tool use of the same turn by their arguments, the adapter having had no tool-call id"},"matrix":{"type":"object","additionalProperties":false,"required":["model_calls","tool_calls","network","processes","services"],"description":"format 1.2: per action class, how the run was covered: enforced (custody: the only way to act records it), observed (an observer outside the agent saw it and it was reconciled), reported (only the agent's own process reported it) or none; and the layers behind it","properties":{"model_calls":{"$ref":"#/$defs/coverage_class"},"tool_calls":{"$ref":"#/$defs/coverage_class"},"network":{"$ref":"#/$defs/coverage_class"},"processes":{"$ref":"#/$defs/coverage_class"},"services":{"$ref":"#/$defs/coverage_class"}}}}},"approval_request":{"type":"object","additionalProperties":false,"required":["approval_id","policy_hash","rule_ids","expires_at","requester","decision_id","binding","binding_digest"],"properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"approval_id":{"$ref":"#/$defs/id"},"policy_hash":{"$ref":"#/$defs/hash"},"rule_ids":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64}},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096},"requester":{"type":"string","maxLength":256},"requester_person":{"type":"string","maxLength":256,"description":"the requester's stable person id, when an OIDC identity"},"decision_id":{"$ref":"#/$defs/id"},"binding":{"type":"object","additionalProperties":false,"required":["v","approval_id","tenant","run_id","tool_call_id","attempt","tool","args_commitment","args_source","policy_hash","nonce","expires_at"],"description":"what the approval is bound to; binding_digest is sha256(JCS(binding)), the args bound through args_commitment","properties":{"v":{"const":1},"approval_id":{"$ref":"#/$defs/id"},"tenant":{"$ref":"#/$defs/id"},"run_id":{"$ref":"#/$defs/id"},"tool_call_id":{"$ref":"#/$defs/id"},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991},"tool":{"type":"string","maxLength":256},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"args_source":{"enum":["raw","parsed","coerced"]},"policy_hash":{"$ref":"#/$defs/hash"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$","maxLength":32},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096}}},"binding_digest":{"$ref":"#/$defs/hash"},"executor":{"enum":["t1","t2"],"description":"t2: approval_consume returns the approved arguments and its caller runs exactly those"},"agent":{"type":"object","additionalProperties":false,"required":["eligible","reason","rules","conditions_hash","args_key"],"description":"format 1.2: whether an agent approver may answer this approval, computed by the signer from the call's arguments and the run","properties":{"eligible":{"type":"boolean"},"reason":{"type":"string","maxLength":1024},"rules":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64},"description":"the rules it asked by with approval.agent"},"conditions_hash":{"$ref":"#/$defs/hash","description":"sha256 of JCS of those rules' approval.agent sections"},"args_key":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76,"description":"an HMAC of the call's arguments under a key of this run: the same in this run for the same arguments, so a call an agent said no to is a person's to answer when asked again"}}},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"},"incident_id":{"$ref":"#/$defs/id","description":"format 1.2: the call is held by this incident: only a person who is not the run's owner, principal or requester answers it"},"passkey":{"const":true,"description":"the approval needs a passkey (approval: {passkey: required})"}}},"approval_consumed":{"type":"object","additionalProperties":false,"required":["approval_id"],"properties":{"approval_id":{"$ref":"#/$defs/id"}}},"approval_expired":{"type":"object","additionalProperties":false,"required":["approval_id"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"reason":{"enum":["ttl","run_final","consume_window","hold","quarantine"],"description":"format 1.2, on approvals an agent may answer: approvals.ttl_s passed, the run ended, or an agent's approval was not consumed within approvals.agent_consume_s; on any approval: its run was held or quarantined (hold, quarantine)"}}},"approval_refused":{"type":"object","additionalProperties":false,"required":["tool_use_id","rule_ids","reason"],"properties":{"tool_use_id":{"$ref":"#/$defs/id"},"approval_id":{"$ref":"#/$defs/id"},"rule_ids":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64}},"reason":{"type":"string","maxLength":1024}}},"approval_binding_mismatch":{"type":"object","additionalProperties":false,"required":["approval_id","tool_use_id","approved_commitment","args_commitment"],"properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"approval_id":{"$ref":"#/$defs/id"},"tool_use_id":{"$ref":"#/$defs/id"},"approved_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"decision_id":{"$ref":"#/$defs/id","description":"the decision the approval was for (without salt_id: the decision whose salt both commitments are under)"}}},"approval_abandoned":{"type":"object","additionalProperties":false,"required":["approval_id"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"reason":{"type":"string","maxLength":1024}},"description":"the adapter will never resume the paused call; the approval ends at once"},"approval_escalated":{"type":"object","additionalProperties":false,"required":["approval_id","by"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"by":{"enum":["agent","signer"]},"reason":{"type":"string","maxLength":1024},"approver_identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the approver as the signer's transport established it"}},"description":"format 1.2: only people answer this approval from now on: an agent approver handed it over, or the signer did (no agent answered within agent_timeout_s, a budget ran out)"},"approval_revoked":{"type":"object","additionalProperties":false,"required":["approval_id","by"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}},"description":"format 1.2: a person (or the kill switch, by signer) vetoed an agent's approval before it was consumed"},"approval_suggested":{"type":"object","additionalProperties":false,"required":["tool_use_id","approval_id","decision","approver","approver_identity","channel","approver_kind"],"properties":{"tool_use_id":{"$ref":"#/$defs/id"},"approval_id":{"$ref":"#/$defs/id"},"decision":{"enum":["approve","reject","escalate"]},"approver":{"type":"string","maxLength":256},"approver_identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the approver as the signer's transport established it"},"channel":{"type":"string","maxLength":64},"approver_kind":{"const":"agent"},"asserted":{"type":"object","additionalProperties":false,"required":["attested"],"properties":{"model":{"type":"string","maxLength":128},"version":{"type":"string","maxLength":64},"prompt_hash":{"$ref":"#/$defs/hash"},"attested":{"const":false}},"description":"format 1.2: what the agent approver says it runs; its own word, never checked"},"reason":{"type":"string","maxLength":1024}},"description":"format 1.2: a shadow-mode agent approver's answer, recorded only: it changes nothing"},"approval_agents":{"type":"object","additionalProperties":false,"required":["enabled","by"],"properties":{"enabled":{"type":"boolean"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}},"description":"format 1.2: the operator's kill switch for agent approvals (in the signer run); switching off revokes every agent approval not consumed yet"},"input_observed":{"type":"object","additionalProperties":false,"description":"content that entered the run other than as a tool result (observe RPC), indexed for provenance; the value itself is only committed to","required":["source","trust","output","redaction","salt_id"],"properties":{"source":{"type":"string","maxLength":256,"description":"the caller's name for where the content came from"},"trust":{"enum":["trusted","untrusted"],"description":"the caller's claim; it only decides how this content's own values count"},"output":{"$ref":"#/$defs/content"},"redaction":{"$ref":"#/$defs/redaction"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"}}},"state_write":{"type":"object","additionalProperties":false,"required":["store","key","digest"],"properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"store":{"type":"string","maxLength":256},"key":{"type":"string","maxLength":256},"prev_digest":{"oneOf":[{"$ref":"#/$defs/commitment"},{"type":"null"}]},"digest":{"$ref":"#/$defs/commitment"}}},"signer_epoch":{"type":"object","additionalProperties":false,"required":["keys"],"properties":{"keys":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["kid","alg","spki"],"properties":{"kid":{"$ref":"#/$defs/hash"},"alg":{"type":"string","maxLength":32,"pattern":"^[a-z0-9-]+$"},"spki":{"type":"string","maxLength":4096,"pattern":"^[A-Za-z0-9+/]+={0,2}$","description":"base64 DER SubjectPublicKeyInfo"},"cert":{"type":"object","additionalProperties":false,"required":["certificate","index","inclusion","checkpoint"],"description":"the key's issuance entry from a record-key issuer (tracekit.format.cert, docs/issuer.md)","properties":{"certificate":{"type":"object","additionalProperties":false,"required":["cert","sig"],"properties":{"cert":{"type":"object","additionalProperties":false,"required":["kid","spki","log_id","tenants","not_before","not_after","serial"],"properties":{"kid":{"$ref":"#/$defs/hash"},"spki":{"type":"string","maxLength":4096,"pattern":"^[A-Za-z0-9+/]+={0,2}$"},"log_id":{"type":"string","maxLength":64},"tenants":{"type":"array","maxItems":256,"items":{"type":"string","maxLength":256}},"not_before":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_after":{"type":"integer","minimum":0,"maximum":9007199254740991},"serial":{"type":"string","maxLength":64,"pattern":"^[0-9a-f]+$"}}},"sig":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9+/]+={0,2}$"}}},"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"inclusion":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":64,"pattern":"^[A-Za-z0-9+/]+={0,2}$"}},"checkpoint":{"type":"string","maxLength":16384}}}}}},"bridge":{"type":"object","additionalProperties":false,"required":["v1_kid","v1_last_seq","v1_head"],"description":"the v1 ledger this log continues: its key, the seq and hash of its last (key retirement) record","properties":{"v1_kid":{"type":"string","maxLength":24,"pattern":"^ed25519:[0-9a-f]{16}$"},"v1_last_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"v1_head":{"type":"string","maxLength":64,"pattern":"^[0-9a-f]{64}$"}}}}},"key_retire":{"type":"object","additionalProperties":false,"required":["kid","last_seq"],"properties":{"kid":{"$ref":"#/$defs/hash"},"last_seq":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"log_closed":{"type":"object","additionalProperties":false,"required":["final_seq"],"properties":{"final_seq":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"reconcile":{"type":"object","additionalProperties":false,"required":["layers"],"properties":{"layers":{"type":"array","maxItems":6,"items":{"enum":["L1","L2","L3","L4","L5","L6"]}},"detail":{"type":"string","maxLength":1024}}},"refusal_summary":{"type":"object","additionalProperties":false,"required":["code","count","from_ts","to_ts"],"properties":{"code":{"type":"string","maxLength":64},"count":{"type":"integer","minimum":1,"maximum":9007199254740991},"from_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096},"to_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096},"identity":{"type":"string","maxLength":256}}},"policy_external":{"type":"object","additionalProperties":false,"required":["system","decision","tool_use_id","tool","rule_ids","signature","record","identity","salt_id"],"description":"Another system's decision about a tool call, imported by an identity authorized for decision_import (tier T3). The signer's own policy.decision stays authoritative.","properties":{"system":{"type":"string","minLength":1,"maxLength":64},"decision":{"enum":["allow","deny","ask"]},"tool_use_id":{"$ref":"#/$defs/id"},"tool":{"type":"string","minLength":1,"maxLength":256},"rule_ids":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32},"reason":{"type":"string","maxLength":4096,"description":"the system's reason, redacted"},"signature":{"enum":["verified","unverified"],"description":"verified: the system's Ed25519 signature over its record holds under the key the signer's config pins for it"},"record":{"type":"object","additionalProperties":false,"required":["hash","size"],"description":"the system's own record: an HMAC of its sha256 under this record's salt (salt_id), and its size in bytes","properties":{"hash":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"size":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"enum":["uid","harness","token","k8s_sa","mtls","oidc"]},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"}}},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"}}},"content_accessed":{"type":"object","additionalProperties":false,"required":["principal","run_id","seqs","purpose"],"description":"The signer returned retained content of records of a run of this tenant (format 1.1; content_get): who asked, the run, its run_seqs and why. Never the content.","properties":{"principal":{"type":"string","maxLength":256},"run_id":{"type":"string","maxLength":128},"seqs":{"type":"array","maxItems":1000,"items":{"type":"integer","minimum":0,"maximum":9007199254740991}},"purpose":{"type":"string","maxLength":512}}},"content_erased":{"type":"object","additionalProperties":false,"required":["run_id","reason","by"],"description":"The signer deleted the retained content of a run of this tenant (format 1.1; content_erase or retention); the run's records are unchanged.","properties":{"run_id":{"type":"string","maxLength":128},"reason":{"type":"string","maxLength":1024},"by":{"type":"string","maxLength":256}}},"why_finding":{"type":"object","additionalProperties":false,"required":["target","intervention","n","p_with","p_without","effect","interval","verdict","replay_runs","models","rung","off_tape","investigation","looks","family","min_effect","applied","stopped"],"description":"A finished tracekit why test (format 1.1; why_finding), written in a findings run about the run it analyses: how often the target happened in the control arm (p_with) and with the intervention (p_without) over n paired replays, the interval and verdict with what they were decided on (looks: the sequential test's planned looks, family: the tests corrected for together, min_effect, applied: whether the intervention matched anything, stopped: why the test ended), every replay run with its arm and outcome, and the replay runs of the investigation it does not count (uncounted: the surrogate's ranking calls, arms a budget stop abandoned). rung 1: one recorded model call re-sent; rung 2: the agent loop re-simulated from the recorded run.","properties":{"target":{"type":"string","maxLength":1024},"intervention":{"type":"string","maxLength":1024},"n":{"type":"integer","minimum":0,"maximum":9007199254740991},"p_with":{"type":"number","minimum":0,"maximum":1},"p_without":{"type":"number","minimum":0,"maximum":1},"effect":{"type":"number","minimum":-1,"maximum":1},"interval":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":-1,"maximum":1}},"verdict":{"enum":["causal","suppressive","ruled-out","inconclusive","not-applied"]},"replay_runs":{"type":"array","maxItems":4096,"items":{"type":"object","additionalProperties":false,"required":["run_id","arm","hit"],"properties":{"run_id":{"$ref":"#/$defs/id"},"arm":{"enum":["control","ablated"]},"hit":{"type":"boolean"}}}},"models":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":128}},"rung":{"enum":[1,2]},"off_tape":{"type":"integer","minimum":0,"maximum":9007199254740991},"investigation":{"$ref":"#/$defs/id"},"looks":{"type":"integer","minimum":1,"maximum":4096},"family":{"type":"integer","minimum":1,"maximum":4096},"min_effect":{"type":"number","minimum":0,"maximum":1},"applied":{"type":"boolean"},"stopped":{"enum":["decisive","futility","n_max","budget"]},"uncounted":{"type":"array","maxItems":4096,"items":{"type":"object","additionalProperties":false,"required":["run_id","reason"],"properties":{"run_id":{"$ref":"#/$defs/id"},"reason":{"enum":["ranking","budget"]}}}}}},"incident_opened":{"type":"object","additionalProperties":false,"required":["incident_id","trigger","rule_ids","scope","cites","mode","actions","would"],"description":"format 1.2: a trigger of the policy's detection fired (a sequence completed, a limit was exceeded, or a respond trigger), an operator held or quarantined a run (trigger operator), or the detector could not vouch for a decision under an enforced response (detector_unavailable); one open incident per scope, trigger and rule, later matches are incident.updated. mode shadow: no action taken, `would` the configured one; mode enforce: `actions` the ones taken (none while the response engine is paused: then `would` and `reason` say so)","properties":{"incident_id":{"$ref":"#/$defs/id"},"trigger":{"enum":["sequence","limit","executed_against_policy","denied_calls","provenance","class_mismatch","refusal_burst","tamper","operator","detector_unavailable","unexplained_effect"]},"rule_ids":{"type":"array","maxItems":1024,"items":{"type":"string","maxLength":256}},"scope":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["run","session","owner","principal"]},"id":{"type":"string","maxLength":256}}},"cites":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["run_id","run_seq"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"run_seq":{"type":"integer","minimum":0}}},"description":"the records that make up the match"},"mode":{"enum":["shadow","enforce"]},"actions":{"type":"array","maxItems":3,"items":{"enum":["notify","hold","quarantine"]}},"would":{"type":"array","maxItems":4,"items":{"enum":["notify","hold","quarantine","suspend"]}},"reason":{"type":"string","maxLength":1024,"description":"why the actions differ from the configured one (paused, no person approvers), or an operator's reason"},"in_flight":{"type":"array","maxItems":1024,"description":"format 1.2: calls allowed (or approved and consumed) and not completed when the response took effect: they may complete after it","items":{"type":"object","additionalProperties":false,"required":["run_id","tool_call_id","decision_id"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"tool_call_id":{"$ref":"#/$defs/id"},"decision_id":{"$ref":"#/$defs/id"}}}}}},"incident_updated":{"type":"object","additionalProperties":false,"required":["incident_id","cites"],"description":"format 1.2: another match of an open incident (at most one per window of its trigger), written in the run whose record matched","properties":{"incident_id":{"$ref":"#/$defs/id"},"cites":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["run_id","run_seq"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"run_seq":{"type":"integer","minimum":0}}}}}},"incident_capped":{"type":"object","additionalProperties":false,"required":["cap","max","trigger","reason"],"description":"format 1.2: a cap on opened incidents was reached: the run's per trigger (cap run), or per minute the tenant's or one run's share of it (cap tenant); the incidents after it are not written","properties":{"cap":{"enum":["run","tenant"]},"trigger":{"enum":["sequence","limit","executed_against_policy","denied_calls","provenance","class_mismatch","refusal_burst","tamper","operator","detector_unavailable","unexplained_effect"],"description":"the trigger of the first incident not written"},"max":{"type":"integer","minimum":1},"reason":{"type":"string","maxLength":512}}},"run_held":{"type":"object","additionalProperties":false,"required":["incident_id","scope","by","reason"],"description":"format 1.2: the run is held: every further call is asked of a person (TK-HOLD) and its live approvals expired; written in each run the incident's scope reaches","properties":{"incident_id":{"$ref":"#/$defs/id"},"scope":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["run","session","owner","principal"]},"id":{"type":"string","maxLength":256}}},"by":{"type":"string","maxLength":256,"description":"signer, or the operator's identity"},"reason":{"type":"string","maxLength":1024},"in_flight":{"type":"array","maxItems":1024,"description":"format 1.2: calls allowed (or approved and consumed) and not completed when the response took effect: they may complete after it","items":{"type":"object","additionalProperties":false,"required":["run_id","tool_call_id","decision_id"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"tool_call_id":{"$ref":"#/$defs/id"},"decision_id":{"$ref":"#/$defs/id"}}}},"inherited":{"const":true,"description":"a new run of a held owner and principal (or of a held parent run) took the hold over"},"inherit_until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27,"description":"until when new runs of this run's owner and attested principal inherit the hold"}}},"run_resumed":{"type":"object","additionalProperties":false,"required":["incident_id","by","person","held_by"],"description":"format 1.2: a person ended the hold of one incident on the run (run_resume, which ends each, or incident_resolve of that incident); held_by: the incidents that still hold it","properties":{"incident_id":{"$ref":"#/$defs/id"},"by":{"type":"string","maxLength":256},"person":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"break_glass":{"const":true},"held_by":{"type":"array","maxItems":1024,"items":{"$ref":"#/$defs/id"}}}},"run_quarantined":{"type":"object","additionalProperties":false,"required":["incident_id","scope","by","reason"],"description":"format 1.2: the run is quarantined for good: decisions are deny (TK-QUARANTINE), approvals are refused, a gateway forwards no more model requests","properties":{"incident_id":{"$ref":"#/$defs/id"},"scope":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["run","session","owner","principal"]},"id":{"type":"string","maxLength":256}}},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"in_flight":{"type":"array","maxItems":1024,"description":"format 1.2: calls allowed (or approved and consumed) and not completed when the response took effect: they may complete after it","items":{"type":"object","additionalProperties":false,"required":["run_id","tool_call_id","decision_id"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"tool_call_id":{"$ref":"#/$defs/id"},"decision_id":{"$ref":"#/$defs/id"}}}},"inherited":{"const":true},"inherit_until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27,"description":"until when new runs of this run's owner and attested principal inherit the hold"}}},"incident_resolved":{"type":"object","additionalProperties":false,"required":["incident_id","by","person"],"description":"format 1.2: a person resolved the incident (in the tenant's signer run): its held runs resume, quarantines stay","properties":{"incident_id":{"$ref":"#/$defs/id"},"by":{"type":"string","maxLength":256},"person":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"break_glass":{"const":true},"resumed":{"type":"array","maxItems":4096,"items":{"type":"string","maxLength":200}}}},"incident_response":{"type":"object","additionalProperties":false,"required":["enabled","by"],"description":"format 1.2: an operator paused (enabled false) or resumed the tenant's response engine; detection keeps recording","properties":{"enabled":{"type":"boolean"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}}},"identity_suspension":{"type":"object","additionalProperties":false,"required":["identity","state","by"],"description":"format 1.2: an identity of the tenant is suspended by an operator (written by the signer that changed the shared list), enforced (each signer that starts enforcing an entry) or lifted","properties":{"identity":{"type":"string","maxLength":256},"state":{"enum":["suspended","enforced","lifted"]},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}}},"effect_observed":{"type":"object","additionalProperties":false,"required":["observer","kind","host","port","bytes_out","bytes_in","connections","first_ts","last_ts","attribution"],"description":"format 1.2: network traffic an egress observer outside the agent saw for the run (tracekit.egress), aggregated per host, port and minute; signer-written","properties":{"observer":{"type":"string","maxLength":256,"description":"the egress observer's signer identity (scheme:subject)"},"kind":{"enum":["net"]},"host":{"type":"string","minLength":1,"maxLength":253},"port":{"type":"integer","minimum":1,"maximum":65535},"bytes_out":{"type":"integer","minimum":0,"maximum":9007199254740991},"bytes_in":{"type":"integer","minimum":0,"maximum":9007199254740991},"connections":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"last_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"attribution":{"enum":["token","identity"],"description":"token: the client presented the run's token; identity: the observer authenticated the run's owner and the signer picked that owner's latest open run"},"explained_by":{"enum":["call","explains"],"description":"what explains the host: a recorded http or model call to it, or the policy's explains; absent: unexplained (a reconcile.unexplained_effect follows)"}}},"sensor_effect":{"type":"object","additionalProperties":false,"required":["observer","sensor","kind","ts","pid","binary","attribution"],"description":"format 1.4: what a kernel sensor (Tetragon, Falco) reported a process of the run did, or what OpenShell reported of its sandbox (its connections allowed and blocked, its entrypoint's start), imported under the import's own signer identity (an observer's assertion); signer-written","properties":{"observer":{"type":"string","maxLength":256,"description":"the import's signer identity (scheme:subject)"},"sensor":{"enum":["tetragon","falco","openshell"]},"kind":{"enum":["exec","exit","connect","file"],"description":"exec: the process started; exit: it ended; connect: it connected to host:port; file: the sensor's policy selected a file event of it (a write outside the workspace, in the shipped samples)"},"ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"pid":{"type":"integer","minimum":0,"maximum":4294967295},"binary":{"type":"string","minLength":1,"maxLength":4096},"exec_id":{"type":"string","minLength":1,"maxLength":256,"description":"the sensor's id of the process (Tetragon's exec_id)"},"parent_exec_id":{"type":"string","minLength":1,"maxLength":256,"description":"exec: the sensor's id of the process that started this one (Tetragon's parent_exec_id)"},"args_commitment":{"$ref":"#/$defs/commitment","description":"commitment to sha256 of the arguments string as the sensor reported it"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"},"status":{"type":"integer","minimum":0,"maximum":4294967295},"signal":{"type":"string","maxLength":32},"host":{"type":"string","minLength":1,"maxLength":253},"port":{"type":"integer","minimum":0,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":4096},"tool_call_id":{"$ref":"#/$defs/id","description":"the tool call id the process's environment carried (CODEX_TOOL_CALL_ID): the agent's claim, recorded as it came and checked by no signer (TK-X206 checks it)"},"denied":{"const":true,"description":"the sensor (OpenShell's network policy) blocked it"},"attribution":{"enum":["token","identity"],"description":"identity: the import mapped the process to the run's owner and the signer picked that owner's latest open run"}}},"reconcile_effect":{"type":"object","additionalProperties":false,"required":["layers","observer","kind","host"],"description":"format 1.2: a host an observer saw the run reach that no record of the run explains","properties":{"layers":{"type":"array","maxItems":6,"items":{"enum":["L1","L2","L3","L4","L5","L6"]}},"detail":{"type":"string","maxLength":1024},"observer":{"type":"string","maxLength":256,"description":"the egress observer's signer identity (scheme:subject)"},"kind":{"enum":["net"]},"host":{"type":"string","minLength":1,"maxLength":253},"port":{"type":"integer","minimum":1,"maximum":65535}}},"coverage_class":{"type":"object","additionalProperties":false,"required":["status","layers"],"properties":{"status":{"enum":["enforced","observed","reported","none"]},"layers":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":32}},"asserted":{"const":true,"description":"the status rests on the operator's posture (signer.yaml), not on anything the signer measured"}}},"constraint_added":{"type":"object","additionalProperties":false,"required":["kind"],"description":"format 1.4: a live constraint of the run (constraint_add): what the person's request said not to do in the rest of it, as its client reported it (the Claude Code hook, at UserPromptSubmit). From then on the signer raises a call that breaks it to an ask (rule TK-CONSTRAINT) and never lowers a decision, so a made-up constraint can only hold more calls","properties":{"kind":{"enum":["keep_away","only_change","read_only","no_push","no_network"],"description":"keep_away: writes of the file; only_change: writes of any other file; read_only: any write; no_push: a git push; no_network: a call that reaches the network"},"object_commitment":{"$ref":"#/$defs/commitment","description":"keep_away and only_change: commitment to sha256 of the file's lower-cased basename; never the name"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitment (salt label <type>:<salt_id>)"}}},"ext_name":{"type":"string","pattern":"^[a-z][a-z0-9_.-]*$","maxLength":64,"description":"The name of a non-critical field or record (format 1.4)."},"ext":{"type":"object","required":["name"],"properties":{"name":{"$ref":"#/$defs/ext_name"}},"description":"A non-critical record (format 1.4): its name and any other strict JSON fields, checked as the ext field is."}}};
1504
+ const SCHEMA = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/Cygnux-Labs/Tracekit/schema/tracekit.event.v2.json","title":"Tracekit event v2","description":"One event in a format v2 record log. Additive over tracekit.event.v1: new optional fields and types, and bounds on every string and array. Validated with full-match ASCII patterns.","type":"object","additionalProperties":false,"required":["schema_version","id","seq","prev_hash","ts","run_id","agent_id","parent_id","source","type","data","log_id","tenant","run_seq","run_prev_hash"],"properties":{"schema_version":{"const":"tracekit.event.v2"},"id":{"type":"string","pattern":"^[0-9a-f]{32}$","description":"Random 128-bit id, hex.","maxLength":4096},"seq":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Signer's monotonic counter. Assigned by tracekitd, never by the client."},"prev_hash":{"$ref":"#/$defs/hash","description":"Hash of the previous record in this log; sha256: and 64 zeros for seq 0."},"ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","description":"Client-reported time, UTC, microseconds.","maxLength":4096},"ts_signed":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","description":"Time the signer accepted the event.","maxLength":4096},"run_id":{"type":"string","minLength":1,"maxLength":200},"agent_id":{"type":"string","minLength":1,"maxLength":200,"description":"\"main\" for the top-level agent, otherwise the harness's sub-agent id."},"parent_id":{"type":["string","null"],"maxLength":200,"description":"agent_id of the spawning agent, or null."},"source":{"enum":["hook","proxy","transcript","signer","sdk","migrated","import","gateway"],"description":"Capture path. transcript = harness-reported, lower trust; import = received over OTLP, or another system's decision (decision_import) (tier T3): receipt only; gateway = model.exchange recorded by the LLM gateway, or a tool call (policy.decision, approval.request, tool.result) or an input (input.observed) the MCP gateway or a tool executor decided, ran or received for its client (tier T2)."},"type":{"enum":["run.start","run.end","tool.call","policy.decision","approval","tool.result","error","review","trace.tamper","capture.gap","checkpoint","user.prompt","model.message","model.exchange","run.registered","run.closing","run.final","approval.request","approval.consumed","approval.expired","approval.refused","approval.binding_mismatch","approval.abandoned","approval.escalated","approval.revoked","approval.suggested","approval.agents","input.observed","state.write","signer.epoch","key.retire","log.closed","reconcile.hook_missing","reconcile.fabricated","reconcile.args_mismatch","reconcile.result_without_call","reconcile.unexplained_effect","reconcile.args_unparseable","reconcile.result_mismatch","refusal.summary","policy.external","content.accessed","content.erased","why.finding","run.child","incident.opened","incident.updated","incident.capped","run.held","run.resumed","run.quarantined","incident.resolved","incident.response","identity.suspension","effect.observed","constraint.added","run.label","playbook.entry","precedent.revoked","approver.enabled","approver.switched","ext","run.writer"]},"data":{"type":"object"},"transcript":{"type":"object","additionalProperties":false,"required":["path","length","hash"],"description":"C2: what the hook read of the harness transcript at this point (prefix hash). Lets the signer detect later edits, truncation or deletion.","properties":{"path":{"type":"string","maxLength":4096},"length":{"type":"integer","minimum":0},"hash":{"$ref":"#/$defs/commitment"},"prefix_length":{"type":["integer","null"],"minimum":0,"description":"Length the signer last acknowledged for this path."},"prefix_hash":{"oneOf":[{"$ref":"#/$defs/commitment"},{"type":"null"}],"description":"Hash of the first prefix_length bytes as read now."},"missing":{"type":"boolean"}}},"log_id":{"type":"string","pattern":"^[0-9a-f]{32}$","description":"The record log this event belongs to.","maxLength":4096},"tenant":{"$ref":"#/$defs/id"},"tenant_attested":{"type":"boolean"},"principal":{"type":"string","maxLength":256},"principal_attested":{"type":"boolean"},"request_id":{"$ref":"#/$defs/id"},"stream":{"$ref":"#/$defs/id"},"client_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"tool_call_id":{"$ref":"#/$defs/id"},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991},"step":{"type":"integer","minimum":0,"maximum":9007199254740991},"run_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"run_prev_hash":{"$ref":"#/$defs/hash"},"capture_layer":{"enum":["L1","L2","L3","L4","L5","L6"]},"tier":{"enum":["T1","T2","T3"]},"span_id":{"type":"string","pattern":"^[0-9a-f]{16}$","maxLength":16,"description":"source import: the OpenTelemetry span the record was imported from"},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":4096},"args_source":{"enum":["raw","parsed","coerced"]},"engine":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9._-]+@[A-Za-z0-9._+-]+$","description":"Policy engine id@version."},"ext":{"type":"object","propertyNames":{"$ref":"#/$defs/ext_name"},"description":"Non-critical fields (format 1.4), on any record: {name: any strict JSON value}. A verifier that does not interpret a name still checks the record's signature, chain and inclusion, and says it did not interpret the name (docs/format-v2.md section 9)."}},"allOf":[{"if":{"properties":{"type":{"const":"run.start"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_start"}}}},{"if":{"properties":{"type":{"const":"run.end"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_end"}}}},{"if":{"properties":{"type":{"const":"tool.call"}}},"then":{"properties":{"data":{"$ref":"#/$defs/tool_call"}}}},{"if":{"properties":{"type":{"const":"policy.decision"}}},"then":{"properties":{"data":{"$ref":"#/$defs/policy_decision"}}}},{"if":{"properties":{"type":{"const":"approval"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval"}}}},{"if":{"properties":{"type":{"const":"tool.result"}}},"then":{"properties":{"data":{"$ref":"#/$defs/tool_result"}}}},{"if":{"properties":{"type":{"const":"error"}}},"then":{"properties":{"data":{"$ref":"#/$defs/error"}}}},{"if":{"properties":{"type":{"const":"review"}}},"then":{"properties":{"data":{"$ref":"#/$defs/review"}}}},{"if":{"properties":{"type":{"const":"trace.tamper"}}},"then":{"properties":{"data":{"$ref":"#/$defs/trace_tamper"}}}},{"if":{"properties":{"type":{"const":"capture.gap"}}},"then":{"properties":{"data":{"$ref":"#/$defs/capture_gap"}}}},{"if":{"properties":{"type":{"const":"checkpoint"}}},"then":{"properties":{"data":{"$ref":"#/$defs/checkpoint"}}}},{"if":{"properties":{"type":{"const":"user.prompt"}}},"then":{"properties":{"data":{"$ref":"#/$defs/user_prompt"}}}},{"if":{"properties":{"type":{"const":"model.message"}}},"then":{"properties":{"data":{"$ref":"#/$defs/model_message"}}}},{"if":{"properties":{"type":{"const":"model.exchange"}}},"then":{"properties":{"data":{"$ref":"#/$defs/model_exchange"}}}},{"if":{"properties":{"type":{"const":"run.registered"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_registered"}}}},{"if":{"properties":{"type":{"const":"run.closing"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_closing"}}}},{"if":{"properties":{"type":{"const":"run.final"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_final"}}}},{"if":{"properties":{"type":{"const":"approval.request"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_request"}}}},{"if":{"properties":{"type":{"const":"approval.consumed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_consumed"}}}},{"if":{"properties":{"type":{"const":"approval.expired"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_expired"}}}},{"if":{"properties":{"type":{"const":"approval.refused"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_refused"}}}},{"if":{"properties":{"type":{"const":"approval.binding_mismatch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_binding_mismatch"}}}},{"if":{"properties":{"type":{"const":"approval.abandoned"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_abandoned"}}}},{"if":{"properties":{"type":{"const":"approval.escalated"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_escalated"}}}},{"if":{"properties":{"type":{"const":"approval.revoked"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_revoked"}}}},{"if":{"properties":{"type":{"const":"approval.suggested"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_suggested"}}}},{"if":{"properties":{"type":{"const":"approval.agents"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approval_agents"}}}},{"if":{"properties":{"type":{"const":"input.observed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/input_observed"}}}},{"if":{"properties":{"type":{"const":"state.write"}}},"then":{"properties":{"data":{"$ref":"#/$defs/state_write"}}}},{"if":{"properties":{"type":{"const":"signer.epoch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/signer_epoch"}}}},{"if":{"properties":{"type":{"const":"key.retire"}}},"then":{"properties":{"data":{"$ref":"#/$defs/key_retire"}}}},{"if":{"properties":{"type":{"const":"log.closed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/log_closed"}}}},{"if":{"properties":{"type":{"const":"reconcile.hook_missing"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.fabricated"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.args_mismatch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.result_without_call"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.unexplained_effect"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile_effect"}}}},{"if":{"properties":{"type":{"const":"reconcile.args_unparseable"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"reconcile.result_mismatch"}}},"then":{"properties":{"data":{"$ref":"#/$defs/reconcile"}}}},{"if":{"properties":{"type":{"const":"refusal.summary"}}},"then":{"properties":{"data":{"$ref":"#/$defs/refusal_summary"}}}},{"if":{"properties":{"type":{"const":"policy.external"}}},"then":{"properties":{"data":{"$ref":"#/$defs/policy_external"}}}},{"if":{"properties":{"type":{"const":"content.accessed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/content_accessed"}}}},{"if":{"properties":{"type":{"const":"content.erased"}}},"then":{"properties":{"data":{"$ref":"#/$defs/content_erased"}}}},{"if":{"properties":{"type":{"const":"why.finding"}}},"then":{"properties":{"data":{"$ref":"#/$defs/why_finding"}}}},{"if":{"properties":{"type":{"const":"run.child"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_child"}}}},{"if":{"properties":{"type":{"const":"incident.opened"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_opened"}}}},{"if":{"properties":{"type":{"const":"incident.updated"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_updated"}}}},{"if":{"properties":{"type":{"const":"incident.capped"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_capped"}}}},{"if":{"properties":{"type":{"const":"run.held"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_held"}}}},{"if":{"properties":{"type":{"const":"run.resumed"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_resumed"}}}},{"if":{"properties":{"type":{"const":"run.quarantined"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_quarantined"}}}},{"if":{"properties":{"type":{"const":"incident.resolved"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_resolved"}}}},{"if":{"properties":{"type":{"const":"incident.response"}}},"then":{"properties":{"data":{"$ref":"#/$defs/incident_response"}}}},{"if":{"properties":{"type":{"const":"identity.suspension"}}},"then":{"properties":{"data":{"$ref":"#/$defs/identity_suspension"}}}},{"if":{"properties":{"type":{"const":"effect.observed"}}},"then":{"properties":{"data":{"oneOf":[{"$ref":"#/$defs/effect_observed"},{"$ref":"#/$defs/sensor_effect"}]}}}},{"if":{"properties":{"type":{"const":"constraint.added"}}},"then":{"properties":{"data":{"$ref":"#/$defs/constraint_added"}}}},{"if":{"properties":{"type":{"const":"run.label"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_label"}}}},{"if":{"properties":{"type":{"const":"playbook.entry"}}},"then":{"properties":{"data":{"$ref":"#/$defs/playbook_entry"}}}},{"if":{"properties":{"type":{"const":"precedent.revoked"}}},"then":{"properties":{"data":{"$ref":"#/$defs/precedent_revoked"}}}},{"if":{"properties":{"type":{"const":"approver.enabled"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approver_enabled"}}}},{"if":{"properties":{"type":{"const":"approver.switched"}}},"then":{"properties":{"data":{"$ref":"#/$defs/approver_switched"}}}},{"if":{"properties":{"type":{"const":"ext"}}},"then":{"properties":{"data":{"$ref":"#/$defs/ext"}}}},{"if":{"properties":{"type":{"const":"run.writer"}}},"then":{"properties":{"data":{"$ref":"#/$defs/run_writer"}}}}],"$defs":{"hash":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$","maxLength":71},"commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76,"description":"HMAC-SHA256 of a sha256: digest of agent content under a per-record salt the signer keeps and can reveal for that one record (tracekit signer reveal)"},"redaction":{"type":"object","additionalProperties":false,"required":["rules","count","client_claimed"],"description":"what the signer redacted from this record's content before committing to it; never the values","properties":{"rules":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":64},"description":"the redaction rules that fired"},"count":{"type":"integer","minimum":0},"client_claimed":{"type":"boolean","description":"the client said it redacted the content already"},"client":{"type":"object","additionalProperties":false,"description":"the client's own manifest, as it claimed it","properties":{"rules":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64}},"count":{"type":"integer","minimum":0}}},"client_redaction_incomplete":{"const":true,"description":"the client claimed redaction and the signer still found a secret"}}},"content":{"description":"Either the (redacted) value or a reference to it. Which one is decided by docs/privacy.md, never by the caller.","oneOf":[{"type":"object","additionalProperties":false,"required":["value","redacted"],"properties":{"value":{},"redacted":{"type":"boolean"}}},{"type":"object","additionalProperties":false,"required":["hash","size","redacted"],"properties":{"hash":{"$ref":"#/$defs/commitment"},"size":{"type":"integer","minimum":0},"redacted":{"type":"boolean"}}}]},"run_start":{"type":"object","additionalProperties":false,"required":["agent","host","os_user","fail_mode","policy","capture_sources","sandbox","content_capture","signer_isolation"],"properties":{"agent":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":4096},"version":{"type":["string","null"],"maxLength":4096}}},"model":{"type":["string","null"],"maxLength":4096},"repo":{"type":["string","null"],"maxLength":4096},"commit":{"type":["string","null"],"maxLength":4096},"cwd":{"type":["string","null"],"maxLength":4096},"host":{"type":"string","maxLength":4096},"os_user":{"type":"string","maxLength":4096},"fail_mode":{"enum":["open","closed"]},"policy":{"type":"object","additionalProperties":false,"required":["version","hash"],"properties":{"version":{"type":"string","maxLength":4096},"hash":{"$ref":"#/$defs/hash"}}},"capture_sources":{"type":"array","items":{"enum":["hook","proxy","transcript","sdk"]},"maxItems":1024},"sandbox":{"enum":["none","unknown","self-reported-active"]},"content_capture":{"enum":["hashed","full"]},"reasoning_capture":{"type":"boolean"},"signer_isolation":{"enum":["separate-user","same-user"]},"os_user_attested":{"type":"boolean","description":"true when tracekitd set os_user from the socket peer's credentials rather than trusting the client."},"harness":{"type":"object","additionalProperties":false,"description":"0.3: set only by the signer. The registered harness instance the run.start came from (pid + kernel start time), found from the kernel's view of the sender's process tree.","required":["name","exe","pid","attested"],"properties":{"name":{"type":"string","maxLength":4096},"exe":{"type":"string","maxLength":4096},"pid":{"type":"integer"},"start_time":{"type":["integer","null"]},"attested":{"type":"boolean"}}}}},"run_end":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"reason":{"type":"string","maxLength":4096}}},"tool_call":{"type":"object","additionalProperties":false,"required":["tool_use_id","name","input"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"name":{"type":"string","maxLength":4096},"input":{"type":"object","additionalProperties":{"$ref":"#/$defs/content"}},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"}}},"policy_decision":{"type":"object","additionalProperties":false,"required":["tool_use_id","decision","rule_ids"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"decision":{"enum":["allow","deny","flag","ask"]},"rule_ids":{"type":"array","items":{"type":"string","maxLength":4096},"maxItems":1024},"reasons":{"type":"array","items":{"type":"string","maxLength":4096},"maxItems":1024},"policy_hash":{"$ref":"#/$defs/hash","description":"hash of the policy that produced this decision"},"policy_version":{"type":"string","maxLength":4096},"tool":{"type":"string","maxLength":256,"description":"tool name the decision is for"},"decision_id":{"$ref":"#/$defs/id","description":"signer-assigned; `complete` consumes it once"},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76,"description":"HMAC of the signer's args digest under a per-decision salt the signer can reveal to an auditor; absent when the args failed strict parsing"},"engine":{"type":"string","maxLength":64,"description":"matching engine id@version"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$","maxLength":32},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"nondeterministic":{"type":"boolean","description":"a fallback-engine match ran out of time and denied"},"provenance":{"type":"array","maxItems":16,"description":"argument values that only untrusted content brought into the run: the top-level argument, the kind of value and the record that brought it; never the value","items":{"type":"object","additionalProperties":false,"required":["field","kind","source"],"properties":{"field":{"type":"string","maxLength":256},"kind":{"enum":["email","url","host","path","digits","string"]},"source":{"type":"object","additionalProperties":false,"required":["run_seq"],"properties":{"run_seq":{"type":"integer","minimum":0},"tool":{"type":"string","maxLength":256},"tool_call_id":{"$ref":"#/$defs/id"}}}}}},"provenance_state":{"enum":["complete","partial","truncated","unavailable","timeout"],"description":"the run's provenance index: complete, partial (an untrusted tool's result came as a digest), truncated (more values than it reads), unavailable (lost in a signer restart) or timeout (this call's values took past the decision's deadline); when not complete, from: untrusted rules match whenever their pattern does"},"provenance_reason":{"type":"string","maxLength":256,"description":"why provenance_state is not complete"},"detect":{"type":"object","additionalProperties":false,"required":["sequences","limits","state"],"description":"format 1.2: what the policy's sequences and limits saw of this call (signer/detect.py): the step each sequence it advanced reached, the count (a sum limit: the total of the call's currency) and window start of each limit it counted, and whether the detector's state is complete or was lost in a restart (unavailable)","properties":{"rule_ids":{"type":"array","maxItems":1024,"items":{"type":"string","maxLength":256},"description":"the rule ids of both class readings, when the client's class hint disagreed and they differ from rule_ids"},"sums":{"type":"object","description":"per sum limit: [amount in minor units, currency] of this call","additionalProperties":{"type":"array","minItems":2,"maxItems":2,"items":{"type":["integer","string"],"maxLength":16}}},"sequences":{"type":"array","maxItems":1024,"items":{"type":"object","additionalProperties":false,"required":["id","step"],"properties":{"id":{"type":"string","maxLength":256},"step":{"type":"integer","minimum":1}}}},"limits":{"type":"array","maxItems":1024,"items":{"type":"object","additionalProperties":false,"required":["id","count","window_start"],"properties":{"id":{"type":"string","maxLength":256},"count":{"type":"integer"},"window_start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27}}}},"state":{"enum":["complete","unavailable"]}}},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"},"caller":{"type":"string","maxLength":256,"description":"format 1.2, with via: the client (scheme:subject) the gateway or tool executor decided the call for"},"incident_id":{"$ref":"#/$defs/id","description":"format 1.2: the incident whose hold (ask, TK-HOLD) or quarantine (deny, TK-QUARANTINE) decided the call"},"run_labels":{"type":"array","minItems":1,"maxItems":2,"items":{"enum":["secrets_access","untrusted_content"]},"description":"format 1.8: the run labels that made a run condition rule (`when`) of rule_ids apply: each one the run carried, or one a rule of this call sets"}}},"approval":{"type":"object","additionalProperties":false,"required":["tool_use_id","decision","approver","channel"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"decision":{"enum":["approve","reject","timeout","self_approval_refused"]},"approver":{"type":"string","maxLength":4096},"channel":{"type":"string","maxLength":4096},"approver_uid":{"type":["integer","null"]},"wait_ms":{"type":["integer","null"]},"same_user":{"type":["boolean","null"],"description":"true when the approver is the agent's own OS user (dev mode only; not trustworthy)"},"approval_id":{"$ref":"#/$defs/id"},"self_approved":{"type":"boolean","description":"the approver is the requester (dev mode only); caps assurance at dev"},"reason":{"type":"string","maxLength":1024},"approver_identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the approver as the signer's transport established it"},"break_glass":{"type":"boolean","description":"answered under the break-glass role, which may answer any approval"},"via":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the bridge (Slack, or the viewer's approval pages) that answered for the approver, as the signer's transport established it"},"groups":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64},"description":"user groups the bridge found the approver in"},"person":{"type":"string","maxLength":4096,"description":"the person id the signer's config maps the approver to"},"passkey":{"type":"object","additionalProperties":false,"required":["credential_id","user_verified"],"properties":{"credential_id":{"type":"string","maxLength":4096},"user_verified":{"const":true}},"description":"the WebAuthn credential whose assertion over the approval's binding digest the signer verified"},"approver_kind":{"const":"agent","description":"format 1.2: an agent approver (approvals.agents) answered; absent for people"},"asserted":{"type":"object","additionalProperties":false,"required":["attested"],"properties":{"model":{"type":"string","maxLength":128},"version":{"type":"string","maxLength":64},"prompt_hash":{"$ref":"#/$defs/hash"},"attested":{"const":false}},"description":"format 1.2: what the agent approver says it runs; its own word, never checked"},"spent":{"type":"object","additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"format 1.2: rule id -> the argument value this agent approval takes from the rule's sum budget"},"not_before":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096,"description":"format 1.2: an agent's approval is consumed from then on (after the rule's veto_s), so people may revoke it first"},"consume_by":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096,"description":"format 1.2: an agent's approval is consumed before then (approvals.agent_consume_s), or never"},"incident_id":{"$ref":"#/$defs/id","description":"format 1.2: the answer to a call held by this incident, by the person `person`"},"relied_on":{"$ref":"#/$defs/approver_answer"},"run_clean":{"type":"boolean","description":"format 1.8: a person's answer to an approval_agent approval: whether the run still met the AI approver's run bound when they answered and the answering identity never ran an agent session in the tenant (their answer is a precedent only then)"}}},"tool_result":{"type":"object","additionalProperties":false,"required":["tool_use_id","ok","output"],"properties":{"tool_use_id":{"type":"string","maxLength":4096},"ok":{"type":"boolean"},"output":{"$ref":"#/$defs/content"},"duration_ms":{"type":["integer","null"]},"decision_id":{"$ref":"#/$defs/id","description":"the policy.decision this result consumes"},"redaction":{"$ref":"#/$defs/redaction"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"}}},"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string","maxLength":4096}}},"review":{"type":"object","required":["reviewer","verdict"],"properties":{"reviewer":{"type":"string","maxLength":4096},"verdict":{"type":"object"},"cites":{"type":"array","maxItems":256,"items":{"type":"object","additionalProperties":false,"required":["run_seq","hash"],"properties":{"run_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"hash":{"$ref":"#/$defs/hash"}}},"description":"A signed finding (format 1.4; review_finding), in a findings run: the records of the analysed run it rests on, by run_seq and record hash. A review without cites (a migrated v1 judge verdict) is imported, not checked."}}},"trace_tamper":{"type":"object","additionalProperties":false,"required":["path","before","after"],"properties":{"tenant_level":{"type":"boolean"},"path":{"type":"string","maxLength":4096},"before":{"type":"object","properties":{"hash":{"$ref":"#/$defs/hash"},"length":{"type":"integer"}}},"after":{"type":"object","properties":{"hash":{"type":["string","null"],"maxLength":4096},"length":{"type":["integer","null"]}}},"kind":{"enum":["deleted","truncated","edited","prefix_unverifiable","rollback"]}}},"capture_gap":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"tenant_level":{"type":"boolean"},"reason":{"type":"string","maxLength":4096},"from_ts":{"type":["string","null"],"maxLength":4096},"to_ts":{"type":["string","null"],"maxLength":4096},"missed_events":{"type":["integer","null"]},"kind":{"enum":["signer_unavailable","client_counter_gap","retry_conflict","run_abandoned","witness_late","witness_failed","degraded_unanchored","format_upgrade","policy_timeout","decision_flip","class_mismatch","args_coerced","reconcile.hook_missing","reconcile.fabricated","reconcile.args_mismatch","reconcile.result_without_call","reconcile.unexplained_effect","state_tamper","tailer_lost","rollback","clock_skew","key_retired","key_revoked","log_closed","quota_refused","identity_refused","approval_expired","executed_against_policy","decision_mismatch","decided_not_completed","late_activity","concurrent_run","tailer_redelegated","reask_after_reject","held_call_unresolved","observer_lost","effect_outside_run","result_unchecked","constraint_refused"],"description":"Gap and tamper kinds (signer-written only)."},"run_id":{"$ref":"#/$defs/id","description":"format 1.2: the other run the gap is about (late_activity: the final run that was written to; concurrent_run: the open run this one overlaps; client_counter_gap in a tenant's signer run: the final run whose stream it is; effect_outside_run: the run the client named, its token valid or not, or the effect was attributed to)"},"tool_use_id":{"type":["string","null"],"maxLength":4096},"sensor":{"enum":["tetragon","falco","openshell"],"description":"format 1.4: the sensor (a kernel sensor, or OpenShell) whose import an observer_lost gap is about"}}},"checkpoint":{"type":"object","additionalProperties":false,"required":["head_seq","head_hash","kid","witnesses"],"properties":{"head_seq":{"type":"integer"},"head_hash":{"type":"string","pattern":"^[0-9a-f]{64}$","maxLength":4096},"kid":{"type":"string","maxLength":4096},"witnesses":{"type":"array","items":{"type":"string","maxLength":4096},"maxItems":1024}}},"user_prompt":{"type":"object","additionalProperties":false,"required":["content"],"properties":{"content":{"$ref":"#/$defs/content"}}},"model_message":{"type":"object","additionalProperties":false,"required":["kind","content"],"description":"Self-reported model output read from the harness transcript. Opt-in, off by default, lower trust.","properties":{"kind":{"enum":["text","thinking","thinking_withheld"]},"message_id":{"type":["string","null"],"maxLength":4096},"content":{"$ref":"#/$defs/content"}}},"model_exchange":{"type":"object","additionalProperties":false,"required":["exchange_id","phase","streamed"],"description":"C3: one model API request/response recorded by the proxy (source=proxy) before the request was forwarded and when the response completed.","properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"exchange_id":{"type":"string","maxLength":4096},"phase":{"enum":["request","response"]},"model":{"type":["string","null"],"maxLength":4096},"request":{"$ref":"#/$defs/content"},"response":{"$ref":"#/$defs/content"},"status":{"type":["integer","null"]},"streamed":{"type":"boolean"},"duration_ms":{"type":["integer","null"]},"first_byte_ms":{"type":["integer","null"]},"added_latency_ms":{"type":["number","null"]},"tool_uses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string","maxLength":4096},"name":{"type":"string","maxLength":4096},"executed_by":{"enum":["client","provider"]},"args_source":{"enum":["raw","parsed","coerced"]},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"args_unparseable":{"const":true,"description":"the raw arguments string failed strict parsing"},"id_synthetic":{"const":true,"description":"the provider gave no id; the reporting client made this one"}}},"maxItems":1024},"said_only":{"const":true,"description":"format 1.4: a response recorded with what the model said and without the calls it asked for (a harness whose hooks name no call); reconciliation reads no call from it"},"tool_results_sent":{"type":"array","items":{"type":"string","maxLength":4096},"description":"tool_use ids whose results the harness sent back in this request","maxItems":1024},"stop_reason":{"type":["string","null"],"maxLength":4096},"upstream":{"type":"string","maxLength":4096},"error":{"type":["string","null"],"maxLength":4096},"attribution":{"enum":["metadata","tool_use_id","none"]},"usage":{"type":"object","additionalProperties":false,"required":["input_tokens","output_tokens"],"description":"Token usage on the response (optional). input_tokens excludes cache reads; reasoning_tokens is part of output_tokens.","properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"cache_read_tokens":{"type":["integer","null"],"minimum":0},"cache_write_tokens":{"type":["integer","null"],"minimum":0},"reasoning_tokens":{"type":["integer","null"],"minimum":0}}},"content_digest":{"$ref":"#/$defs/commitment"}}},"id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"run_registered":{"type":"object","additionalProperties":false,"required":["agent","identity"],"properties":{"agent":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"version":{"type":"string","maxLength":64}}},"identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"enum":["uid","harness","token","k8s_sa","mtls","oidc"]},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}}},"signer_isolation":{"enum":["same-user","separate-user","remote","unknown"],"description":"measured by the signer from the caller's identity, never taken from the client"},"harness":{"type":"object","additionalProperties":false,"required":["name","exe","pid","start_time","attested"],"properties":{"name":{"type":"string","maxLength":64},"exe":{"type":"string","maxLength":4096},"pid":{"type":"integer","minimum":1},"start_time":{"type":["integer","null"]},"attested":{"const":true}},"description":"the registered harness process the caller descends from, found by the signer through the harness helper"},"fail_modes":{"type":"object","additionalProperties":{"enum":["open","closed"]},"description":"tool class -> fail mode, from the signer's config, never from the client"},"analyzes":{"$ref":"#/$defs/id","description":"a findings run: the run_id of the run of the same tenant it analyses"},"caller":{"type":"string","maxLength":300,"description":"format 1.8: the client a gateway registered the run for (scheme:subject): the run's labels are the client's","minLength":1},"replay_of":{"$ref":"#/$defs/id","description":"a tracekit why replay run: the run_id of the run of the same tenant it replays"},"investigation":{"$ref":"#/$defs/id","description":"with replay_of: the investigation the replay run is an arm of"},"parent_run":{"$ref":"#/$defs/id","description":"format 1.2: the run of the same tenant that started this one, whose run token the caller presented"},"session":{"$ref":"#/$defs/id","description":"with parent_run: the root run of the chain of parents (a run without parent_run is its own session)"},"fidelity":{"enum":["none"],"description":"an imported run (source import): what its records say about the calls beyond their receipt"},"posture":{"type":"object","additionalProperties":false,"required":["network","tool_calls","gateway_mandatory","attested"],"description":"format 1.2: the deployment's posture as the operator asserts it in signer.yaml: whether the agent's network is enforced through the egress proxy, whether it acts only through the executor and the MCP gateway, and whether the LLM gateway is its only way to its model (gateway_mandatory); never attested","properties":{"network":{"enum":["enforced","open"]},"tool_calls":{"enum":["enforced","open"]},"gateway_mandatory":{"type":"boolean"},"attested":{"const":false}}}}},"run_closing":{"type":"object","additionalProperties":false,"required":["reason"],"properties":{"reason":{"enum":["close_run","idle_timeout","quarantine"]}}},"run_child":{"type":"object","additionalProperties":false,"required":["run_id"],"description":"format 1.2: a run bound to the same harness process registered with this run as its parent_run (signer-written)","properties":{"run_id":{"$ref":"#/$defs/id"}}},"run_final":{"type":"object","additionalProperties":false,"required":["head_run_seq","head_hash"],"properties":{"head_run_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"head_hash":{"$ref":"#/$defs/hash"},"provider_executed":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"format 1.2: tool uses the model's provider ran itself (executed_by provider), which no decide covers"},"coverage":{"type":"object","additionalProperties":false,"required":["layers","reconciled","unreconciled"],"description":"the capture layers that reported for the run and the tool calls the signer reconciled","properties":{"layers":{"type":"array","maxItems":6,"items":{"enum":["L1","L2","L3","L4","L5","L6"]}},"reconciled":{"type":"integer","minimum":0,"maximum":9007199254740991},"unreconciled":{"type":"object","additionalProperties":false,"description":"reconcile.* records of the run, by kind","properties":{"hook_missing":{"type":"integer","minimum":1,"maximum":9007199254740991},"fabricated":{"type":"integer","minimum":1,"maximum":9007199254740991},"args_mismatch":{"type":"integer","minimum":1,"maximum":9007199254740991},"args_unparseable":{"type":"integer","minimum":1,"maximum":9007199254740991},"result_without_call":{"type":"integer","minimum":1,"maximum":9007199254740991},"unexplained_effect":{"type":"integer","minimum":1,"maximum":9007199254740991},"result_mismatch":{"type":"integer","minimum":1,"maximum":9007199254740991}}}}},"paired_by_args":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"format 1.2: calls reconciled by pairing a decide with the model's tool use of the same turn by their arguments, the adapter having had no tool-call id"},"matrix":{"type":"object","additionalProperties":false,"required":["model_calls","tool_calls","network","processes","services"],"description":"format 1.2: per action class, how the run was covered: enforced (custody: the only way to act records it), observed (an observer outside the agent saw it and it was reconciled), reported (only the agent's own process reported it) or none; and the layers behind it","properties":{"model_calls":{"$ref":"#/$defs/coverage_class"},"tool_calls":{"$ref":"#/$defs/coverage_class"},"network":{"$ref":"#/$defs/coverage_class"},"processes":{"$ref":"#/$defs/coverage_class"},"services":{"$ref":"#/$defs/coverage_class"}}}}},"approval_request":{"type":"object","additionalProperties":false,"required":["approval_id","policy_hash","rule_ids","expires_at","requester","decision_id","binding","binding_digest"],"properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"approval_id":{"$ref":"#/$defs/id"},"policy_hash":{"$ref":"#/$defs/hash"},"rule_ids":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64}},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096},"requester":{"type":"string","maxLength":256},"requester_person":{"type":"string","maxLength":256,"description":"the requester's stable person id, when an OIDC identity"},"decision_id":{"$ref":"#/$defs/id"},"binding":{"type":"object","additionalProperties":false,"required":["v","approval_id","tenant","run_id","tool_call_id","attempt","tool","args_commitment","args_source","policy_hash","nonce","expires_at"],"description":"what the approval is bound to; binding_digest is sha256(JCS(binding)), the args bound through args_commitment","properties":{"v":{"const":1},"approval_id":{"$ref":"#/$defs/id"},"tenant":{"$ref":"#/$defs/id"},"run_id":{"$ref":"#/$defs/id"},"tool_call_id":{"$ref":"#/$defs/id"},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991},"tool":{"type":"string","maxLength":256},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"args_source":{"enum":["raw","parsed","coerced"]},"policy_hash":{"$ref":"#/$defs/hash"},"nonce":{"type":"string","pattern":"^[0-9a-f]{32}$","maxLength":32},"expires_at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096}}},"binding_digest":{"$ref":"#/$defs/hash"},"executor":{"enum":["t1","t2"],"description":"t2: approval_consume returns the approved arguments and its caller runs exactly those"},"agent":{"type":"object","additionalProperties":false,"required":["eligible","reason","rules","conditions_hash","args_key"],"description":"format 1.2: whether an agent approver may answer this approval, computed by the signer from the call's arguments and the run","properties":{"eligible":{"type":"boolean"},"reason":{"type":"string","maxLength":1024},"rules":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64},"description":"the rules it asked by with approval.agent"},"conditions_hash":{"$ref":"#/$defs/hash","description":"sha256 of JCS of those rules' approval.agent sections"},"args_key":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76,"description":"an HMAC of the call's arguments under a key of this run: the same in this run for the same arguments, so a call an agent said no to is a person's to answer when asked again"}}},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"},"incident_id":{"$ref":"#/$defs/id","description":"format 1.2: the call is held by this incident: only a person who is not the run's owner, principal or requester answers it"},"passkey":{"const":true,"description":"the approval needs a passkey (approval: {passkey: required})"},"ai":{"$ref":"#/$defs/approver_request"}}},"approval_consumed":{"type":"object","additionalProperties":false,"required":["approval_id"],"properties":{"approval_id":{"$ref":"#/$defs/id"}}},"approval_expired":{"type":"object","additionalProperties":false,"required":["approval_id"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"reason":{"enum":["ttl","run_final","consume_window","hold","quarantine"],"description":"format 1.2, on approvals an agent may answer: approvals.ttl_s passed, the run ended, or an agent's approval was not consumed within approvals.agent_consume_s; on any approval: its run was held or quarantined (hold, quarantine)"}}},"approval_refused":{"type":"object","additionalProperties":false,"required":["tool_use_id","rule_ids","reason"],"properties":{"tool_use_id":{"$ref":"#/$defs/id"},"approval_id":{"$ref":"#/$defs/id"},"rule_ids":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":64}},"reason":{"type":"string","maxLength":1024}}},"approval_binding_mismatch":{"type":"object","additionalProperties":false,"required":["approval_id","tool_use_id","approved_commitment","args_commitment"],"properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"approval_id":{"$ref":"#/$defs/id"},"tool_use_id":{"$ref":"#/$defs/id"},"approved_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"args_commitment":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"decision_id":{"$ref":"#/$defs/id","description":"the decision the approval was for (without salt_id: the decision whose salt both commitments are under)"}}},"approval_abandoned":{"type":"object","additionalProperties":false,"required":["approval_id"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"reason":{"type":"string","maxLength":1024}},"description":"the adapter will never resume the paused call; the approval ends at once"},"approval_escalated":{"type":"object","additionalProperties":false,"required":["approval_id","by"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"by":{"enum":["agent","signer"]},"reason":{"type":"string","maxLength":1024},"approver_identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the approver as the signer's transport established it"},"relied_on":{"$ref":"#/$defs/approver_answer"}},"description":"format 1.2: only people answer this approval from now on: an agent approver handed it over, or the signer did (no agent answered within agent_timeout_s, a budget ran out)"},"approval_revoked":{"type":"object","additionalProperties":false,"required":["approval_id","by"],"properties":{"approval_id":{"$ref":"#/$defs/id"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"person":{"type":"string","maxLength":256,"description":"format 1.8: the person approvals.persons (or an OIDC claim) names for `by`"}},"description":"format 1.2: a person (or the kill switch, by signer) vetoed an agent's approval before it was consumed"},"approval_suggested":{"type":"object","additionalProperties":false,"required":["tool_use_id","approval_id","decision","approver","approver_identity","channel","approver_kind"],"properties":{"tool_use_id":{"$ref":"#/$defs/id"},"approval_id":{"$ref":"#/$defs/id"},"decision":{"enum":["approve","reject","escalate"]},"approver":{"type":"string","maxLength":256},"approver_identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"type":"string","maxLength":32},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"},"person":{"type":"string","maxLength":256,"description":"an OIDC identity's stable person id"}},"description":"the approver as the signer's transport established it"},"channel":{"type":"string","maxLength":64},"approver_kind":{"const":"agent"},"asserted":{"type":"object","additionalProperties":false,"required":["attested"],"properties":{"model":{"type":"string","maxLength":128},"version":{"type":"string","maxLength":64},"prompt_hash":{"$ref":"#/$defs/hash"},"attested":{"const":false}},"description":"format 1.2: what the agent approver says it runs; its own word, never checked"},"reason":{"type":"string","maxLength":1024},"relied_on":{"$ref":"#/$defs/approver_answer"}},"description":"format 1.2: a shadow-mode agent approver's answer, recorded only: it changes nothing"},"approval_agents":{"type":"object","additionalProperties":false,"required":["enabled","by"],"properties":{"enabled":{"type":"boolean"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}},"description":"format 1.2: the operator's kill switch for agent approvals (in the signer run); switching off revokes every agent approval not consumed yet"},"input_observed":{"type":"object","additionalProperties":false,"description":"content that entered the run other than as a tool result (observe RPC), indexed for provenance; the value itself is only committed to","required":["source","trust","output","redaction","salt_id"],"properties":{"source":{"type":"string","maxLength":256,"description":"the caller's name for where the content came from"},"trust":{"enum":["trusted","untrusted"],"description":"the caller's claim; it only decides how this content's own values count"},"output":{"$ref":"#/$defs/content"},"redaction":{"$ref":"#/$defs/redaction"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"},"via":{"type":"string","maxLength":256,"description":"format 1.2: the gateway or tool executor (its identity, scheme:subject) that wrote this record for the run's client (source gateway, tier T2); the signer takes the call's later steps from it only"}}},"state_write":{"type":"object","additionalProperties":false,"required":["store","key","digest"],"properties":{"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>); absent on records written before salt_id existed"},"store":{"type":"string","maxLength":256},"key":{"type":"string","maxLength":256},"prev_digest":{"oneOf":[{"$ref":"#/$defs/commitment"},{"type":"null"}]},"digest":{"$ref":"#/$defs/commitment"}}},"signer_epoch":{"type":"object","additionalProperties":false,"required":["keys"],"properties":{"keys":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["kid","alg","spki"],"properties":{"kid":{"$ref":"#/$defs/hash"},"alg":{"type":"string","maxLength":32,"pattern":"^[a-z0-9-]+$"},"spki":{"type":"string","maxLength":4096,"pattern":"^[A-Za-z0-9+/]+={0,2}$","description":"base64 DER SubjectPublicKeyInfo"},"cert":{"type":"object","additionalProperties":false,"required":["certificate","index","inclusion","checkpoint"],"description":"the key's issuance entry from a record-key issuer (tracekit.format.cert, docs/issuer.md)","properties":{"certificate":{"type":"object","additionalProperties":false,"required":["cert","sig"],"properties":{"cert":{"type":"object","additionalProperties":false,"required":["kid","spki","log_id","tenants","not_before","not_after","serial"],"properties":{"kid":{"$ref":"#/$defs/hash"},"spki":{"type":"string","maxLength":4096,"pattern":"^[A-Za-z0-9+/]+={0,2}$"},"log_id":{"type":"string","maxLength":64},"tenants":{"type":"array","maxItems":256,"items":{"type":"string","maxLength":256}},"not_before":{"type":"integer","minimum":0,"maximum":9007199254740991},"not_after":{"type":"integer","minimum":0,"maximum":9007199254740991},"serial":{"type":"string","maxLength":64,"pattern":"^[0-9a-f]+$"}}},"sig":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9+/]+={0,2}$"}}},"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"inclusion":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":64,"pattern":"^[A-Za-z0-9+/]+={0,2}$"}},"checkpoint":{"type":"string","maxLength":16384}}}}}},"bridge":{"type":"object","additionalProperties":false,"required":["v1_kid","v1_last_seq","v1_head"],"description":"the v1 ledger this log continues: its key, the seq and hash of its last (key retirement) record","properties":{"v1_kid":{"type":"string","maxLength":24,"pattern":"^ed25519:[0-9a-f]{16}$"},"v1_last_seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"v1_head":{"type":"string","maxLength":64,"pattern":"^[0-9a-f]{64}$"}}}}},"key_retire":{"type":"object","additionalProperties":false,"required":["kid","last_seq"],"properties":{"kid":{"$ref":"#/$defs/hash"},"last_seq":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"log_closed":{"type":"object","additionalProperties":false,"required":["final_seq"],"properties":{"final_seq":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"reconcile":{"type":"object","additionalProperties":false,"required":["layers"],"properties":{"layers":{"type":"array","maxItems":6,"items":{"enum":["L1","L2","L3","L4","L5","L6"]}},"detail":{"type":"string","maxLength":1024}}},"refusal_summary":{"type":"object","additionalProperties":false,"required":["code","count","from_ts","to_ts"],"properties":{"code":{"type":"string","maxLength":64},"count":{"type":"integer","minimum":1,"maximum":9007199254740991},"from_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096},"to_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":4096},"identity":{"type":"string","maxLength":256}}},"policy_external":{"type":"object","additionalProperties":false,"required":["system","decision","tool_use_id","tool","rule_ids","signature","record","identity","salt_id"],"description":"Another system's decision about a tool call, imported by an identity authorized for decision_import (tier T3). The signer's own policy.decision stays authoritative.","properties":{"system":{"type":"string","minLength":1,"maxLength":64},"decision":{"enum":["allow","deny","ask"]},"tool_use_id":{"$ref":"#/$defs/id"},"tool":{"type":"string","minLength":1,"maxLength":256},"rule_ids":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":32},"reason":{"type":"string","maxLength":4096,"description":"the system's reason, redacted"},"signature":{"enum":["verified","unverified"],"description":"verified: the system's Ed25519 signature over its record holds under the key the signer's config pins for it"},"record":{"type":"object","additionalProperties":false,"required":["hash","size"],"description":"the system's own record: an HMAC of its sha256 under this record's salt (salt_id), and its size in bytes","properties":{"hash":{"type":"string","pattern":"^hmac-sha256:[0-9a-f]{64}$","maxLength":76},"size":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"identity":{"type":"object","additionalProperties":false,"required":["scheme","subject","attested"],"properties":{"scheme":{"enum":["uid","harness","token","k8s_sa","mtls","oidc"]},"subject":{"type":"string","maxLength":256},"attested":{"type":"boolean"}}},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"}}},"content_accessed":{"type":"object","additionalProperties":false,"required":["principal","run_id","seqs","purpose"],"description":"The signer returned retained content of records of a run of this tenant (format 1.1; content_get): who asked, the run, its run_seqs and why. Never the content.","properties":{"principal":{"type":"string","maxLength":256},"run_id":{"type":"string","maxLength":128},"seqs":{"type":"array","maxItems":1000,"items":{"type":"integer","minimum":0,"maximum":9007199254740991}},"purpose":{"type":"string","maxLength":512}}},"content_erased":{"type":"object","additionalProperties":false,"required":["run_id","reason","by"],"description":"The signer deleted the retained content of a run of this tenant (format 1.1; content_erase or retention); the run's records are unchanged.","properties":{"run_id":{"type":"string","maxLength":128},"reason":{"type":"string","maxLength":1024},"by":{"type":"string","maxLength":256}}},"why_finding":{"type":"object","additionalProperties":false,"required":["target","intervention","n","p_with","p_without","effect","interval","verdict","replay_runs","models","rung","off_tape","investigation","looks","family","min_effect","applied","stopped"],"description":"A finished tracekit why test (format 1.1; why_finding), written in a findings run about the run it analyses: how often the target happened in the control arm (p_with) and with the intervention (p_without) over n paired replays, the interval and verdict with what they were decided on (looks: the sequential test's planned looks, family: the tests corrected for together, min_effect, applied: whether the intervention matched anything, stopped: why the test ended), every replay run with its arm and outcome, and the replay runs of the investigation it does not count (uncounted: the surrogate's ranking calls, arms a budget stop abandoned). rung 1: one recorded model call re-sent; rung 2: the agent loop re-simulated from the recorded run.","properties":{"target":{"type":"string","maxLength":1024},"intervention":{"type":"string","maxLength":1024},"n":{"type":"integer","minimum":0,"maximum":9007199254740991},"p_with":{"type":"number","minimum":0,"maximum":1},"p_without":{"type":"number","minimum":0,"maximum":1},"effect":{"type":"number","minimum":-1,"maximum":1},"interval":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":-1,"maximum":1}},"verdict":{"enum":["causal","suppressive","ruled-out","inconclusive","not-applied"]},"replay_runs":{"type":"array","maxItems":4096,"items":{"type":"object","additionalProperties":false,"required":["run_id","arm","hit"],"properties":{"run_id":{"$ref":"#/$defs/id"},"arm":{"enum":["control","ablated"]},"hit":{"type":"boolean"}}}},"models":{"type":"array","maxItems":32,"items":{"type":"string","maxLength":128}},"rung":{"enum":[1,2]},"off_tape":{"type":"integer","minimum":0,"maximum":9007199254740991},"investigation":{"$ref":"#/$defs/id"},"looks":{"type":"integer","minimum":1,"maximum":4096},"family":{"type":"integer","minimum":1,"maximum":4096},"min_effect":{"type":"number","minimum":0,"maximum":1},"applied":{"type":"boolean"},"stopped":{"enum":["decisive","futility","n_max","budget"]},"uncounted":{"type":"array","maxItems":4096,"items":{"type":"object","additionalProperties":false,"required":["run_id","reason"],"properties":{"run_id":{"$ref":"#/$defs/id"},"reason":{"enum":["ranking","budget"]}}}}}},"incident_opened":{"type":"object","additionalProperties":false,"required":["incident_id","trigger","rule_ids","scope","cites","mode","actions","would"],"description":"format 1.2: a trigger of the policy's detection fired (a sequence completed, a limit was exceeded, or a respond trigger), an operator held or quarantined a run (trigger operator), or the detector could not vouch for a decision under an enforced response (detector_unavailable); one open incident per scope, trigger and rule, later matches are incident.updated. mode shadow: no action taken, `would` the configured one; mode enforce: `actions` the ones taken (none while the response engine is paused: then `would` and `reason` say so)","properties":{"incident_id":{"$ref":"#/$defs/id"},"trigger":{"enum":["sequence","limit","executed_against_policy","denied_calls","provenance","class_mismatch","refusal_burst","tamper","operator","detector_unavailable","unexplained_effect"]},"rule_ids":{"type":"array","maxItems":1024,"items":{"type":"string","maxLength":256}},"scope":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["run","session","owner","principal"]},"id":{"type":"string","maxLength":256}}},"cites":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["run_id","run_seq"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"run_seq":{"type":"integer","minimum":0}}},"description":"the records that make up the match"},"mode":{"enum":["shadow","enforce"]},"actions":{"type":"array","maxItems":3,"items":{"enum":["notify","hold","quarantine"]}},"would":{"type":"array","maxItems":4,"items":{"enum":["notify","hold","quarantine","suspend"]}},"reason":{"type":"string","maxLength":1024,"description":"why the actions differ from the configured one (paused, no person approvers), or an operator's reason"},"in_flight":{"type":"array","maxItems":1024,"description":"format 1.2: calls allowed (or approved and consumed) and not completed when the response took effect: they may complete after it","items":{"type":"object","additionalProperties":false,"required":["run_id","tool_call_id","decision_id"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"tool_call_id":{"$ref":"#/$defs/id"},"decision_id":{"$ref":"#/$defs/id"}}}}}},"incident_updated":{"type":"object","additionalProperties":false,"required":["incident_id","cites"],"description":"format 1.2: another match of an open incident (at most one per window of its trigger), written in the run whose record matched","properties":{"incident_id":{"$ref":"#/$defs/id"},"cites":{"type":"array","maxItems":64,"items":{"type":"object","additionalProperties":false,"required":["run_id","run_seq"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"run_seq":{"type":"integer","minimum":0}}}}}},"incident_capped":{"type":"object","additionalProperties":false,"required":["cap","max","trigger","reason"],"description":"format 1.2: a cap on opened incidents was reached: the run's per trigger (cap run), or per minute the tenant's or one run's share of it (cap tenant); the incidents after it are not written","properties":{"cap":{"enum":["run","tenant"]},"trigger":{"enum":["sequence","limit","executed_against_policy","denied_calls","provenance","class_mismatch","refusal_burst","tamper","operator","detector_unavailable","unexplained_effect"],"description":"the trigger of the first incident not written"},"max":{"type":"integer","minimum":1},"reason":{"type":"string","maxLength":512}}},"run_held":{"type":"object","additionalProperties":false,"required":["incident_id","scope","by","reason"],"description":"format 1.2: the run is held: every further call is asked of a person (TK-HOLD) and its live approvals expired; written in each run the incident's scope reaches","properties":{"incident_id":{"$ref":"#/$defs/id"},"scope":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["run","session","owner","principal"]},"id":{"type":"string","maxLength":256}}},"by":{"type":"string","maxLength":256,"description":"signer, or the operator's identity"},"reason":{"type":"string","maxLength":1024},"in_flight":{"type":"array","maxItems":1024,"description":"format 1.2: calls allowed (or approved and consumed) and not completed when the response took effect: they may complete after it","items":{"type":"object","additionalProperties":false,"required":["run_id","tool_call_id","decision_id"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"tool_call_id":{"$ref":"#/$defs/id"},"decision_id":{"$ref":"#/$defs/id"}}}},"inherited":{"const":true,"description":"a new run of a held owner and principal (or of a held parent run) took the hold over"},"inherit_until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27,"description":"until when new runs of this run's owner and attested principal inherit the hold"}}},"run_resumed":{"type":"object","additionalProperties":false,"required":["incident_id","by","person","held_by"],"description":"format 1.2: a person ended the hold of one incident on the run (run_resume, which ends each, or incident_resolve of that incident); held_by: the incidents that still hold it","properties":{"incident_id":{"$ref":"#/$defs/id"},"by":{"type":"string","maxLength":256},"person":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"break_glass":{"const":true},"held_by":{"type":"array","maxItems":1024,"items":{"$ref":"#/$defs/id"}}}},"run_quarantined":{"type":"object","additionalProperties":false,"required":["incident_id","scope","by","reason"],"description":"format 1.2: the run is quarantined for good: decisions are deny (TK-QUARANTINE), approvals are refused, a gateway forwards no more model requests","properties":{"incident_id":{"$ref":"#/$defs/id"},"scope":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["run","session","owner","principal"]},"id":{"type":"string","maxLength":256}}},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"in_flight":{"type":"array","maxItems":1024,"description":"format 1.2: calls allowed (or approved and consumed) and not completed when the response took effect: they may complete after it","items":{"type":"object","additionalProperties":false,"required":["run_id","tool_call_id","decision_id"],"properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"tool_call_id":{"$ref":"#/$defs/id"},"decision_id":{"$ref":"#/$defs/id"}}}},"inherited":{"const":true},"inherit_until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27,"description":"until when new runs of this run's owner and attested principal inherit the hold"}}},"incident_resolved":{"type":"object","additionalProperties":false,"required":["incident_id","by","person"],"description":"format 1.2: a person resolved the incident (in the tenant's signer run): its held runs resume, quarantines stay","properties":{"incident_id":{"$ref":"#/$defs/id"},"by":{"type":"string","maxLength":256},"person":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"break_glass":{"const":true},"resumed":{"type":"array","maxItems":4096,"items":{"type":"string","maxLength":200}}}},"incident_response":{"type":"object","additionalProperties":false,"required":["enabled","by"],"description":"format 1.2: an operator paused (enabled false) or resumed the tenant's response engine; detection keeps recording","properties":{"enabled":{"type":"boolean"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}}},"identity_suspension":{"type":"object","additionalProperties":false,"required":["identity","state","by"],"description":"format 1.2: an identity of the tenant is suspended by an operator (written by the signer that changed the shared list), enforced (each signer that starts enforcing an entry) or lifted","properties":{"identity":{"type":"string","maxLength":256},"state":{"enum":["suspended","enforced","lifted"]},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}}},"effect_observed":{"type":"object","additionalProperties":false,"required":["observer","kind","host","port","bytes_out","bytes_in","connections","first_ts","last_ts","attribution"],"description":"format 1.2: network traffic an egress observer outside the agent saw for the run (tracekit.egress), aggregated per host, port and minute; signer-written","properties":{"observer":{"type":"string","maxLength":256,"description":"the egress observer's signer identity (scheme:subject)"},"kind":{"enum":["net"]},"host":{"type":"string","minLength":1,"maxLength":253},"port":{"type":"integer","minimum":1,"maximum":65535},"bytes_out":{"type":"integer","minimum":0,"maximum":9007199254740991},"bytes_in":{"type":"integer","minimum":0,"maximum":9007199254740991},"connections":{"type":"integer","minimum":0,"maximum":9007199254740991},"first_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"last_ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"attribution":{"enum":["token","identity"],"description":"token: the client presented the run's token; identity: the observer authenticated the run's owner and the signer picked that owner's latest open run"},"explained_by":{"enum":["call","explains"],"description":"what explains the host: a recorded http or model call to it, or the policy's explains; absent: unexplained (a reconcile.unexplained_effect follows)"}}},"sensor_effect":{"type":"object","additionalProperties":false,"required":["observer","sensor","kind","ts","pid","binary","attribution"],"description":"format 1.4: what a kernel sensor (Tetragon, Falco) reported a process of the run did, or what OpenShell reported of its sandbox (its connections allowed and blocked, its entrypoint's start), imported under the import's own signer identity (an observer's assertion); signer-written","properties":{"observer":{"type":"string","maxLength":256,"description":"the import's signer identity (scheme:subject)"},"sensor":{"enum":["tetragon","falco","openshell"]},"kind":{"enum":["exec","exit","connect","file"],"description":"exec: the process started; exit: it ended; connect: it connected to host:port; file: the sensor's policy selected a file event of it (a write outside the workspace, in the shipped samples)"},"ts":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z$","maxLength":27},"pid":{"type":"integer","minimum":0,"maximum":4294967295},"binary":{"type":"string","minLength":1,"maxLength":4096},"exec_id":{"type":"string","minLength":1,"maxLength":256,"description":"the sensor's id of the process (Tetragon's exec_id)"},"parent_exec_id":{"type":"string","minLength":1,"maxLength":256,"description":"exec: the sensor's id of the process that started this one (Tetragon's parent_exec_id)"},"args_commitment":{"$ref":"#/$defs/commitment","description":"commitment to sha256 of the arguments string as the sensor reported it"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitments (salt label <type>:<salt_id>)"},"status":{"type":"integer","minimum":0,"maximum":4294967295},"signal":{"type":"string","maxLength":32},"host":{"type":"string","minLength":1,"maxLength":253},"port":{"type":"integer","minimum":0,"maximum":65535},"path":{"type":"string","minLength":1,"maxLength":4096},"tool_call_id":{"$ref":"#/$defs/id","description":"the tool call id the process's environment carried (CODEX_TOOL_CALL_ID): the agent's claim, recorded as it came and checked by no signer (TK-X206 checks it)"},"denied":{"const":true,"description":"the sensor (OpenShell's network policy) blocked it"},"attribution":{"enum":["token","identity"],"description":"identity: the import mapped the process to the run's owner and the signer picked that owner's latest open run"}}},"reconcile_effect":{"type":"object","additionalProperties":false,"required":["layers","observer","kind","host"],"description":"format 1.2: a host an observer saw the run reach that no record of the run explains","properties":{"layers":{"type":"array","maxItems":6,"items":{"enum":["L1","L2","L3","L4","L5","L6"]}},"detail":{"type":"string","maxLength":1024},"observer":{"type":"string","maxLength":256,"description":"the egress observer's signer identity (scheme:subject)"},"kind":{"enum":["net"]},"host":{"type":"string","minLength":1,"maxLength":253},"port":{"type":"integer","minimum":1,"maximum":65535}}},"coverage_class":{"type":"object","additionalProperties":false,"required":["status","layers"],"properties":{"status":{"enum":["enforced","observed","reported","none"]},"layers":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":32}},"asserted":{"const":true,"description":"the status rests on the operator's posture (signer.yaml), not on anything the signer measured"}}},"constraint_added":{"type":"object","additionalProperties":false,"required":["kind"],"description":"format 1.4: a live constraint of the run (constraint_add): what the person's request said not to do in the rest of it, as its client reported it (the Claude Code hook, at UserPromptSubmit). From then on the signer raises a call that breaks it to an ask (rule TK-CONSTRAINT) and never lowers a decision, so a made-up constraint can only hold more calls","properties":{"kind":{"enum":["keep_away","only_change","read_only","no_push","no_network"],"description":"keep_away: writes of the file; only_change: writes of any other file; read_only: any write; no_push: a git push; no_network: a call that reaches the network"},"object_commitment":{"$ref":"#/$defs/commitment","description":"keep_away and only_change: commitment to sha256 of the file's lower-cased basename; never the name"},"salt_id":{"$ref":"#/$defs/id","description":"the signer's salt id for this record's commitment (salt label <type>:<salt_id>)"}}},"run_label":{"description":"format 1.8: a change of the run's labels (docs/policy-v2.md#run-conditions), which run condition rules read. add: by the signer alone, right after the record that set it (source: that record's run_seq): a call that ran and matched a rule whose label it is, a tool whose results the policy's untrusted list names, an input observed as untrusted; or before a decision, a label the run's requester carries from another run of theirs (inherited: that run's run.label add). clear: by a person (run_label_clear), never the run's owner, principal or requester; on a signer with no approvals config (a dev signer), by any identity of the run's tenant, the run's owner too, then self_cleared","oneOf":[{"type":"object","additionalProperties":false,"required":["label","action","by","source"],"properties":{"label":{"enum":["secrets_access","untrusted_content"]},"action":{"const":"add"},"by":{"const":"signer"},"source":{"type":"integer","minimum":0,"description":"the run_seq of the record that set the label"}}},{"type":"object","additionalProperties":false,"required":["label","action","by","inherited"],"properties":{"label":{"enum":["secrets_access","untrusted_content"]},"action":{"const":"add"},"by":{"const":"signer"},"inherited":{"type":"object","additionalProperties":false,"required":["run_id","run_seq"],"description":"the run.label add of another run of the requester's that this one inherits","properties":{"run_id":{"type":"string","minLength":1,"maxLength":200},"run_seq":{"type":"integer","minimum":0}}}}},{"type":"object","additionalProperties":false,"required":["label","action","by","identity","person"],"properties":{"label":{"enum":["secrets_access","untrusted_content"]},"action":{"const":"clear"},"by":{"const":"person"},"identity":{"type":"string","maxLength":256,"description":"the identity that cleared it (scheme:subject)"},"person":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"break_glass":{"const":true},"self_cleared":{"const":true,"description":"a dev signer's (no approvals config): the run's own owner, or any identity of its tenant, cleared it"},"run_id":{"type":"string","minLength":1,"maxLength":200,"description":"a clear of a run that has ended, in its tenant's signer run: that run, whose label it ends for every run that took the label from it"}}}]},"ext_name":{"type":"string","pattern":"^[a-z][a-z0-9_.-]*$","maxLength":64,"description":"The name of a non-critical field or record (format 1.4)."},"ext":{"type":"object","required":["name"],"properties":{"name":{"$ref":"#/$defs/ext_name"}},"description":"A non-critical record (format 1.4): its name and any other strict JSON fields, checked as the ext field is."},"approver_key":{"type":"object","additionalProperties":false,"required":["rules","tool","target","project"],"description":"format 1.8: an AI approver's precedent key as shown: the rules, the tool, what each rule read of the call (redacted, each value cut to 256 characters, 16 values at most) and the project","properties":{"rules":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string","maxLength":64}},"tool":{"type":"string","maxLength":256},"target":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"array","maxItems":16,"items":{"type":"string","maxLength":256}}},"project":{"type":["string","null"],"maxLength":128}}},"approver_request":{"type":"object","additionalProperties":false,"required":["key","digest","labels","clean","precedents"],"description":"format 1.8: a call held only by the policy's approval_agent rules: its precedent key (the rules, the tool, what each rule read of the call, redacted and cut, and the project the client named), the key's digest over what was read in full (a precedent matches by digest, tenant and requester), the run's labels, whether the run met the run bound (a person's answer counts as a precedent only then) and the precedents that counted","properties":{"key":{"$ref":"#/$defs/approver_key"},"digest":{"$ref":"#/$defs/commitment","description":"the precedent key's digest over what each rule read in full, committed under the tenant's own salt: equal keys match, and what redaction or the cut left out can't be confirmed by a guess"},"labels":{"type":"array","maxItems":2,"items":{"enum":["untrusted_content","secrets_access"]},"description":"the run's labels the signer read for approval_agent's run bound"},"clean":{"type":"boolean"},"precedents":{"type":"object","additionalProperties":false,"required":["approve","reject"],"properties":{"approve":{"type":"array","maxItems":8,"items":{"$ref":"#/$defs/id"}},"reject":{"type":"array","maxItems":8,"items":{"$ref":"#/$defs/id"}}},"description":"the approval ids of people's answers to calls like this one that counted as precedents then, by decision, newest first"},"asserted":{"type":"array","maxItems":1,"items":{"enum":["project"]},"description":"the parts of the key the agent's own process supplied, not the signer: they only narrow a precedent match"},"wide_digest":{"$ref":"#/$defs/commitment","description":"the same key's digest in any project, each package source however it is spelled (no default port, no trailing slash), committed as digest is: an accepted lesson that says no binds a call of either"}}},"approver_answer":{"type":"object","additionalProperties":false,"required":["precedents","playbook","policy_hash","labels","mode","view"],"description":"format 1.8: what an AI answer to an approval_agent approval relied on, as the signer read it when it answered (precedents, the playbook in force, the policy, the run's labels, the view it served the reviewer, whether its answer decided or was a suggestion and why: the circuit breaker), and the reviewer's own word (answers: each model's decision)","properties":{"precedents":{"type":"object","additionalProperties":false,"required":["approve","reject"],"properties":{"approve":{"type":"array","maxItems":8,"items":{"$ref":"#/$defs/id"}},"reject":{"type":"array","maxItems":8,"items":{"$ref":"#/$defs/id"}}},"description":"the approval ids of people's answers to calls like this one that counted as precedents then, by decision, newest first"},"playbook":{"type":"object","additionalProperties":false,"required":["version","digest"],"properties":{"version":{"type":"integer","minimum":0,"maximum":9007199254740991},"digest":{"$ref":"#/$defs/hash"}}},"policy_hash":{"$ref":"#/$defs/hash"},"labels":{"type":"array","maxItems":2,"items":{"enum":["untrusted_content","secrets_access"]},"description":"the run's labels the signer read for approval_agent's run bound"},"mode":{"enum":["shadow","enforce"]},"demoted":{"type":"string","maxLength":1024},"answers":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"object","additionalProperties":false,"required":["model","decision"],"properties":{"model":{"type":"string","minLength":1,"maxLength":128},"decision":{"enum":["approve","reject","escalate"]},"identity":{"type":"string","minLength":1,"maxLength":256,"description":"the model's identity as its server gave it (an Ollama model's /api/show digest, else the answer's model and system_fingerprint), which the circuit breaker pins: the reviewer's word"}}}},"view":{"$ref":"#/$defs/commitment","description":"the view the reviewer was served (approval_review's view_digest) and named in its answer, committed under this record's salt"}}},"playbook_entry":{"type":"object","additionalProperties":false,"required":["action","id","text","key","by"],"description":"format 1.8: a person accepted a playbook entry the AI approver proposed (from people's answers, P-, or a lesson drafted from a disagreement with them, L-), retired one, or dropped a proposal (in the tenant's signer run): its id (P- or L- and 32 hex digits of the text's sha256), text and precedent key; a lesson's decision, digest and evidence","properties":{"action":{"enum":["accept","retire","drop"]},"id":{"type":"string","pattern":"^[PL]-[0-9a-f]{32}$","maxLength":34},"text":{"type":"string","maxLength":2048},"key":{"$ref":"#/$defs/approver_key"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"decision":{"enum":["approve","reject"],"description":"the people's answer it holds: a later one the other way flags it"},"digest":{"type":"string","maxLength":77,"pattern":"^hmac-sha256:[0-9a-f]{64}$","description":"the precedent key's digest of the calls it is about"},"wide_digest":{"type":"string","maxLength":77,"pattern":"^hmac-sha256:[0-9a-f]{64}$","description":"its request's wide_digest: an entry that says no binds calls of it too (any project)"},"evidence":{"type":"array","maxItems":8,"items":{"type":"string","maxLength":128},"description":"the ids of the records it was drafted from: the AI's answer, the person's"}}},"precedent_revoked":{"type":"object","additionalProperties":false,"required":["approval_id","by"],"description":"format 1.8: a person's answer no longer counts as a precedent for the AI approver (a revert, a mistake), by a person (in the tenant's signer run)","properties":{"approval_id":{"$ref":"#/$defs/id"},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}}},"approver_enabled":{"type":"object","additionalProperties":false,"required":["rules","by"],"description":"format 1.8: a person turned rules the AI approver's circuit breaker dropped to shadow back on (in the tenant's signer run)","properties":{"rules":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string","maxLength":64}},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024}}},"approver_switched":{"type":"object","additionalProperties":false,"required":["on","by"],"description":"format 1.8: a person switched the AI approver on (for `rules` only, when given) or off (in the tenant's signer run); off revokes its approvals not yet consumed and hands pending ones to people","properties":{"on":{"type":"boolean"},"rules":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"string","maxLength":64}},"by":{"type":"string","maxLength":256},"reason":{"type":"string","maxLength":1024},"person":{"type":"string","maxLength":256,"description":"format 1.8: the person approvals.persons (or an OIDC claim) names for `by`"}}},"run_writer":{"description":"format 1.8: an identity other than the run's owner writes a stream of the run for the first time (one it was delegated to, or a gateway's caller), by the signer before that write's records: the run's labels are its too (docs/policy-v2.md#run-conditions), and a signer restarted from its records knows it","type":"object","additionalProperties":false,"required":["identity","stream"],"properties":{"identity":{"type":"string","minLength":1,"maxLength":300,"description":"the writer, scheme:subject, as the transport established it"},"stream":{"$ref":"#/$defs/id"},"gateway":{"const":true,"description":"it wrote through a gateway (a request's caller)"}}}}};
904
1505
  const KEYWORDS = new Set(["type", "const", "enum", "required", "properties", "additionalProperties", "propertyNames",
905
1506
  "items", "oneOf", "allOf", "if", "then", "$ref", "pattern", "minimum", "maximum", "minLength", "maxLength", "minItems",
906
1507
  "maxItems", "$schema", "$id", "$defs", "title", "description"]);
@@ -1183,16 +1784,18 @@ const __index = (() => {
1183
1784
  const { StrictJSONError: StrictJSONError, canonicalize: canonicalize, repr: quoted, strictParseBytes: strictParseBytes } = __jcs;
1184
1785
  const { ED25519: ED25519, HYBRID: HYBRID, NoteError: NoteError, SIGNER_LEAVES: SIGNER_LEAVES, b64decode: b64decode, bytes: bytes, checkWitnesses: checkWitnesses, equal: equal, keyAlg: keyAlg, leafHash: leafHash, openNote: openNote, parseLeaf: parseLeaf, parseVkey: parseVkey, registryOrigin: registryOrigin, runHash: runHash, sha256hex: sha256hex, spkiKid: spkiKid, unhex: unhex, verifyConsistency: verifyConsistency, verifyInclusion: verifyInclusion, verifyV2: verifyV2, vkey: vkey } = __primitives;
1185
1786
  const { Detector: Detector } = __detect;
1787
+ const { Sources: Sources, byCodePoint: byCodePoint, runLabels: runLabels } = __labels;
1788
+ const { Budget: Budget, Spent: Spent } = __rx;
1186
1789
  const { same: same, validateEvent: validateEvent } = __schema;
1187
1790
  const { BadZipFile: BadZipFile, MAX_ENTRY: MAX_ENTRY, Unusable: Unusable, readZip: readZip } = __zip;
1188
- const VERSIONS_JSON = {"1.1.0":{"types":["input.observed","content.accessed","content.erased","why.finding"],"fields":{"policy.decision":["provenance","provenance_state"],"run.registered":["replay_of"]},"values":{}},"1.2.0":{"types":["run.child","approval.escalated","approval.revoked","approval.suggested","approval.agents","incident.opened","incident.updated","incident.capped","run.held","run.resumed","run.quarantined","incident.resolved","incident.response","identity.suspension","effect.observed"],"fields":{"run.registered":["parent_run","session","posture"],"capture.gap":["run_id"],"run.final":["provider_executed","paired_by_args","matrix"],"policy.decision":["via","caller","detect","incident_id"],"approval.request":["agent","via","incident_id","passkey"],"tool.result":["via"],"input.observed":["via"],"approval":["approver_kind","asserted","spent","not_before","consume_by","incident_id"],"approval.expired":["reason"],"reconcile.unexplained_effect":["observer","kind","host","port"]},"values":{"capture.gap":{"kind":["decided_not_completed","late_activity","concurrent_run","tailer_redelegated","reask_after_reject","held_call_unresolved","observer_lost","effect_outside_run"]},"run.closing":{"reason":["quarantine"]}}},"1.3.0":{"types":["reconcile.result_mismatch"],"fields":{},"values":{"capture.gap":{"kind":["result_unchecked"]}}},"1.4.0":{"types":["constraint.added"],"fields":{"effect.observed":["sensor","denied"],"review":["cites"],"model.exchange":["said_only"],"capture.gap":["sensor"]},"values":{"capture.gap":{"kind":["constraint_refused"]}},"ext":["amended","openshell.policy"],"layout":["run parts"]},"1.6.0":{"types":[],"fields":{},"values":{"ext":{"self_approved":[true]}},"ext":["box","grant","intent.grant","intent.revoked"]}};
1791
+ const VERSIONS_JSON = {"1.1.0":{"types":["input.observed","content.accessed","content.erased","why.finding"],"fields":{"policy.decision":["provenance","provenance_state"],"run.registered":["replay_of"]},"values":{}},"1.2.0":{"types":["run.child","approval.escalated","approval.revoked","approval.suggested","approval.agents","incident.opened","incident.updated","incident.capped","run.held","run.resumed","run.quarantined","incident.resolved","incident.response","identity.suspension","effect.observed"],"fields":{"run.registered":["parent_run","session","posture"],"capture.gap":["run_id"],"run.final":["provider_executed","paired_by_args","matrix"],"policy.decision":["via","caller","detect","incident_id"],"approval.request":["agent","via","incident_id","passkey"],"tool.result":["via"],"input.observed":["via"],"approval":["approver_kind","asserted","spent","not_before","consume_by","incident_id"],"approval.expired":["reason"],"reconcile.unexplained_effect":["observer","kind","host","port"]},"values":{"capture.gap":{"kind":["decided_not_completed","late_activity","concurrent_run","tailer_redelegated","reask_after_reject","held_call_unresolved","observer_lost","effect_outside_run"]},"run.closing":{"reason":["quarantine"]}}},"1.3.0":{"types":["reconcile.result_mismatch"],"fields":{},"values":{"capture.gap":{"kind":["result_unchecked"]}}},"1.4.0":{"types":["constraint.added"],"fields":{"effect.observed":["sensor","denied"],"review":["cites"],"model.exchange":["said_only"],"capture.gap":["sensor"]},"values":{"capture.gap":{"kind":["constraint_refused"]}},"ext":["amended","openshell.policy"],"layout":["run parts"]},"1.6.0":{"types":[],"fields":{},"values":{"ext":{"self_approved":[true]}},"ext":["box","grant","intent.grant","intent.revoked"]},"1.8.0":{"types":["run.label","run.writer","playbook.entry","precedent.revoked","approver.enabled","approver.switched"],"fields":{"policy.decision":["run_labels"],"run.registered":["caller"],"approval.request":["ai"],"approval.revoked":["person"],"approval":["relied_on","run_clean"],"approval.suggested":["relied_on"],"approval.escalated":["relied_on"]},"values":{},"ext":["approval.decision"]}};
1189
1792
 
1190
1793
 
1191
1794
  /** This verifier's release (the package's). */
1192
- const VERSION = "1.7.3";
1795
+ const VERSION = "1.8.0";
1193
1796
  /** The newest bundle format version this verifier reads: the reference's VERSIONS' newest row (tracekit/bundle_v2.py),
1194
1797
  * or VERSION when later (tracekit/verify/v2.py READS); a bundle needing a later one is UNVERIFIABLE. */
1195
- const READS = "1.7.3";
1798
+ const READS = "1.8.0";
1196
1799
  /** The browser verifier of the latest release (docs/RELEASING.md). */
1197
1800
  const PAGE = "https://cygnux-labs.github.io/Tracekit/verify/";
1198
1801
  const EXIT_OK = 0, EXIT_FAIL = 1, EXIT_BAD = 2, EXIT_WARN = 3;
@@ -1322,15 +1925,6 @@ const extend = (to, xs) => {
1322
1925
  for (const x of xs)
1323
1926
  to.push(x);
1324
1927
  };
1325
- /** Python's order of strings, by code point (JavaScript's `<` and sort() compare UTF-16 code units, which put a
1326
- * character above U+FFFF before one in U+E000..U+FFFF). */
1327
- const byCodePoint = (a, b) => {
1328
- const unit = (u) => u >= 0xd800 && u < 0xe000 ? u + 0x2000 : u >= 0xe000 ? u - 0x800 : u;
1329
- for (let i = 0; i < Math.min(a.length, b.length); i++)
1330
- if (a.charCodeAt(i) !== b.charCodeAt(i))
1331
- return unit(a.charCodeAt(i)) - unit(b.charCodeAt(i));
1332
- return a.length - b.length;
1333
- };
1334
1928
  const byKey = ([a], [b]) => byCodePoint(a, b);
1335
1929
  const count = (xs) => {
1336
1930
  const m = new Map();
@@ -1353,7 +1947,7 @@ async function loadTrust(data, name) {
1353
1947
  const opt = (o, k) => Object.hasOwn(o, k) ? o[k] : [];
1354
1948
  const r = isObj(t) ? get(t, "rekor", {}) : null;
1355
1949
  const ok = isObj(t) && Object.keys(t).every((k) => ["logs", "witnesses", "algs", "witnesses_required", "rekor",
1356
- "monitors", "issuers", "analyzers"].includes(k))
1950
+ "monitors", "issuers", "analyzers", "policies"].includes(k))
1357
1951
  && isObj(r) && (!Object.keys(r).length || exactly(r, ["trusted_root", "publishing_key", "class"])
1358
1952
  && isObj(r.trusted_root) && typeof r.publishing_key === "string" && CLASSES.includes(r.class))
1359
1953
  && strings(t.logs)
@@ -1365,10 +1959,19 @@ async function loadTrust(data, name) {
1365
1959
  && Array.isArray(opt(t, "issuers")) && opt(t, "issuers").every((i) => exactly(i, ["vkey", "issuance_log_vkey"])
1366
1960
  && Object.values(i).every((v) => typeof v === "string"))
1367
1961
  && Array.isArray(opt(t, "analyzers"))
1368
- && opt(t, "analyzers").every((a) => typeof a === "string" && /^[a-z0-9_]+:[^\n]+$/.test(a));
1962
+ && opt(t, "analyzers").every((a) => typeof a === "string" && /^[a-z0-9_]+:[^\n]+$/.test(a))
1963
+ && Array.isArray(opt(t, "policies")) && opt(t, "policies").every((x) => typeof x === "string");
1369
1964
  if (!ok)
1370
1965
  throw new ValueError(`${name}: not a v2 trust config (logs, witnesses, algs, witnesses_required, rekor, monitors, `
1371
- + "issuers, analyzers)");
1966
+ + "issuers, analyzers, policies)");
1967
+ const known = new Map(); // `policies`: each compiled policy's text, by its policy_hash
1968
+ for (const text of opt(t, "policies")) {
1969
+ const bytes = new TextEncoder().encode(text);
1970
+ if (/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/.test(text)
1971
+ || !isObj(strictParseBytes(bytes, new WeakMap())))
1972
+ throw new ValueError(`${name}: a policies entry is not a compiled policy (a JSON object's text)`);
1973
+ known.set(`sha256:${await sha256hex(bytes)}`, bytes);
1974
+ }
1372
1975
  for (const k of [...t.logs, ...opt(t, "witnesses").map((w) => w.vkey), ...opt(t, "monitors").map((m) => m.vkey),
1373
1976
  ...opt(t, "issuers").flatMap((i) => Object.values(i))]) {
1374
1977
  try {
@@ -1399,6 +2002,7 @@ async function loadTrust(data, name) {
1399
2002
  t.witnesses_required ??= 0;
1400
2003
  t.issuers ??= [];
1401
2004
  t.analyzers ??= [];
2005
+ t.policies = known;
1402
2006
  return t;
1403
2007
  }
1404
2008
  /** `s` as one shell argument, as the reference quotes it (shlex.quote; on Windows subprocess.list2cmdline). */
@@ -1434,7 +2038,8 @@ async function verify(bundle, trust, names = { bundle: "BUNDLE", trust: "TRUST.j
1434
2038
  const rep = new Report();
1435
2039
  let t, files, manifest, v1 = false;
1436
2040
  if (trust === null) {
1437
- t = { logs: [], witnesses: [], algs: ["ed25519"], witnesses_required: 0, issuers: [], analyzers: [] };
2041
+ t = { logs: [], witnesses: [], algs: ["ed25519"], witnesses_required: 0, issuers: [], analyzers: [],
2042
+ policies: new Map() };
1438
2043
  rep.check("trust config", false, "none: the checkpoint's signature and its witnesses are not checked, so nothing ties "
1439
2044
  + "these records to a signer you trust", [], true);
1440
2045
  }
@@ -1710,6 +2315,9 @@ async function check(rep, manifest, files, trust, floats) {
1710
2315
  if (p === `policies/${hex}.json`)
1711
2316
  policies.set(`sha256:${hex}`, file(p));
1712
2317
  }
2318
+ for (const [h, data] of trust.policies)
2319
+ if (!policies.has(h))
2320
+ policies.set(h, data); // and the trust config's
1713
2321
  const open = [...runs.values()].filter((rs) => get(rs.at(-1).event, "type") !== "run.final");
1714
2322
  rep.integrity = !open.length ? "VERIFIED" : only ? `VERIFIED TO HEAD ${str(get(open[0].at(-1).event, "run_seq"))} (open)`
1715
2323
  : `VERIFIED (${open.length} run(s) open)`;
@@ -1717,6 +2325,8 @@ async function check(rep, manifest, files, trust, floats) {
1717
2325
  // a grant the run's own user issued (intent.grant) approves the calls it releases: a self-approval too
1718
2326
  const selfApproved = [...typed("approval"), ...typed("ext").filter((e) => get(at(e, "data"), "name") === "intent.grant")]
1719
2327
  .some((e) => get(at(e, "data"), "self_approved") === true);
2328
+ // a label the run's own user cleared on a dev signer: who that is can be the agent, as for a self-approval
2329
+ const selfCleared = typed("run.label").some((e) => get(at(e, "data"), "self_cleared") === true);
1720
2330
  const gaps = (k) => typed("capture.gap").filter((e) => get(at(e, "data"), "kind") === k)
1721
2331
  .map((e) => `seq ${e.seq}: ${cut(str(get(e.data, "reason")), 200)}`);
1722
2332
  const against = gaps("executed_against_policy");
@@ -1781,6 +2391,7 @@ async function check(rep, manifest, files, trust, floats) {
1781
2391
  checkReviews(rep, runs, trust.analyzers);
1782
2392
  checkConstraints(rep, runs);
1783
2393
  checkIncidents(rep, runs, policies, floats);
2394
+ checkLabels(rep, runs, policies, floats);
1784
2395
  const accessed = typed("content.accessed").length, erased = typed("content.erased").length;
1785
2396
  if (accessed || erased) // signer records of the content vault (docs/privacy.md): who read or erased retained content
1786
2397
  rep.check("content vault", true, `${accessed} access(es), ${erased} erasure(s) of retained content, each signed by the signer`);
@@ -1843,9 +2454,10 @@ async function check(rep, manifest, files, trust, floats) {
1843
2454
  rep.check("key assurance", true, "asserted: the log declares its record keys; none is attested");
1844
2455
  const algs = new Set([...every, ...keyRecords].map((r) => text(at(r, "alg"))));
1845
2456
  rep.assurance = !anchored ? "none: no trust config pins a log key or witness"
1846
- : await assurance(origin, cosigs, witnesses, trust, algs, selfApproved, regCosigs)
2457
+ : await assurance(origin, cosigs, witnesses, trust, algs, selfApproved, regCosigs, selfCleared)
1847
2458
  + (provenTo < relied ? "; key retirements not proven complete" : "");
1848
2459
  approvals(rep, runs, policies, floats);
2460
+ aiApprovals(rep, runs, policies, floats);
1849
2461
  const glass = typed("approval").filter((e) => get(at(e, "data"), "break_glass") === true);
1850
2462
  if (glass.length)
1851
2463
  rep.check("break-glass approvals", false, `${glass.length} approval(s) answered under the break-glass role`, glass.map((e) => `seq ${e.seq}: ${str(at(e.data, "decision"))} ${str(get(e.data, "approval_id"))} by `
@@ -2263,13 +2875,50 @@ async function checkGrants(rep, events, floats) {
2263
2875
  + `T2, decided and run by an executor or gateway; ${tiers.T1} at T1, on the arguments the harness reported), each `
2264
2876
  + "re-checked against its grant and its running totals", [...broken, ...bad].slice(0, 20), !broken.length);
2265
2877
  }
2878
+ /**
2879
+ * ext.approval.decision (1.8.0): each approval.consumed names a policy.decision of its own run, tool_call_id and attempt
2880
+ * that comes before it. The signer writes the decision it checked the approval's use against; the check is a warning,
2881
+ * not a failure, when the bundle doesn't hold it (an ext name is non-critical).
2882
+ */
2883
+ function checkApprovalDecision(rep, events) {
2884
+ const decisions = new Map(), at = (v) => typeof v === "number" ? v : 0;
2885
+ const key = (e, id) => JSON.stringify([get(e, "run_id"), id]);
2886
+ for (const e of events) {
2887
+ const d = get(e, "data");
2888
+ if (get(e, "type") === "policy.decision" && isObj(d) && typeof d.decision_id === "string")
2889
+ decisions.set(key(e, d.decision_id), [...(decisions.get(key(e, d.decision_id)) ?? []), e]);
2890
+ }
2891
+ let n = 0;
2892
+ const bad = [];
2893
+ for (const e of events) {
2894
+ if (!extNames(e).includes("approval.decision"))
2895
+ continue;
2896
+ n++;
2897
+ if (get(e, "type") !== "approval.consumed") {
2898
+ bad.push(e);
2899
+ continue;
2900
+ }
2901
+ const ext = isObj(get(e, "ext")) ? e.ext : {};
2902
+ const did = ext["approval.decision"];
2903
+ const before = typeof did === "string" ? (decisions.get(key(e, did)) ?? [])
2904
+ .filter((d) => at(get(d, "run_seq")) < at(get(e, "run_seq"))) : [];
2905
+ if (typeof did !== "string" || !before.some((d) => (get(d, "tool_call_id") ?? get(get(d, "data"), "tool_use_id")) === get(e, "tool_call_id")
2906
+ && at(get(d, "attempt")) === at(get(e, "attempt"))))
2907
+ bad.push(e);
2908
+ }
2909
+ if (n)
2910
+ rep.check("approval decision", bad.length === 0, bad.length === 0 ? `${n} record(s) name a policy.decision of their run, call id and attempt before them`
2911
+ : `the record(s) at seq ${bad.slice(0, 5).map((e) => str(get(e, "seq"))).join(", ")} carry `
2912
+ + "ext.approval.decision without naming a policy.decision of their run, call id and attempt before it", [], true);
2913
+ }
2266
2914
  /**
2267
2915
  * The ext names this verifier interprets (the VERSIONS rows' "ext" in tracekit/bundle_v2.py): name -> its check, whose
2268
2916
  * lines are its own: every other line of the report reads the same without them (docs/format-v2.md §9). Names that
2269
2917
  * share a check are read together, once: a grant, its revocation and the calls it released.
2270
2918
  */
2271
2919
  const EXT_CHECKS = new Map([["amended", checkAmended], ["openshell.policy", checkOpenshellPolicy],
2272
- ["box", checkBox], ["intent.grant", checkGrants], ["intent.revoked", checkGrants], ["grant", checkGrants]]);
2920
+ ["box", checkBox], ["approval.decision", checkApprovalDecision], ["intent.grant", checkGrants],
2921
+ ["intent.revoked", checkGrants], ["grant", checkGrants]]);
2273
2922
  const MAX_UNREAD = 20; // `not interpreted` lines, one per ext name; the rest on one line
2274
2923
  /** A run's problems past which its later records go unchecked: forged records cost a verifier little. */
2275
2924
  const RUN_PROBLEMS = 20;
@@ -2340,8 +2989,10 @@ async function checkExt(rep, events, full, floats) {
2340
2989
  ? `; tracekit >= ${full} checks it` : "";
2341
2990
  let shown = 0, more = 0;
2342
2991
  const done = new Set();
2343
- // records a check reads beside its names' own: the decisions TK-GRANT names, ext.grant or not
2344
- const also = new Map([[checkGrants, events.filter(tkGrant)]]);
2992
+ // records a check reads beside its names' own: the decisions TK-GRANT names, ext.grant or not; the decisions
2993
+ // ext.approval.decision names
2994
+ const also = new Map([[checkGrants, events.filter(tkGrant)],
2995
+ [checkApprovalDecision, events.filter((e) => get(e, "type") === "policy.decision")]]);
2345
2996
  const run = async (f) => {
2346
2997
  done.add(f);
2347
2998
  await f(rep, [...new Set([...[...carry].filter(([k]) => EXT_CHECKS.get(k) === f).flatMap(([, v]) => v),
@@ -2425,11 +3076,15 @@ function approvals(rep, runs, policies, floats) {
2425
3076
  + "bundles the policies its records cite");
2426
3077
  continue;
2427
3078
  }
2428
- let asks, flags;
3079
+ let asks, flags, listed, parseAsks;
2429
3080
  try {
2430
3081
  const pol = strictParseBytes(snap, floats);
2431
3082
  asks = new Map(list(get(pol, "ask", [])).map((r) => [at(r, "id"), r]));
2432
3083
  flags = new Set(list(get(pol, "flag", [])).map((r) => at(r, "id")));
3084
+ if (get(pol, "unknown_tools") === "flag")
3085
+ flags.add("TK-UNKNOWN-TOOL");
3086
+ listed = new Set(list(get(get(pol, "approval_agent") ?? {}, "rules") ?? []).filter((r) => APPROVER_RULES.includes(r)));
3087
+ parseAsks = get(pol, "on_parse_error", "ask") === "ask";
2433
3088
  }
2434
3089
  catch {
2435
3090
  problems.push(`${where}: the policy snapshot is not a policy`);
@@ -2437,7 +3092,10 @@ function approvals(rep, runs, policies, floats) {
2437
3092
  }
2438
3093
  for (const rid of get(dec, "rule_ids") ?? []) {
2439
3094
  const approval = get(asks.get(rid) ?? {}, "approval") ?? {};
2440
- if (!flags.has(rid) && (!isObj(approval) || !has(approval, "agent") || approval.passkey === "required"))
3095
+ // an AI approver's rule: one the policy's approval_agent lists (from the reviewed list), held as an ask there,
3096
+ // or TK-SHELL-PARSE where on_parse_error asks
3097
+ const ai = listed.has(rid) && (asks.has(rid) || rid === "TK-SHELL-PARSE" && parseAsks) && has(req, "ai");
3098
+ if (!flags.has(rid) && !ai && (!isObj(approval) || !has(approval, "agent") || approval.passkey === "required"))
2441
3099
  problems.push(`${where}: rule ${cut(str(rid), 64)} does not permit agents`);
2442
3100
  }
2443
3101
  }
@@ -2449,6 +3107,164 @@ function approvals(rep, runs, policies, floats) {
2449
3107
  + "by agents (model output); argument bounds are not checkable offline (salted commitments): audit one with "
2450
3108
  + "`tracekit signer reveal`" + (unchecked.length ? `; agent approval bounds unchecked for ${unchecked.length}` : ""), `${agents} approval(s) answered by agents`), (problems.length ? problems : unchecked).slice(0, 20), !problems.length);
2451
3109
  }
3110
+ /** The rules an operator's approval_agent may list (tracekit/policy2/compile.py APPROVER_RULES). */
3111
+ const APPROVER_RULES = ["TK-SHELL-PARSE", "TK-A062", "TK-A025"];
3112
+ /** How long a person's answer counts as a precedent (tracekit/signer/pipeline.py PRECEDENT_S). */
3113
+ const PRECEDENT_S = 30 * 86400;
3114
+ /**
3115
+ * The AI approver's records (docs/approvals.md#the-ai-approver), on a line of their own when the bundle has any: the
3116
+ * `ai` of approval requests, what AI answers relied on (`relied_on`), and its playbook, precedent and circuit-breaker
3117
+ * records. An AI yes that decided (an agent's `approval` that approves, of a request with `ai`) carries `relied_on`
3118
+ * with mode enforce, two answers that approve and a person's precedent, the request's policy hash, and no person's
3119
+ * rejection of a call like it; with the snapshot of the policy it names, none of the labels its run carried is one the
3120
+ * policy's approval_agent run bound names: those the signer says it read (`relied_on.labels`) and those the run's own
3121
+ * run.label records add and clear, replayed up to the yes and up to its consume. That is checked on a line of its own,
3122
+ * `AI run bound`, when any AI yes had a label either way, which also fails when the bundle has no readable snapshot of
3123
+ * the policy such a yes cites (a bundle can leave a snapshot out, never its signed records; a snapshot whose
3124
+ * approval_agent.run isn't an object can't be read). A precedent it names, when the bundle holds it, and any person's rejection the bundle holds of a call like it,
3125
+ * count as the signer counts them: a person's own answer (not a self-approval, not break-glass) to a request with the
3126
+ * same precedent key (its digest), tenant and requester, made in a run clean when asked and when answered (run_clean),
3127
+ * before the answer and at most PRECEDENT_S before it, not revoked as a precedent (precedent.revoked) before it. A
3128
+ * named precedent that doesn't count, or a rejection that does, fails the line; a named precedent the bundle doesn't
3129
+ * hold (often another run's) is counted, not checked.
3130
+ */
3131
+ /**
3132
+ * The run bound (approval_agent.run.clean) of policy snapshot `snap`: [] when the policy has no approval_agent; null
3133
+ * when there is no snapshot or it can't be read, `run` included (not an object, its `clean` not a list of strings).
3134
+ */
3135
+ function runBound(snap, floats) {
3136
+ let aa;
3137
+ try {
3138
+ if (!snap)
3139
+ return null;
3140
+ aa = get(strictParseBytes(snap, floats), "approval_agent") ?? null;
3141
+ }
3142
+ catch {
3143
+ return null;
3144
+ }
3145
+ if (aa !== null && !isObj(aa))
3146
+ return null;
3147
+ const run = aa !== null && has(aa, "run") ? aa.run : {};
3148
+ const clean = isObj(run) ? (has(run, "clean") ? run.clean : []) : null;
3149
+ return Array.isArray(clean) && clean.every((c) => typeof c === "string") ? clean : null;
3150
+ }
3151
+ function aiApprovals(rep, runs, policies, floats) {
3152
+ const events = [...runs.values()].flatMap((rs) => rs.map((r) => r.event)).sort((a, b) => a.seq - b.seq);
3153
+ const asked = new Map(), answered = new Map(), gone = new Map(), broken = [];
3154
+ const boundBroken = [];
3155
+ let yes = 0, shadow = 0, checked = 0, outside = 0, changes = 0, labelled = 0;
3156
+ const key = (tenant, id) => JSON.stringify([tenant ?? null, id ?? null]);
3157
+ // the labels each run's records add and clear, as of each record of note
3158
+ const carried = new Map(), held = new Map();
3159
+ const consumed = new Map();
3160
+ for (const e of events) {
3161
+ const d = e.data, k = key(get(e, "tenant"), get(d, "approval_id"));
3162
+ const rk = key(get(e, "tenant"), get(e, "run_id"));
3163
+ if (!carried.has(rk))
3164
+ carried.set(rk, new Set());
3165
+ const have = carried.get(rk);
3166
+ if (e.type === "run.label" && typeof get(d, "label") === "string") {
3167
+ if (get(d, "action") === "add")
3168
+ have.add(d.label);
3169
+ else
3170
+ have.delete(d.label);
3171
+ }
3172
+ else if (e.type === "approval")
3173
+ held.set(e.seq, new Set(have));
3174
+ else if (e.type === "approval.consumed" && !consumed.has(k))
3175
+ consumed.set(k, new Set(have));
3176
+ if (e.type === "approval.request" && has(d, "ai"))
3177
+ asked.set(k, e);
3178
+ else if (e.type === "approval" && get(d, "approver_kind") !== "agent")
3179
+ answered.set(k, e);
3180
+ else if (["playbook.entry", "precedent.revoked", "approver.enabled", "approver.switched"].includes(e.type)) {
3181
+ changes++;
3182
+ if (e.type === "precedent.revoked" && !gone.has(k))
3183
+ gone.set(k, e.seq);
3184
+ }
3185
+ }
3186
+ const when = (e) => Date.parse(e.ts) / 1000;
3187
+ /** Why person's answer `p` (to request `pa`) doesn't count as a precedent at AI answer `e`, or null. */
3188
+ const discounted = (p, pa, e) => p.data.self_approved ? "was self-approved"
3189
+ : p.data.break_glass ? "was a break-glass answer"
3190
+ : !(pa.data.ai.clean && p.data.run_clean === true) ? "was made in a run that wasn't clean"
3191
+ : p.seq > e.seq ? "came after the answer"
3192
+ : when(e) - when(p) > PRECEDENT_S ? `is more than ${PRECEDENT_S / 86400} days older than the answer`
3193
+ : (gone.get(key(get(e, "tenant"), p.data.approval_id)) ?? e.seq) < e.seq
3194
+ ? "was revoked as a precedent before the answer" : null;
3195
+ for (const e of events) {
3196
+ const d = e.data;
3197
+ if (e.type === "approval.suggested" && has(d, "relied_on"))
3198
+ shadow++;
3199
+ if (!(e.type === "approval" && get(d, "approver_kind") === "agent" && get(d, "decision") === "approve"))
3200
+ continue;
3201
+ const mine = asked.get(key(get(e, "tenant"), get(d, "approval_id")));
3202
+ if (mine === undefined)
3203
+ continue; // an agent approver bounded by argument fields, or a request outside the bundle
3204
+ yes++;
3205
+ const where = `seq ${e.seq}`, x = get(d, "relied_on");
3206
+ if (x === undefined || x.mode !== "enforce"
3207
+ || JSON.stringify((x.answers ?? []).map((a) => a.decision)) !== JSON.stringify(["approve", "approve"])) {
3208
+ broken.push(`${where}: an AI yes that decided without two answers that approve`);
3209
+ continue;
3210
+ }
3211
+ if (!x.precedents.approve.length || x.precedents.reject.length)
3212
+ broken.push(`${where}: an AI yes without a person's precedent, or with a person's rejection of a call like it`);
3213
+ if (x.policy_hash !== mine.data.policy_hash)
3214
+ broken.push(`${where}: an AI yes that cites policy ${x.policy_hash}, not the one its call was held under`);
3215
+ // the run bound of the policy it cites decides whether the labels the run carried let it answer: those the signer
3216
+ // read, and those the run's own records held at the yes and at its consume
3217
+ const ways = [["that carried {}", new Set(x.labels)],
3218
+ ["whose records held {} at the yes", held.get(e.seq)],
3219
+ ["whose records held {} at its consume", consumed.get(key(get(e, "tenant"), get(d, "approval_id"))) ?? new Set()]];
3220
+ if (ways.some(([, ls]) => ls.size)) {
3221
+ labelled++;
3222
+ const bound = runBound(policies.get(x.policy_hash), floats);
3223
+ if (bound === null) {
3224
+ const had = [...new Set(ways.flatMap(([, ls]) => [...ls]))].sort().join(", ");
3225
+ boundBroken.push(`${where}: an AI yes in a run that carried ${had}, under policy ${x.policy_hash}, whose `
3226
+ + "snapshot the bundle doesn't hold (or can't be read): export the run with its policy snapshots");
3227
+ }
3228
+ else {
3229
+ for (const [how, ls] of ways) {
3230
+ const met = [...ls].filter((l) => bound.includes(l)).sort();
3231
+ if (met.length)
3232
+ boundBroken.push(`${where}: an AI yes in a run ${how.replace("{}", met[0])}, which the `
3233
+ + "policy's run bound names");
3234
+ }
3235
+ }
3236
+ }
3237
+ for (const pid of x.precedents.approve) {
3238
+ const k = key(get(e, "tenant"), pid), p = answered.get(k), pa = asked.get(k);
3239
+ if (p === undefined || pa === undefined) {
3240
+ outside++;
3241
+ continue;
3242
+ }
3243
+ checked++;
3244
+ const why = p.data.decision !== "approve" ? "is no person's approval"
3245
+ : pa.data.ai.digest !== mine.data.ai.digest ? "is of another kind of call"
3246
+ : pa.data.requester !== mine.data.requester ? "is another requester's" : discounted(p, pa, e);
3247
+ if (why)
3248
+ broken.push(`${where}: precedent ${cut(str(pid), 64)} ${why}`);
3249
+ }
3250
+ for (const [k, p] of answered) { // a rejection that counted, named or not
3251
+ const pa = asked.get(k), [tenant, pid] = JSON.parse(k);
3252
+ if (tenant === (get(e, "tenant") ?? null) && pa !== undefined && p.data.decision === "reject"
3253
+ && pa.data.ai.digest === mine.data.ai.digest && pa.data.requester === mine.data.requester
3254
+ && discounted(p, pa, e) === null)
3255
+ broken.push(`${where}: a person's rejection of a call like it (${cut(str(pid), 64)}) counted when the AI said yes`);
3256
+ }
3257
+ }
3258
+ if (!asked.size && !shadow && !changes)
3259
+ return; // a bundle without the AI approver keeps the report it always had
3260
+ rep.check("AI approvals", !broken.length, `${yes} AI approval(s) that decided, each with two answers that agree and a `
3261
+ + `person's precedent (${checked} precedent(s) checked in this bundle, ${outside} in runs it doesn't hold); ${shadow} `
3262
+ + `shadow suggestion(s); ${changes} switch, playbook, precedent and circuit-breaker record(s)`, broken.slice(0, 20));
3263
+ if (labelled) {
3264
+ rep.check("AI run bound", !boundBroken.length, `${labelled} AI approval(s) in a run that carried a label, each read `
3265
+ + "against the run bound of the policy snapshot it cites", boundBroken.slice(0, 20));
3266
+ }
3267
+ }
2452
3268
  const CONTAINMENT = ["incident.opened", "incident.updated", "run.held", "run.quarantined", "run.resumed"];
2453
3269
  const FIRES = ["policy.decision", "approval.consumed", "capture.gap", "trace.tamper", "refusal.summary",
2454
3270
  "reconcile.unexplained_effect"];
@@ -2668,6 +3484,59 @@ function checkIncidents(rep, runs, policies, floats) {
2668
3484
  + "signer-asserted, not recomputed (export the run with the signer's config, which bundles the policies its "
2669
3485
  + "records cite)", [...unbundled].sort(byCodePoint).slice(0, 20), true);
2670
3486
  }
3487
+ /** The `run labels` line, as verify/v2.py's _labels: each run's labels replayed under the compiled policies of the
3488
+ * policy_hashes its decisions name (the bundle's or the trust config's), each record under its own; an inherited one
3489
+ * signer-asserted; a `label policies` warning for each policy a decision names that neither carries. */
3490
+ function checkLabels(rep, runs, policies, floats) {
3491
+ let problems = [];
3492
+ const unbundled = new Set(), inherited = [], budget = new Budget();
3493
+ const refused = new Map(); // what verify/v2.py's _labels refuses, by policy and rule
3494
+ let checked = 0, asserted = 0;
3495
+ for (const rs of runs.values()) {
3496
+ const events = rs.map((r) => r.event).filter((e) => isObj(e) && isObj(e.data));
3497
+ const marked = events.some((e) => e.type === "run.label" || e.type === "policy.decision"
3498
+ && Object.hasOwn(e.data, "run_labels"));
3499
+ const hashes = new Set(events.filter((e) => e.type === "policy.decision" && Object.hasOwn(e.data, "policy_hash"))
3500
+ .map((e) => str(e.data.policy_hash)));
3501
+ for (const h of hashes)
3502
+ if (!policies.has(h))
3503
+ unbundled.add(cut(h, 80));
3504
+ if (!hashes.size || [...hashes].some((h) => !policies.has(h))) {
3505
+ if (marked)
3506
+ asserted++;
3507
+ continue;
3508
+ }
3509
+ const srcs = new Map([...hashes].sort(byCodePoint).map((h) => [h, new Sources(strictParseBytes(policies.get(h), floats))]));
3510
+ for (const [h, src] of srcs)
3511
+ for (const rid of src.refused.keys())
3512
+ refused.set(JSON.stringify([cut(h, 80), cut(str(rid), 64)]), [cut(h, 80), cut(str(rid), 64)]);
3513
+ if (marked || [...srcs.values()].some((src) => src.tracked.size)) {
3514
+ checked++;
3515
+ try {
3516
+ extend(problems, runLabels(events, srcs, inherited, budget));
3517
+ }
3518
+ catch (e) {
3519
+ if (!(e instanceof Spent))
3520
+ throw e;
3521
+ problems.push(`${e.message}: the rest of the bundle's runs weren't replayed`);
3522
+ break;
3523
+ }
3524
+ }
3525
+ }
3526
+ problems = [...refused.values()].sort(([a, b], [c, d]) => byCodePoint(a, c) || byCodePoint(b, d))
3527
+ .map(([h, rid]) => `policy ${h}: ${rid} reads the labels with a pattern the signer would refuse (outside the RE2 `
3528
+ + "subset check_pattern accepts, or too large): not replayed").concat(problems);
3529
+ if (checked || asserted)
3530
+ rep.check("run labels", !problems.length, found(problems, `${checked} run(s) replayed under their policies, `
3531
+ + `${asserted} signer-asserted (under a policy not in the bundle)`
3532
+ + (inherited.length ? `; ${inherited.length} label(s) inherited from another run of the requester, `
3533
+ + "signer-asserted (that run's bundle shows its add)" : ""), "run labels"), problems.slice(0, 20));
3534
+ if (unbundled.size)
3535
+ rep.check("label policies", false, `${unbundled.size} policy(ies) neither in the bundle nor the trust config: the `
3536
+ + "labels of the runs decided under them are signer-asserted, not replayed, so one a signer left out wouldn't "
3537
+ + "show (export the run with the signer's config, which bundles the policies its records cite, or add the "
3538
+ + "policy's text to the trust config's `policies`)", [...unbundled].sort(byCodePoint).slice(0, 20), true);
3539
+ }
2671
3540
  /** The problems of one run's records with the holds and quarantines they record (verify/v2.py's _honoured). */
2672
3541
  function honoured(events, pointers) {
2673
3542
  const problems = [], flight = new Set(), asked = new Map(), consumed = new Set();
@@ -2929,14 +3798,14 @@ function level(cosigs, witnesses, trust) {
2929
3798
  }
2930
3799
  /** dev: no pinned witness cosigned, or a self-approval in the run; local: only operator-run ones; witnessed: enough
2931
3800
  * independent ones. A run-set's registry notes cap the level by the same rule. */
2932
- async function assurance(origin, cosigs, witnesses, trust, algs, selfApproved, registryNotes) {
3801
+ async function assurance(origin, cosigs, witnesses, trust, algs, selfApproved, registryNotes, selfCleared = false) {
2933
3802
  let hybrid = false;
2934
3803
  for (const k of trust.logs) {
2935
3804
  const p = await parseVkey(k);
2936
3805
  hybrid ||= p.name === origin && p.type === HYBRID;
2937
3806
  }
2938
3807
  const times = cosigs.filter(([k]) => witnesses.get(k) !== "operator").map(([, ts]) => ts);
2939
- let lvl = selfApproved ? "dev" : level(cosigs, witnesses, trust);
3808
+ let lvl = selfApproved || selfCleared ? "dev" : level(cosigs, witnesses, trust);
2940
3809
  let capped = registryNotes.map((c) => level(c, witnesses, trust))
2941
3810
  .reduce((a, b) => LEVELS.indexOf(b) < LEVELS.indexOf(a) ? b : a, "witnessed");
2942
3811
  if (LEVELS.indexOf(capped) < LEVELS.indexOf(lvl))
@@ -2948,7 +3817,8 @@ async function assurance(origin, cosigs, witnesses, trust, algs, selfApproved, r
2948
3817
  return `${lvl}; records ${[...algs].sort(byCodePoint).join("+")}; checkpoint ${hybrid ? "Ed25519 + SLH-DSA-SHA2-128s" : "Ed25519 only"} `
2949
3818
  + `(${origin})` + (cosigned ? `; cosigned ed25519 by ${cosigned}` : "; no witness cosignature")
2950
3819
  + (times.length ? `; earliest independent anchor ${fmt(times.reduce((a, b) => b < a ? b : a))}` : "")
2951
- + (capped ? `; capped by the run-set's registry notes (${capped})` : "") + (selfApproved ? "; approvals: self" : "");
3820
+ + (capped ? `; capped by the run-set's registry notes (${capped})` : "") + (selfApproved ? "; approvals: self" : "")
3821
+ + (selfCleared ? "; labels: self-cleared" : "");
2952
3822
  }
2953
3823
  /** `x` without control characters and the bidirectional and zero-width format characters that would reorder or hide
2954
3824
  * the text around them, as the report prints bundle-derived strings. */
@@ -2969,7 +3839,7 @@ function formatReport(rep) {
2969
3839
  + (rep.findings ? `Findings: ${clean(rep.findings)}.\n` : "");
2970
3840
  }
2971
3841
 
2972
- return { EXIT_BAD, EXIT_FAIL, EXIT_OK, EXIT_WARN, NOT_RATED, READS, Report, TRUST_UNUSABLE, VERSION, assuranceLine, checkExt, checkGrants, clean, formatReport, runFiles, verify, verifyRecord, MAX_ENTRIES: __zip.MAX_ENTRIES, MAX_ENTRY: __zip.MAX_ENTRY, MAX_TOTAL: __zip.MAX_TOTAL, Unusable: __zip.Unusable, readZip: __zip.readZip, StrictJSONError: __jcs.StrictJSONError, canonicalize: __jcs.canonicalize, strictParse: __jcs.strictParse, strictParseBytes: __jcs.strictParseBytes };
3842
+ return { APPROVER_RULES, EXIT_BAD, EXIT_FAIL, EXIT_OK, EXIT_WARN, NOT_RATED, PRECEDENT_S, READS, Report, TRUST_UNUSABLE, VERSION, assuranceLine, checkApprovalDecision, checkExt, checkGrants, clean, formatReport, runFiles, verify, verifyRecord, MAX_ENTRIES: __zip.MAX_ENTRIES, MAX_ENTRY: __zip.MAX_ENTRY, MAX_TOTAL: __zip.MAX_TOTAL, Unusable: __zip.Unusable, readZip: __zip.readZip, StrictJSONError: __jcs.StrictJSONError, canonicalize: __jcs.canonicalize, strictParse: __jcs.strictParse, strictParseBytes: __jcs.strictParseBytes };
2973
3843
  })();
2974
3844
  const __explain = (() => {
2975
3845
  /**
@@ -3186,6 +4056,14 @@ const MEANING = {
3186
4056
  },
3187
4057
  "incident policies": { warn: "Policies an incident cites that aren't in the bundle: those incidents are the "
3188
4058
  + "signer's word." },
4059
+ "run labels": {
4060
+ pass: "What each run had done that its run conditions read (a secret read, untrusted content), replayed from its "
4061
+ + "records under its policy, and what it inherited from another run of the same requester.",
4062
+ fail: "A run label was added without a record that sets it, left out after one, or cleared by the run's own owner, "
4063
+ + "or a call was held under a label the run didn't carry.",
4064
+ },
4065
+ "label policies": { warn: "Policies runs were decided under that neither the bundle nor the trust config carries: "
4066
+ + "their labels are the signer's word, and one it left out wouldn't show." },
3189
4067
  "content vault": { pass: "Who read or erased retained content, as the signer recorded it." },
3190
4068
  "tiers": {
3191
4069
  pass: "Tool calls by how they were captured: T2 gateway or executor, T1 adapter, T3 import (receipt only).",
@@ -3210,6 +4088,20 @@ const MEANING = {
3210
4088
  + "lacks the policy they were held under.",
3211
4089
  fail: "An agent approved a call the rules for agent approvals don't let it approve.",
3212
4090
  },
4091
+ "AI approvals": {
4092
+ pass: "Held calls an AI approver answered, each yes with two model answers that agree and a person's earlier yes "
4093
+ + "to a call like it, checked where the bundle holds that yes.",
4094
+ fail: "An AI approver's yes decided a call without two answers that agree, without a person's earlier yes to a "
4095
+ + "call like it, with a person's rejection of a call like it, or on an earlier yes that doesn't hold: another "
4096
+ + "kind of call, a self-approval or break-glass answer, a run that wasn't clean, given after it or over 30 days "
4097
+ + "before it, or revoked before it.",
4098
+ },
4099
+ "AI run bound": {
4100
+ pass: "AI approvals in runs that carried a label (a secret read, say), each checked against the run bound of the "
4101
+ + "policy it was decided under: none of those labels closed the run to the AI approver.",
4102
+ fail: "An AI approver's yes in a run whose label the policy's run bound names, or one whose policy snapshot the "
4103
+ + "bundle doesn't hold, so nothing shows the run bound allowed it. Export with the policy snapshots.",
4104
+ },
3213
4105
  "break-glass approvals": { warn: "Approvals given under the break-glass role, with who and why." },
3214
4106
  "not interpreted": { warn: "Records carry an extension this verifier doesn't read. They verified like every other "
3215
4107
  + "record." },
@@ -3221,6 +4113,11 @@ const MEANING = {
3221
4113
  warn: "A record carries a gateway amendment where or how the signer never writes one. The record verified like "
3222
4114
  + "every other.",
3223
4115
  },
4116
+ "approval decision": {
4117
+ pass: "Each used approval names the decision it ran under: one of the same call and attempt, signed before the use.",
4118
+ warn: "A used approval names a decision the bundle doesn't hold before it, of another call or attempt, or no "
4119
+ + "decision at all: the signer never writes that. The record verified like every other.",
4120
+ },
3224
4121
  "openshell policy": {
3225
4122
  pass: "Changes of the sandbox's policy or configuration that NVIDIA OpenShell reported, signed into the run as "
3226
4123
  + "OpenShell's report.",