@agent-custody/receipts 0.15.0 → 0.16.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/README.md +29 -15
- package/dist/acs.d.ts +47 -0
- package/dist/acs.js +235 -0
- package/dist/addresses.d.ts +6 -0
- package/dist/addresses.js +90 -0
- package/dist/cli.js +67 -3
- package/dist/config.d.ts +70 -0
- package/dist/config.js +62 -0
- package/dist/egress-draft.d.ts +43 -0
- package/dist/egress-draft.js +153 -0
- package/dist/egress.d.ts +116 -0
- package/dist/egress.js +585 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +5 -0
- package/dist/log.js +8 -1
- package/dist/policy-rego.js +3 -1
- package/dist/portal.js +147 -41
- package/dist/receipt.d.ts +6 -2
- package/dist/simulate.js +1 -1
- package/dist/verify.js +30 -2
- package/docs/acs.md +107 -0
- package/docs/egress.md +177 -0
- package/docs/github-action.md +3 -3
- package/docs/policies.md +1 -1
- package/docs/threat-model.md +1 -1
- package/docs/tutorials.md +4 -0
- package/docs/verification.md +9 -2
- package/package.json +2 -2
- package/vectors/receipts.json +693 -0
package/dist/portal.js
CHANGED
|
@@ -577,7 +577,7 @@ export function portalHandler(o) {
|
|
|
577
577
|
};
|
|
578
578
|
const page = (status, title, body, headers = {}) => {
|
|
579
579
|
res.writeHead(status, { "content-type": "text/html; charset=utf-8", "cache-control": "no-store", "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'", ...headers });
|
|
580
|
-
res.end(
|
|
580
|
+
res.end(resultPage(title, `<p>${body}</p>`));
|
|
581
581
|
};
|
|
582
582
|
const esc = (v) => v.replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]);
|
|
583
583
|
const setCookie = (value) => `${cookieName}=${value ?? ""}; Path=/; HttpOnly; SameSite=Strict${o.trustProxy ? "; Secure" : ""}; Max-Age=${value ? 14 * 86_400 : 0}`;
|
|
@@ -590,7 +590,7 @@ export function portalHandler(o) {
|
|
|
590
590
|
// would not carry it. The page's own navigation to / does.
|
|
591
591
|
const signedInPage = (who, next, setCookies, lead) => {
|
|
592
592
|
res.writeHead(200, { "content-type": "text/html; charset=utf-8", "cache-control": "no-store", "set-cookie": setCookies, "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'" });
|
|
593
|
-
res.end(
|
|
593
|
+
res.end(resultPage("Signed in", `<p>${lead} ${esc(who)}. <a href="${next}">Continue</a>.</p>`, `<meta http-equiv="refresh" content="0;url=${next}">`));
|
|
594
594
|
};
|
|
595
595
|
const enforcedFor = async (id) => {
|
|
596
596
|
const t = await store.tenantOf(id);
|
|
@@ -754,7 +754,7 @@ export function portalHandler(o) {
|
|
|
754
754
|
// Opening the link proves nothing: an attacker may have registered the address, and its owner may click the link. Only the account's own session confirms it, through POST /api/verify-email.
|
|
755
755
|
const token = url.searchParams.get("token");
|
|
756
756
|
res.writeHead(200, { "content-type": "text/html; charset=utf-8", "cache-control": "no-store", "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; connect-src 'self'" });
|
|
757
|
-
return void res.end(
|
|
757
|
+
return void res.end(`${resultPage("Confirm your address", `<p id="m" aria-live="polite">Confirming ${esc(u.email)}...</p>`)}<script>
|
|
758
758
|
fetch("/api/verify-email", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ token: ${JSON.stringify(token).replace(/</g, "\\u003c")} }) }).then(async (r) => {
|
|
759
759
|
const b = await r.json().catch(() => ({}));
|
|
760
760
|
const m = document.getElementById("m");
|
|
@@ -1218,15 +1218,31 @@ export function servePortal(o, opts) {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
// ---- the page: one file, no framework, no outside requests ----
|
|
1220
1220
|
const FAVICON = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="14" fill="#b45309"/><path d="M19 11H45V45L41.75 48 38.5 45 35.25 48 32 45 28.75 48 25.5 45 22.25 48 19 45Z" fill="#fff"/><path d="M25 20h14M25 27h14" stroke="#b45309" stroke-width="2.6" stroke-linecap="round"/><path d="M25 37.5l5 4.5 9.5-10" fill="none" stroke="#b45309" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
1221
|
+
const MARK = '<svg class="mark" viewBox="0 0 64 64" aria-hidden="true"><rect class="tile" width="64" height="64" rx="14"/><path d="M19 11H45V45L41.75 48 38.5 45 35.25 48 32 45 28.75 48 25.5 45 22.25 48 19 45Z" fill="#fff"/><path class="ink" d="M25 20h14M25 27h14" stroke-width="2.6" stroke-linecap="round"/><path class="ink" d="M25 37.5l5 4.5 9.5-10" fill="none" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
1222
|
+
// The small pages outside the app (errors, results, the address check) share the brand without the app's script.
|
|
1223
|
+
const RESULT_STYLE = `<style>
|
|
1224
|
+
:root { color-scheme: light dark; --ink: #1b2430; --ink2: #5b6b7a; --line: #d7dfe5; --bg: #f5f7f9; --panel: #ffffff; --accent: #b45309; --accent-bg: #fbf1dc; }
|
|
1225
|
+
@media (prefers-color-scheme: dark) { :root { --ink: #e6ecf0; --ink2: #9fb0bd; --line: #27333c; --bg: #0e1418; --panel: #151d23; --accent: #f59e0b; --accent-bg: #2d2412; } }
|
|
1226
|
+
* { box-sizing: border-box; }
|
|
1227
|
+
body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 1.5rem .75rem; color: var(--ink); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; background-color: var(--bg); background-image: radial-gradient(56rem 26rem at 50% -8rem, var(--accent-bg), transparent 72%), radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink2) 20%, transparent) 1px, transparent 0); background-size: 100% 100%, 22px 22px; background-repeat: no-repeat, repeat; }
|
|
1228
|
+
main { position: relative; width: 100%; max-width: 27rem; padding: 2rem 2.25rem; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 18px 40px -18px rgb(0 0 0 / .25); }
|
|
1229
|
+
.brand { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.25rem; color: var(--ink); font-weight: 700; letter-spacing: .04em; text-decoration: none; }
|
|
1230
|
+
.mark { width: 28px; height: 28px; display: block; } .mark .tile { fill: var(--accent); } .mark .ink { stroke: var(--accent); }
|
|
1231
|
+
h1 { margin: 0 0 .5rem; font-size: 1.4rem; line-height: 1.25; letter-spacing: -.02em; }
|
|
1232
|
+
p { margin: 0; color: var(--ink2); overflow-wrap: anywhere; }
|
|
1233
|
+
a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; } a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
|
|
1234
|
+
@media (max-width: 30rem) { main { padding: 1.5rem 1.25rem; } }
|
|
1235
|
+
</style>`;
|
|
1236
|
+
const resultPage = (title, body, head = "") => `<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">${head}<title>${title}</title>${RESULT_STYLE}<main><a class="brand" href="/">${MARK}agent-custody</a><h1>${title}</h1>${body}</main>`;
|
|
1221
1237
|
const PORTAL_PAGE = `<!doctype html>
|
|
1222
1238
|
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1223
1239
|
<title>agent-custody</title>
|
|
1224
1240
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
1225
1241
|
<script>(() => { try { const t = localStorage.getItem("agent-custody-theme"); if (t === "dark" || t === "light") document.documentElement.dataset.theme = t; } catch {} })();</script>
|
|
1226
1242
|
<style>
|
|
1227
|
-
:root { color-scheme: light dark; --ink: #1b2430; --ink2: #5b6b7a; --line: #d7dfe5; --bg: #f5f7f9; --panel: #ffffff; --accent: #b45309; --accent-bg: #fbf1dc; --warn: #8a5a00; --bad: #b3261e; --ok: #1f7a4d; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
|
|
1228
|
-
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ink: #e6ecf0; --ink2: #9fb0bd; --line: #27333c; --bg: #0e1418; --panel: #151d23; --accent: #f59e0b; --accent-bg: #2d2412; --warn: #e2b862; --bad: #ff8a80; --ok: #6fd39a; } }
|
|
1229
|
-
:root[data-theme="dark"] { --ink: #e6ecf0; --ink2: #9fb0bd; --line: #27333c; --bg: #0e1418; --panel: #151d23; --accent: #f59e0b; --accent-bg: #2d2412; --warn: #e2b862; --bad: #ff8a80; --ok: #6fd39a; }
|
|
1243
|
+
:root { color-scheme: light dark; --ink: #1b2430; --ink2: #5b6b7a; --line: #d7dfe5; --bg: #f5f7f9; --panel: #ffffff; --accent: #b45309; --accent-bg: #fbf1dc; --warn: #8a5a00; --bad: #b3261e; --ok: #1f7a4d; --accent-ink: #ffffff; --accent-hover: #92400e; --field: #a9b4bd; --lift: 0 1px 2px rgb(0 0 0 / .04); --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
|
|
1244
|
+
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ink: #e6ecf0; --ink2: #9fb0bd; --line: #27333c; --bg: #0e1418; --panel: #151d23; --accent: #f59e0b; --accent-bg: #2d2412; --warn: #e2b862; --bad: #ff8a80; --ok: #6fd39a; --accent-ink: #1c1917; --accent-hover: #fbbf24; --field: #3d4c57; --lift: none; } }
|
|
1245
|
+
:root[data-theme="dark"] { --ink: #e6ecf0; --ink2: #9fb0bd; --line: #27333c; --bg: #0e1418; --panel: #151d23; --accent: #f59e0b; --accent-bg: #2d2412; --warn: #e2b862; --bad: #ff8a80; --ok: #6fd39a; --accent-ink: #1c1917; --accent-hover: #fbbf24; --field: #3d4c57; --lift: none; }
|
|
1230
1246
|
* { box-sizing: border-box; }
|
|
1231
1247
|
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
1232
1248
|
.top { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--panel); }
|
|
@@ -1235,102 +1251,191 @@ const PORTAL_PAGE = `<!doctype html>
|
|
|
1235
1251
|
.top .who { color: var(--ink2); font-size: .9rem; margin-left: .5rem; }
|
|
1236
1252
|
button.theme { background: transparent; color: var(--ink2); border: 1px solid var(--line); padding: .25rem .6rem; font-size: .8rem; border-radius: 4px; } button.theme:hover { color: var(--ink); }
|
|
1237
1253
|
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font: 600 .72rem/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: var(--accent-bg); color: var(--accent); }
|
|
1238
|
-
.notice {
|
|
1254
|
+
.notice { padding: .6rem 1.25rem; font-size: .9rem; color: var(--ink); background: var(--accent-bg); border-bottom: 1px solid var(--line); } .notice a, .notice button { margin-left: .6rem; } .notice button { font: inherit; background: none; border: 1px solid var(--line); border-radius: 4px; padding: .1rem .5rem; color: var(--ink); cursor: pointer; }
|
|
1255
|
+
.notice button:hover { background: var(--panel); border-color: var(--line); }
|
|
1256
|
+
a { color: var(--accent); text-underline-offset: 3px; }
|
|
1257
|
+
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
1239
1258
|
.layout { display: grid; grid-template-columns: 15rem 1fr; min-height: calc(100vh - 3.3rem); }
|
|
1240
1259
|
nav { border-right: 1px solid var(--line); background: var(--panel); padding: 1rem 0; }
|
|
1241
1260
|
nav .group { font: 600 .68rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding: 1rem 1.25rem .35rem; }
|
|
1242
|
-
nav a { display: flex; justify-content: space-between; padding: .45rem 1.25rem; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
|
|
1243
|
-
nav a.on { border-left-color: var(--accent); background: var(--accent-bg); }
|
|
1261
|
+
nav a { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 1.25rem; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
|
|
1262
|
+
nav a:hover { background: var(--bg); } nav a.on { border-left-color: var(--accent); background: var(--accent-bg); font-weight: 600; }
|
|
1244
1263
|
nav a span.n { color: var(--ink2); font-family: var(--mono); font-size: .8rem; }
|
|
1245
|
-
main { padding:
|
|
1246
|
-
h1 { font-size: 1.
|
|
1264
|
+
main { padding: 2rem 2rem 3rem; max-width: 72rem; min-width: 0; }
|
|
1265
|
+
h1 { font-size: 1.5rem; letter-spacing: -.02em; margin: 0 0 1rem; } h2 { font: 600 .72rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); margin: 1.5rem 0 .6rem; }
|
|
1247
1266
|
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .9rem; }
|
|
1248
|
-
.card { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius:
|
|
1267
|
+
.card { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; box-shadow: var(--lift); padding: 1rem 1.1rem; }
|
|
1249
1268
|
.card.warn { border-top-color: var(--warn); } .card.bad { border-top-color: var(--bad); } .card.ok { border-top-color: var(--ok); }
|
|
1250
1269
|
.card .k { font: 600 .68rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
|
|
1251
1270
|
.card .v { font-size: 1.9rem; font-weight: 700; margin: .2rem 0 0; font-variant-numeric: tabular-nums; }
|
|
1252
1271
|
.card .s { color: var(--ink2); font-size: .88rem; }
|
|
1253
|
-
.panel { background: var(--panel); border: 1px solid var(--line); border-radius:
|
|
1272
|
+
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin-top: .9rem; box-shadow: var(--lift); overflow-x: auto; } .panel > h2:first-child { margin-top: 0; }
|
|
1254
1273
|
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
|
|
1255
|
-
th, td { text-align: left; padding: .
|
|
1274
|
+
th, td { text-align: left; padding: .55rem .75rem .55rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; } tbody tr:last-child > * { border-bottom: 0; }
|
|
1275
|
+
td button:not(.link) { padding: .25rem .7rem; font-size: .85rem; } td select { padding: .3rem .5rem; }
|
|
1276
|
+
#audit td:nth-child(-n+3) { white-space: nowrap; } #audit td:last-child { min-width: 16rem; overflow-wrap: anywhere; font-size: .86rem; }
|
|
1256
1277
|
th { font: 600 .68rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
|
|
1257
1278
|
code, pre, .mono { font-family: var(--mono); font-size: .86em; }
|
|
1258
|
-
pre { background: var(--bg); border: 1px solid var(--line); border-radius:
|
|
1279
|
+
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .8rem .9rem; overflow-x: auto; white-space: pre-wrap; }
|
|
1259
1280
|
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; align-items: end; height: 9rem; }
|
|
1260
1281
|
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: .75rem; color: var(--ink2); }
|
|
1261
|
-
.bar i { display: block; width: 70%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
|
|
1282
|
+
.bar i { display: block; width: 70%; max-width: 4rem; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
|
|
1262
1283
|
.bar b { font-family: var(--mono); font-weight: 400; margin-top: .3rem; }
|
|
1263
1284
|
label { display: grid; gap: .25rem; font-size: .85rem; color: var(--ink2); margin: 0 0 .8rem; }
|
|
1264
1285
|
label .opt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-left: .3rem; } label .hint { font-size: .8rem; line-height: 1.45; } label .hint code { font-family: var(--mono); font-size: .9em; }
|
|
1265
|
-
textarea { font: .86rem/1.5 var(--mono); padding: .5rem .6rem;
|
|
1266
|
-
input, select { font: inherit; padding: .5rem .6rem;
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
.
|
|
1272
|
-
.
|
|
1273
|
-
.
|
|
1286
|
+
textarea { font: .86rem/1.5 var(--mono); padding: .5rem .6rem; width: 100%; }
|
|
1287
|
+
input, select { font: inherit; padding: .5rem .6rem; }
|
|
1288
|
+
input, select, textarea { border: 1px solid var(--field); border-radius: 8px; background: var(--bg); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
|
|
1289
|
+
input::placeholder, textarea::placeholder { color: var(--ink2); opacity: .8; }
|
|
1290
|
+
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
|
|
1291
|
+
button { font: inherit; font-weight: 600; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; transition: background-color .15s, border-color .15s; }
|
|
1292
|
+
button:not(.quiet, .link, .theme):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
|
|
1293
|
+
button.quiet { background: transparent; color: var(--accent); } button.quiet:hover { background: var(--accent-bg); }
|
|
1294
|
+
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
|
|
1295
|
+
button:disabled { opacity: .55; cursor: default; }
|
|
1296
|
+
body:has(> .auth:not([hidden])) { min-height: 100vh; background-color: var(--bg); background-image: radial-gradient(56rem 26rem at 50% -8rem, var(--accent-bg), transparent 72%), radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink2) 20%, transparent) 1px, transparent 0); background-size: 100% 100%, 22px 22px; background-repeat: no-repeat, repeat; }
|
|
1297
|
+
.auth { --pad: 2.25rem; position: relative; max-width: 27rem; margin: 3.5rem auto 4rem; padding: var(--pad) var(--pad) 1.75rem; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 18px 40px -18px rgb(0 0 0 / .25); }
|
|
1298
|
+
.auth::before { content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 4px; border-radius: 14px 14px 0 0; background: var(--accent); }
|
|
1299
|
+
#onboard { max-width: 31rem; } .auth.wide { max-width: 44rem; }
|
|
1300
|
+
.auth.split { padding: 0; } .auth.split > .pane { padding: var(--pad) var(--pad) 1.75rem; } .pitch { display: none; }
|
|
1301
|
+
.pitch .eyebrow { color: #f59e0b; }
|
|
1302
|
+
.pitch h2 { margin: 0 0 1rem; font: 700 2rem/1.15 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.025em; text-transform: none; color: #fff; }
|
|
1303
|
+
.pitch > p { margin: 0 0 2rem; max-width: 30rem; color: #9fb0bd; }
|
|
1304
|
+
.flow { list-style: none; counter-reset: flow; display: grid; gap: 1.1rem; margin: 0; padding: 0; }
|
|
1305
|
+
.flow li { counter-increment: flow; display: grid; grid-template-columns: 2rem 1fr; gap: .1rem .85rem; }
|
|
1306
|
+
.flow li::before { content: counter(flow); grid-row: span 2; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid rgb(255 255 255 / .2); border-radius: 50%; color: #9fb0bd; font: 700 .8rem var(--mono); }
|
|
1307
|
+
.flow li.now::before { background: #f59e0b; border-color: #f59e0b; color: #1c1917; }
|
|
1308
|
+
.flow b { color: #fff; font-weight: 600; } .flow span { color: #9fb0bd; font-size: .9rem; }
|
|
1309
|
+
@media (min-width: 60rem) {
|
|
1310
|
+
.auth.split { display: grid; grid-template-columns: minmax(0, 1fr) 27rem; max-width: 64rem; overflow: hidden; }
|
|
1311
|
+
#onboard.split { grid-template-columns: minmax(0, 1fr) 31rem; max-width: 68rem; }
|
|
1312
|
+
.pitch { display: flex; flex-direction: column; justify-content: center; padding: 3rem; background: radial-gradient(circle at 1px 1px, rgb(255 255 255 / .07) 1px, transparent 0) 0 0 / 22px 22px, linear-gradient(160deg, #1f2a35, #0e1418); }
|
|
1313
|
+
#onboard .pitch { justify-content: flex-start; padding-top: 4.5rem; }
|
|
1314
|
+
.split .fine { border-radius: 0; }
|
|
1315
|
+
.auth.wide { display: grid; grid-template-columns: 21rem minmax(0, 1fr); gap: 0 2.5rem; align-items: start; max-width: 72rem; }
|
|
1316
|
+
.wide .side { position: sticky; top: 1.5rem; } .wide #firstSetup > .step:first-child { border-top: 0; padding-top: 0; }
|
|
1317
|
+
}
|
|
1318
|
+
.auth .mark { display: block; width: 40px; height: 40px; margin: 0 0 1rem; } .mark .tile { fill: var(--accent); } .mark .ink { stroke: var(--accent); }
|
|
1319
|
+
.auth .eyebrow { margin: 0 0 .3rem; font: 600 .7rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
|
|
1320
|
+
.auth h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 1.5rem; }
|
|
1321
|
+
.auth h1 + .muted { margin-top: -.75rem; }
|
|
1322
|
+
.auth label { color: var(--ink); font-weight: 600; font-size: .85rem; gap: .4rem; margin: 0 0 1rem; }
|
|
1323
|
+
.auth label { position: relative; } .auth label .opt { position: absolute; top: .1rem; right: 0; margin: 0; }
|
|
1324
|
+
.auth label .opt, .auth label .hint { font-weight: 400; color: var(--ink2); }
|
|
1325
|
+
.auth input, .auth select { width: 100%; min-height: 2.75rem; padding: .6rem .8rem; font-size: 1rem; font-weight: 400; }
|
|
1326
|
+
.auth form > button[type="submit"] { display: block; width: 100%; min-height: 2.75rem; margin-top: .25rem; }
|
|
1327
|
+
.providers { display: grid; gap: .6rem; margin: 0 0 1.25rem; }
|
|
1328
|
+
.providers a { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 2.75rem; padding: .55rem .9rem; border: 1px solid var(--field); border-radius: 8px; background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 600; transition: border-color .15s, background-color .15s; }
|
|
1329
|
+
.providers a:hover { border-color: var(--accent); background: var(--bg); } .providers svg { width: 18px; height: 18px; flex: none; }
|
|
1330
|
+
.or { display: flex; align-items: center; gap: .75rem; margin: .4rem 0 0; color: var(--ink2); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
|
|
1331
|
+
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
|
|
1332
|
+
#authNote { margin: 1rem 0 0; padding: .65rem .85rem; border-radius: 8px; background: var(--accent-bg); color: var(--ink); font-size: .88rem; }
|
|
1333
|
+
#ssoForm { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); } #ssoForm button { margin-top: .25rem; }
|
|
1334
|
+
.auth .swap { text-align: center; margin: 1.25rem 0 0; }
|
|
1335
|
+
.auth .fine { margin: 1.5rem calc(-1 * var(--pad)) -1.75rem; padding: 1rem var(--pad); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; background: var(--bg); font-size: .82rem; line-height: 1.55; }
|
|
1336
|
+
.auth .msg { min-height: 0; margin: .75rem 0 0; font-size: .9rem; } .auth .msg:empty { margin: 0; }
|
|
1337
|
+
.auth .msg.err:not(:empty), .auth .msg.ok:not(:empty) { padding: .55rem .8rem; border-radius: 8px; border: 1px solid; }
|
|
1338
|
+
.auth .msg.err:not(:empty) { border-color: color-mix(in srgb, var(--bad) 40%, var(--panel)); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
|
|
1339
|
+
.auth .msg.ok:not(:empty) { border-color: color-mix(in srgb, var(--ok) 40%, var(--panel)); background: color-mix(in srgb, var(--ok) 8%, var(--panel)); }
|
|
1340
|
+
@media (max-width: 30rem) { .top { flex-wrap: wrap; row-gap: .4rem; } .brand, button.theme { white-space: nowrap; } button.theme { margin-left: auto; } .top .links { order: 1; flex-basis: 100%; margin-left: 0; font-size: .85rem; } .top .who, #planTag { display: none !important; } .auth { --pad: 1.25rem; margin: 1rem .75rem 2rem; border-radius: 12px; } .auth::before { border-radius: 12px 12px 0 0; } .auth .fine { border-radius: 0 0 12px 12px; } .auth h1 { font-size: 1.4rem; } }
|
|
1274
1341
|
.step { display: grid; grid-template-columns: 2rem 1fr; gap: .2rem .8rem; padding: 1rem 0; border-top: 1px solid var(--line); }
|
|
1275
1342
|
.step .n { font: 700 .85rem/1.6 var(--mono); color: var(--accent); }
|
|
1276
1343
|
.step h3 { margin: 0 0 .3rem; font-size: 1rem; } .step p { margin: 0 0 .5rem; color: var(--ink2); font-size: .92rem; }
|
|
1277
1344
|
.snip { position: relative; margin: .4rem 0 .6rem; } .snip pre { margin: 0; padding-right: 4.5rem; font-family: var(--mono); font-size: .84rem; }
|
|
1278
1345
|
.snip button { position: absolute; top: .45rem; right: .45rem; padding: .2rem .6rem; font-size: .8rem; }
|
|
1279
1346
|
.addr th { text-align: left; font-weight: 600; padding-right: 1rem; white-space: nowrap; } .addr td { word-break: break-all; }
|
|
1280
|
-
.once { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-radius:
|
|
1281
|
-
.tok { font-family: var(--mono); word-break: break-all; padding: .6rem; background: var(--bg); border-radius:
|
|
1282
|
-
.msg { min-height: 1.4rem; margin: .6rem 0; color: var(--ink2); } .msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
|
|
1347
|
+
.once { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-radius: 10px; padding: 1rem 1.1rem; margin: 1rem 0; }
|
|
1348
|
+
.tok { font-family: var(--mono); word-break: break-all; padding: .6rem .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
|
|
1349
|
+
.msg { min-height: 1.4rem; margin: .6rem 0; color: var(--ink2); } .panel > .msg:empty { display: none; } .msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
|
|
1283
1350
|
.muted { color: var(--ink2); }
|
|
1284
1351
|
[hidden] { display: none !important; }
|
|
1285
|
-
@media (max-width: 48rem) { .layout { grid-template-columns: 1fr; } nav { display: flex;
|
|
1352
|
+
@media (max-width: 48rem) { .layout { grid-template-columns: 1fr; } nav { display: flex; overflow-x: auto; padding: 0 .3rem; border-right: 0; border-bottom: 1px solid var(--line); } nav .group { display: none; } nav a { flex: none; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; } main { padding: 1.25rem 1rem 2rem; } nav a.on { border-bottom-color: var(--accent); }
|
|
1353
|
+
.cards { grid-template-columns: 1fr 1fr; gap: .6rem; } .card { padding: .75rem .85rem; } .card .k { font-size: .6rem; letter-spacing: .06em; } .card .v { font-size: 1.4rem; } .card .s { font-size: .8rem; line-height: 1.35; }
|
|
1354
|
+
table:has(#urls), #urls, table:has(#audit), #audit { display: block; } table:has(#audit) thead { display: none; }
|
|
1355
|
+
#urls tr { display: grid; gap: .15rem; padding: .55rem 0; border-bottom: 1px solid var(--line); } #urls tr:last-child { border-bottom: 0; }
|
|
1356
|
+
#urls th, #urls td { padding: 0; border: 0; } #urls td { overflow-wrap: anywhere; font-size: .8rem; }
|
|
1357
|
+
#audit tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .75rem; padding: .65rem 0; border-bottom: 1px solid var(--line); } #audit tr:last-child { border-bottom: 0; }
|
|
1358
|
+
#audit td { min-width: 0; padding: 0; border: 0; white-space: normal; }
|
|
1359
|
+
#audit td:nth-child(3) { grid-area: 1 / 1; font-weight: 600; } #audit td:nth-child(1) { grid-area: 1 / 2; color: var(--ink2); font-size: .8rem; white-space: nowrap; }
|
|
1360
|
+
#audit td:nth-child(2), #audit td:nth-child(4), #audit td[colspan] { grid-column: 1 / -1; font-size: .8rem; } #audit td:nth-child(2) { color: var(--ink2); } }
|
|
1286
1361
|
</style>
|
|
1287
1362
|
<div class="top"><a class="brand" href="https://agent-custody.dev/"><svg viewBox="0 0 64 64" aria-hidden="true"><rect width="64" height="64" rx="14"/><path d="M19 11H45V45L41.75 48 38.5 45 35.25 48 32 45 28.75 48 25.5 45 22.25 48 19 45Z" fill="#fff"/><path d="M25 20h14M25 27h14" stroke="var(--accent)" stroke-width="2.6" stroke-linecap="round"/><path d="M25 37.5l5 4.5 9.5-10" fill="none" stroke="var(--accent)" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"/></svg>agent-custody</a><span id="tenantTag" class="pill" hidden></span><span id="planTag" class="pill" hidden></span><span class="links"><a href="https://agent-custody.dev/guide/getting-started">Guide</a><a href="https://docs.agent-custody.dev/reference/">Docs</a><a href="https://agent-custody.dev/verify">Verify a receipt</a></span><span class="who" id="who"></span><button class="theme" id="themeToggle" type="button">Dark mode</button></div>
|
|
1288
1363
|
<div id="notice" class="notice" hidden></div>
|
|
1289
|
-
<section id="auth" class="auth" hidden>
|
|
1364
|
+
<section id="auth" class="auth split" hidden>
|
|
1365
|
+
<aside class="pitch">
|
|
1366
|
+
<p class="eyebrow">agent-custody hosted log</p>
|
|
1367
|
+
<h2>Proof of what your AI agents did.</h2>
|
|
1368
|
+
<p>Your gateway signs a receipt for each tool call that it checks. This log keeps the hash of each receipt in a Merkle tree with signed heads, so a changed or removed receipt shows.</p>
|
|
1369
|
+
<ol class="flow">
|
|
1370
|
+
<li><b>Your agent calls a tool</b><span>The gateway checks the call against your policy before it runs.</span></li>
|
|
1371
|
+
<li><b>The gateway signs a receipt</b><span>The receipt stays on your machines.</span></li>
|
|
1372
|
+
<li><b>Its hash comes to this log</b><span>Anyone with the public keys can verify the receipt and its place in the log.</span></li>
|
|
1373
|
+
</ol>
|
|
1374
|
+
</aside>
|
|
1375
|
+
<div class="pane">
|
|
1376
|
+
${MARK}
|
|
1377
|
+
<p class="eyebrow">Hosted log</p>
|
|
1290
1378
|
<h1 id="authTitle">Sign in</h1>
|
|
1291
1379
|
<div id="providers" class="providers" hidden></div>
|
|
1292
1380
|
<form id="authForm">
|
|
1293
1381
|
<label>Work email<input id="email" type="email" autocomplete="email" required></label>
|
|
1294
1382
|
<label>Password<input id="password" type="password" autocomplete="current-password" minlength="10" required></label>
|
|
1295
1383
|
<button id="authGo" type="submit">Sign in</button>
|
|
1296
|
-
<p class="msg" id="authMsg"></p>
|
|
1384
|
+
<p class="msg" id="authMsg" aria-live="polite"></p>
|
|
1297
1385
|
</form>
|
|
1298
1386
|
<form id="mfaForm" hidden>
|
|
1299
1387
|
<p class="muted">Your account has two-step sign-in. Enter the six-digit code from your authenticator app.</p>
|
|
1300
1388
|
<label>Code<input id="mfaCode" inputmode="numeric" autocomplete="one-time-code" pattern="[0-9]{6}" maxlength="6" required></label>
|
|
1301
1389
|
<button type="submit">Verify</button>
|
|
1302
|
-
<p class="msg" id="mfaMsg"></p>
|
|
1390
|
+
<p class="msg" id="mfaMsg" aria-live="polite"></p>
|
|
1303
1391
|
</form>
|
|
1304
1392
|
<p class="muted" id="authNote" hidden>Next you name your organisation and get your tenant and its first key. Two minutes.</p>
|
|
1305
1393
|
<form id="ssoForm" action="/auth/sso" method="get">
|
|
1306
1394
|
<label>Work email for single sign-on<input name="email" type="email" autocomplete="email" required></label>
|
|
1307
1395
|
<button class="quiet" type="submit">Sign in with single sign-on</button>
|
|
1308
1396
|
</form>
|
|
1309
|
-
<p class="muted"><button class="link" id="authSwap" type="button">Create an account instead</button></p>
|
|
1310
|
-
<p class="muted">The free plan is ten thousand appends a month, no card. Your gateway sends only hashes; nothing you log here can be read by us.</p>
|
|
1397
|
+
<p class="muted swap"><button class="link" id="authSwap" type="button">Create an account instead</button></p>
|
|
1398
|
+
<p class="muted fine">The free plan is ten thousand appends a month, no card. Your gateway sends only hashes; nothing you log here can be read by us.</p>
|
|
1399
|
+
</div>
|
|
1311
1400
|
</section>
|
|
1312
|
-
<section id="onboard" class="auth" hidden>
|
|
1401
|
+
<section id="onboard" class="auth split" hidden>
|
|
1402
|
+
<aside class="pitch">
|
|
1403
|
+
<p class="eyebrow">Setup, step 1 of 4</p>
|
|
1404
|
+
<h2>Your own log, in about two minutes.</h2>
|
|
1405
|
+
<ol class="flow">
|
|
1406
|
+
<li class="now"><b>Create your tenant</b><span>Name your organisation. The tenant id becomes the path of your log.</span></li>
|
|
1407
|
+
<li><b>Copy your first API key</b><span>We show it once and keep only its hash.</span></li>
|
|
1408
|
+
<li><b>Point your gateway at the log</b><span>One config entry and one environment variable.</span></li>
|
|
1409
|
+
<li><b>Send your first receipt</b><span>The dashboard shows the append within seconds.</span></li>
|
|
1410
|
+
</ol>
|
|
1411
|
+
</aside>
|
|
1412
|
+
<div class="pane">
|
|
1413
|
+
${MARK}
|
|
1313
1414
|
<h1>Set up your tenant</h1>
|
|
1314
1415
|
<p class="muted">Signed in as <b id="onboardWho"></b>. A tenant is your own log on this service, with its own keys and its own path.</p>
|
|
1315
1416
|
<div id="invites" class="panel" hidden><p><b>You are invited to join a tenant.</b> Your email address must be verified first.</p><div id="inviteList"></div></div>
|
|
1316
1417
|
<form id="onboardForm">
|
|
1317
1418
|
<label>Your name<input id="name" autocomplete="name" maxlength="120" required></label>
|
|
1318
1419
|
<label>Company or organisation<input id="company" autocomplete="organization" maxlength="160" required></label>
|
|
1319
|
-
<label>Tenant id<input id="tenant" placeholder="acme" pattern="[a-z0-9][a-z0-9
|
|
1420
|
+
<label>Tenant id<input id="tenant" placeholder="acme" pattern="[a-z0-9][a-z0-9\\-]{1,38}[a-z0-9]" required><span class="hint">A short name for your organisation, filled in from the company name; change it if you like. It becomes the path of your log, which your gateway config and your auditors will use: <code id="tenantPreview">__LOG_BASE__t/<tenant>/</code></span></label>
|
|
1320
1421
|
<label>Your role <span class="opt">optional</span><input id="role" autocomplete="organization-title" maxlength="120" placeholder="Head of Platform"></label>
|
|
1321
1422
|
<label>Phone <span class="opt">optional</span><input id="phone" type="tel" autocomplete="tel" maxlength="40" placeholder="+44 20 …"></label>
|
|
1322
1423
|
<label>Telegram username <span class="opt">optional</span><input id="telegram" maxlength="40" placeholder="@yourname"><span class="hint">Your handle in Telegram, under Settings, if you would rather we reach you there than by email.</span></label>
|
|
1323
1424
|
<button type="submit">Create tenant</button>
|
|
1324
|
-
<p class="msg" id="onboardMsg"></p>
|
|
1425
|
+
<p class="msg" id="onboardMsg" aria-live="polite"></p>
|
|
1325
1426
|
</form>
|
|
1326
1427
|
<p class="muted"><a href="#" id="signoutOnboard">Sign out</a></p>
|
|
1428
|
+
</div>
|
|
1327
1429
|
</section>
|
|
1328
1430
|
<section id="welcome" class="auth wide" hidden>
|
|
1431
|
+
<div class="side">
|
|
1432
|
+
${MARK}
|
|
1329
1433
|
<h1>Your tenant is ready</h1>
|
|
1330
1434
|
<p class="muted">Three steps to your first receipt in this log. Everything here is under <b>Setup</b> in the dashboard whenever you need it again.</p>
|
|
1331
1435
|
<div class="once"><p><b>Your first API key, shown once.</b> Put it in the environment your gateway reads as <code>AGENT_CUSTODY_LOG_TOKEN</code>. We keep only its hash.</p><p class="tok" id="firstToken"></p><button class="quiet" id="copyFirst">Copy key</button></div>
|
|
1332
|
-
<div id="firstSetup"></div>
|
|
1333
1436
|
<p><button id="toDash">Go to the dashboard</button></p>
|
|
1437
|
+
</div>
|
|
1438
|
+
<div id="firstSetup"></div>
|
|
1334
1439
|
</section>
|
|
1335
1440
|
<div class="layout" id="app" hidden>
|
|
1336
1441
|
<nav>
|
|
@@ -1444,13 +1549,14 @@ const PORTAL_PAGE = `<!doctype html>
|
|
|
1444
1549
|
const note = (id, text, ok) => { $(id).className = "msg " + (ok ? "ok" : "err"); $(id).textContent = text; };
|
|
1445
1550
|
const show = (id) => { for (const s of ["auth", "onboard", "welcome", "app"]) $(s).hidden = s !== id; };
|
|
1446
1551
|
const PROVIDERS = __PROVIDERS__;
|
|
1447
|
-
|
|
1552
|
+
const ICONS = { github: "<svg viewBox='0 0 16 16' aria-hidden='true'><path fill='currentColor' d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z'/></svg>", google: "<svg viewBox='0 0 48 48' aria-hidden='true'><path fill='#EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/><path fill='#4285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/><path fill='#FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/><path fill='#34A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/></svg>" };
|
|
1553
|
+
if (PROVIDERS.length) { $("providers").innerHTML = PROVIDERS.map((p) => "<a href='/auth/" + p + "'>" + ICONS[p] + "Continue with " + (p === "github" ? "GitHub" : "Google") + "</a>").join("") + "<p class=or>or with email</p>"; $("providers").hidden = false; }
|
|
1448
1554
|
const view = (name) => {
|
|
1449
1555
|
for (const p of document.querySelectorAll("[data-pane]")) p.hidden = p.dataset.pane !== name;
|
|
1450
1556
|
for (const a of document.querySelectorAll("nav a[data-view]")) a.classList.toggle("on", a.dataset.view === name);
|
|
1451
1557
|
location.hash = name;
|
|
1452
1558
|
};
|
|
1453
|
-
const LOG_BASE = "
|
|
1559
|
+
const LOG_BASE = $("tenantPreview").textContent.replace("t/<tenant>/", "");
|
|
1454
1560
|
const slug = (s) => s.toLowerCase().normalize("NFKD").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
1455
1561
|
let tenantEdited = false;
|
|
1456
1562
|
const previewTenant = () => { $("tenantPreview").textContent = LOG_BASE + "t/" + ($("tenant").value || "<tenant>") + "/"; };
|
|
@@ -1489,7 +1595,7 @@ const PORTAL_PAGE = `<!doctype html>
|
|
|
1489
1595
|
const step = (n, title, body) => "<div class=step><span class=n>" + n + "</span><div><h3>" + title + "</h3>" + body + "</div></div>";
|
|
1490
1596
|
const renderSetup = (el, s, atRegistration) => {
|
|
1491
1597
|
el.innerHTML =
|
|
1492
|
-
step(1, "Keep the key where your gateway runs", (atRegistration ? "<p>
|
|
1598
|
+
step(1, "Keep the key where your gateway runs", (atRegistration ? "<p>Your first key is shown once; we keep only its hash. Put it in the environment of the machine that runs your gateway or SDK:</p>" : "<p>Your key was shown once at registration. If it is gone, mint another under <a href=\\"#keys\\" data-view=\\"keys\\">API keys</a>. It lives in the environment of the machine that runs your gateway or SDK:</p>") + snip(s.env)) +
|
|
1493
1599
|
step(2, "Point your gateway or SDK at your log", "<p>Add this to <code>gateway.json</code> or <code>sdk.json</code>. <code>hashOnly</code> means this log receives the hash of each receipt and never the receipt.</p>" + snip(s.config)) +
|
|
1494
1600
|
step(3, "Send the first receipt", "<p>Run your agent through the gateway once. The <a href=\\"#overview\\" data-view=\\"overview\\">Overview</a> shows the append within seconds, and the first signed checkpoint follows within minutes. New to the gateway? <a href=\\"https://agent-custody.dev/guide/getting-started\\">Getting started</a> takes ten minutes.</p>") +
|
|
1495
1601
|
step(4, "Hand this to whoever verifies your receipts", "<p>Both commands fetch this log's published keys and pin them; <code>--log-id</code> makes sure the tree heads are this log's.</p>" + snip(s.verify) + snip(s.audit)) +
|
package/dist/receipt.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const TREEHEAD_TYPE = "application/vnd.agent-custody.treehead+jso
|
|
|
13
13
|
/**
|
|
14
14
|
* Provenance of a receipt field. This is the honest part of the design.
|
|
15
15
|
* - attested: signed by a key other than the issuer's (today: the principal's delegation key)
|
|
16
|
-
* - observed: the issuer obtained this deterministically, outside the agent's control (
|
|
16
|
+
* - observed: the issuer obtained this deterministically, outside the agent's control (an out-of-process issuer only; an egress witness marks the agent observed when it checked the agent's proxy credential)
|
|
17
17
|
* - claimed: originates from the agent, the model, or the agent's own process, with no independent check
|
|
18
18
|
*/
|
|
19
19
|
export type Provenance = "attested" | "observed" | "claimed";
|
|
@@ -23,8 +23,12 @@ export type Provenance = "attested" | "observed" | "claimed";
|
|
|
23
23
|
* - sdk: an interceptor inside the agent's own process; self-reported, tamper-evident after issue but not before
|
|
24
24
|
* - door: an out-of-process enforcement point in front of a business's own HTTP surface; the arriving agent, caller,
|
|
25
25
|
* or browser could neither skip nor forge it, and has no grant unless it presented one
|
|
26
|
+
* - egress: a forward proxy in a locked-down agent's network path, for connections that do not go to the gateway; it
|
|
27
|
+
* saw where traffic went and how much, never what was sent. Each receipt is an observed bypass of the gateway
|
|
28
|
+
* - guardian: an OWASP ACS Guardian outside the agent's process. The decision is its own and signed with its key; the
|
|
29
|
+
* call is the agent's report. The agent could skip asking or ignore the answer, so nothing here was enforced
|
|
26
30
|
*/
|
|
27
|
-
export type IssuerKind = "gateway" | "sdk" | "door";
|
|
31
|
+
export type IssuerKind = "gateway" | "sdk" | "door" | "egress" | "guardian";
|
|
28
32
|
export interface FactRecord {
|
|
29
33
|
tool: string;
|
|
30
34
|
args: Record<string, unknown>;
|
package/dist/simulate.js
CHANGED
|
@@ -128,7 +128,7 @@ export function simulatePolicy(policyText, receipts, options = {}) {
|
|
|
128
128
|
}
|
|
129
129
|
digests.add(previous.policyDigest);
|
|
130
130
|
if (!receiptId || !tool || typeof original.agent.id !== "string" || !original.agent.id
|
|
131
|
-
|| !Number.isFinite(Date.parse(original.timestamp)) || !["sdk", "gateway", "door"].includes(original.issuer.kind)) {
|
|
131
|
+
|| !Number.isFinite(Date.parse(original.timestamp)) || !["sdk", "gateway", "door", "egress", "guardian"].includes(original.issuer.kind)) {
|
|
132
132
|
skip("malformed receipt: receipt id, tool, agent, timestamp, or issuer is invalid");
|
|
133
133
|
continue;
|
|
134
134
|
}
|
package/dist/verify.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Independent verification of a receipt bundle. Needs only public keys, and optionally a copy of the log.
|
|
2
|
+
import { internalAddress, isAddressLiteral, sameAddress } from "./addresses.js";
|
|
2
3
|
import { canonicalize, digestOf, dsseVerifiers, dsseVerify } from "./crypto.js";
|
|
3
4
|
import { isApprovalTime, verifyApproval, verifyApprovalStatement } from "./approval.js";
|
|
4
5
|
import { digestSaltFor, getAt, isCommitment, pathKey, pathText, restorePaths, under } from "./capture.js";
|
|
@@ -184,7 +185,7 @@ export function verifyBundle(bundle, opts) {
|
|
|
184
185
|
if (!add("structural parts in clear", !broken, broken ?? undefined))
|
|
185
186
|
return done(null);
|
|
186
187
|
const p = st.predicate;
|
|
187
|
-
add("issuer kind is known", p.issuer.kind === "gateway" || p.issuer.kind === "sdk" || p.issuer.kind === "door", `${p.issuer.kind}${p.issuer.framework ? ` / ${p.issuer.framework}` : ""}`);
|
|
188
|
+
add("issuer kind is known", p.issuer.kind === "gateway" || p.issuer.kind === "sdk" || p.issuer.kind === "door" || p.issuer.kind === "egress" || p.issuer.kind === "guardian", `${p.issuer.kind}${p.issuer.framework ? ` / ${p.issuer.framework}` : ""}`);
|
|
188
189
|
add("issuer keyid matches signer", p.issuer.keyid === sig.keyid);
|
|
189
190
|
if (opts.requireStrict) {
|
|
190
191
|
add("strict mode in force", p.issuer.kind === "gateway" && p.issuer.strict === true, p.issuer.strict === true ? undefined : "the issuer does not say it ran in strict mode");
|
|
@@ -210,6 +211,31 @@ export function verifyBundle(bundle, opts) {
|
|
|
210
211
|
// A door decides every arrival by policy; an arrival carries a grant only when it chose to present one.
|
|
211
212
|
if (p.issuer.kind === "door")
|
|
212
213
|
add("door receipt carries a policy decision", p.policy !== null);
|
|
214
|
+
// An egress witness saw a connection that went around the gateway: where it went and how much, never what was sent.
|
|
215
|
+
// Its destination is its own observation; its agent is only as good as the proxy credential it checked.
|
|
216
|
+
if (p.issuer.kind === "egress") {
|
|
217
|
+
add("egress receipt carries a policy decision", p.policy !== null);
|
|
218
|
+
const dest = Object.hasOwn(p.facts, "destination") ? p.facts.destination : undefined;
|
|
219
|
+
const seen = dest?.value;
|
|
220
|
+
const name = typeof seen?.host === "string" && typeof seen.port === "number" ? `${seen.host.includes(":") ? `[${seen.host}]` : seen.host}:${seen.port}` : undefined;
|
|
221
|
+
add("egress destination observed", p.tool.provenance === "observed" && dest?.provenance === "observed" && name === p.tool.name, name === p.tool.name ? `${p.tool.name}; an observed bypass of the gateway, not a record of what was sent` : `the destination fact names ${name ?? "nothing"}, the receipt ${p.tool.name}`);
|
|
222
|
+
const relayed = p.execution.status === "executed" || p.execution.status === "failed" || p.execution.status === "error";
|
|
223
|
+
add("egress relayed only for a checked agent", !relayed || p.agent.provenance === "observed", p.agent.provenance === "observed" ? `${p.agent.id}, by the proxy credential the witness checked` : relayed ? `the connection was ${p.execution.status} for an agent the witness did not check` : "no agent was checked and nothing was relayed");
|
|
224
|
+
add("egress open committed before relaying", !relayed || !!p.authorization, relayed ? (p.authorization ? "the connection was in the log before any byte moved" : `the connection was ${p.execution.status} with nothing committed first`) : "nothing was relayed");
|
|
225
|
+
// An IP literal is the action itself: the peer must be that very address. A host name must have led to a public address.
|
|
226
|
+
const host = typeof seen?.host === "string" ? seen.host : "";
|
|
227
|
+
const literal = isAddressLiteral(host);
|
|
228
|
+
const reached = p.execution.status === "executed" || p.execution.status === "failed";
|
|
229
|
+
const peer = p.execution.status === "executed" || p.execution.status === "failed" ? p.execution.result?.peer : undefined;
|
|
230
|
+
const peerOk = typeof peer === "string" && (literal ? sameAddress(peer, host) : !internalAddress(peer));
|
|
231
|
+
add("egress peer matches the destination", !reached || peerOk, !reached ? "no connection was made" : literal ? `${host}, an address the policy named, reached ${typeof peer === "string" ? peer : "no recorded peer"}` : `${host} reached ${typeof peer === "string" ? peer : "no recorded peer"}${peerOk ? ", a public address" : ""}`);
|
|
232
|
+
}
|
|
233
|
+
// A Guardian decides and carries out nothing: an allow is withheld (nothing forwarded), a deny is denied.
|
|
234
|
+
if (p.issuer.kind === "guardian") {
|
|
235
|
+
add("guardian receipt carries a policy decision", !!p.policy && typeof p.policy === "object" && !Array.isArray(p.policy));
|
|
236
|
+
const decided = p.execution.status === "denied" ? p.policy?.decision === "deny" : p.execution.status === "withheld" && p.policy?.decision === "allow";
|
|
237
|
+
add("guardian decided, executed nothing", decided, decided ? `${p.policy?.decision}; the agent asked, reports the call itself, and is trusted to honor the answer` : `the receipt says ${p.execution.status} with a policy ${p.policy?.decision ?? "absent"}`);
|
|
238
|
+
}
|
|
213
239
|
if (p.delegation) {
|
|
214
240
|
const del = verifyDelegation(p.delegation.envelope, opts.principalKeys);
|
|
215
241
|
add("delegation signature (principal key)", del.ok, del.ok ? `signed by ${short(del.keyid)}` : del.error);
|
|
@@ -544,6 +570,8 @@ export function auditExtends(older, newer, proof, keys, logId, opts = {}) {
|
|
|
544
570
|
const ISSUER_NOTE = {
|
|
545
571
|
gateway: "enforced outside the agent's process; the agent could neither skip nor forge this receipt",
|
|
546
572
|
sdk: "self-reported by the agent's own process; tamper-evident after issue, but nothing here was enforced outside the agent",
|
|
573
|
+
guardian: "decided by an ACS Guardian outside the agent's process and signed with its own key, so the decision is attributable to it; the call is the agent's own report, and the agent could skip the Guardian or ignore its answer",
|
|
574
|
+
egress: "observed by a forward proxy in the agent's network path, for a connection that went around the gateway: where it went and how much, never what was sent; the agent is known only by the proxy credential the witness checked, and a connection that skipped the proxy (no lockdown) leaves no receipt at all",
|
|
547
575
|
};
|
|
548
576
|
/** Human-readable report: checks, then every field with its provenance so the reader knows what was proven vs. claimed. */
|
|
549
577
|
export function formatReport(r) {
|
|
@@ -582,7 +610,7 @@ export function formatReport(r) {
|
|
|
582
610
|
const committed = r.checks.filter((c) => c.name.startsWith("authorization ")).every((c) => c.ok);
|
|
583
611
|
row("authorization", "observed", committed ? `committed to the log as leaf ${p.authorization.inclusion.leafIndex}, before the call was forwarded` : "carried, but its checks FAILED");
|
|
584
612
|
}
|
|
585
|
-
else if (p.execution.status === "withheld")
|
|
613
|
+
else if (p.execution.status === "withheld" && p.issuer.kind !== "guardian")
|
|
586
614
|
row("authorization", "observed", "the log would not commit it; the call was not forwarded");
|
|
587
615
|
if (p.approval)
|
|
588
616
|
row("approval", p.approval.provenance, `${p.approval.status}; ${p.approval.requiredApprovers} approver(s) required${p.approval.consumedAt ? `; consumed ${p.approval.consumedAt}` : ""}${typeof p.approval.reason === "string" ? `; ${p.approval.reason}` : ""}`);
|
package/docs/acs.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# The ACS Guardian
|
|
2
|
+
|
|
3
|
+
The [OWASP Agent Control Standard](https://github.com/GenAI-Security-Project/agent-control-standard) (ACS) is a wire contract between an agent and a separate policy point. Before the agent acts, its instrumentation sends a JSON-RPC 2.0 hook, such as `steps/toolCallRequest`, to a **Guardian**. The Guardian answers `allow`, `deny`, `modify`, `ask`, or `defer`, and the agent is expected to honor the answer. `agent-custody acs` is a Guardian for two of those hooks. It decides each one with a Cedar policy and returns the decision with a signed, logged receipt (`issuer.kind: "guardian"`). A third party can check that receipt with the Guardian's public key alone.
|
|
4
|
+
|
|
5
|
+
This is a spike: enough to show the two fit together. It is not an ACS-Core conformant Guardian. The list of what it leaves out is [below](#what-it-does-not-implement). It was written against the ACS repository at commit `db457a8` (`version.txt` 0.1.4, schemas under `specification/v0.1.0/`).
|
|
6
|
+
|
|
7
|
+
## Why a receipt and not just the ACS answer
|
|
8
|
+
|
|
9
|
+
ACS already asks the Guardian to keep an audit chain and publish its head. Two passages in the specification set the limits of that record. A receipt from this Guardian is meant to supply what they say is missing:
|
|
10
|
+
|
|
11
|
+
- **ACS §8.6, chain head publication.** The baseline signature is HMAC-SHA256, with a per-session key that both the Guardian and the agent derive (§10). The section says a valid HMAC shows that *a* holder of the session key produced a message, not *which* one. So under the baseline a Guardian decision is not attributable to the Guardian against the agent. The agent can produce a validly signed `allow` that the Guardian never sent, and the Guardian can re-sign a rewritten chain. ACS leaves non-repudiation to its optional asymmetric ACS-Crypto profile.
|
|
12
|
+
- **ACS Trace README, "Observability Goals".** Trace events are self-reported observations, produced inside the environment being observed. The README says they become evidence only when a party outside the emitting runtime attests to them.
|
|
13
|
+
|
|
14
|
+
A receipt from this Guardian is signed by a key that only the Guardian holds (Ed25519, DSSE). It goes into an append-only Merkle log, which a witness can countersign, and the same `agent-custody verify` checks it that checks every other receipt. Neither party can mint or edit one without the Guardian's key, and the Guardian cannot quietly drop one from a log that others have already seen.
|
|
15
|
+
|
|
16
|
+
## ACS issue #18: an audit chain that does not rest on one Guardian
|
|
17
|
+
|
|
18
|
+
[ACS issue #18](https://github.com/GenAI-Security-Project/agent-control-standard/issues/18) points out that the §8 chain is only as trustworthy as the one Guardian that keeps it. It notes there is no way for an auditor who trusts no Guardian to check or compare chains, and it proposes three directions for later versions. Here is each one against what this Guardian does:
|
|
19
|
+
|
|
20
|
+
1. **Sign `chain_hash` under a long-lived audit key, and export it as a signed checkpoint.** Done. Every decision's receipt carries the session's `chain_hash`, `previous_hash`, and `request_hash` in its `acsStep` fact. The receipt is signed with the Guardian's long-lived Ed25519 key, which is not an ACS session key. The bundle (receipt, signed tree head, and inclusion proof) is the exported checkpoint, and it verifies offline with the Guardian's public key. The receipt carries a head for every decision, not only a periodic one.
|
|
21
|
+
2. **Guardians exchange and commit to each other's chain heads when they mediate an A2A interaction.** Not done. Nothing here sends a chain head to another Guardian or records one received. Two Guardians that append to the same log, or to logs that one witness watches, can be compared by an auditor after the fact. That is not the exchange protocol #18 describes.
|
|
22
|
+
3. **Publish signed chain heads to an external append-only log, Sigstore/Rekor style.** Done, with agent-custody's own log rather than Rekor. Each receipt is a leaf in an RFC 6962 Merkle log. When the log is run by someone else (`log: { url, keys }`), the tree head is signed by that operator's key, and the verifier checks it with `--log-key`. So a verifier learns the decision was in a log the Guardian could not rewrite. `agent-custody audit` (or `auditExtends`) checks a consistency proof (RFC 9162) between two tree heads, which shows a later head extends an earlier one. The [witness](verification.md) countersigns the log's checkpoints, so the log operator cannot show different histories to different parties. The witness is not part of example 43.
|
|
23
|
+
|
|
24
|
+
[Example 43](../examples/43-acs-guardian.ts) shows directions 1 and 3 end to end. It starts a log under a separate key. It pipes the ACS README's sample `toolCallRequest` through `agent-custody acs`. It verifies the receipt with only the Guardian's and the log's public keys. Then it checks that the log after a later deny extends the log that held the first decision.
|
|
25
|
+
|
|
26
|
+
## What it does, and what it does not prove
|
|
27
|
+
|
|
28
|
+
The Guardian decides, signs, and logs. It carries out nothing. The agent chose to ask. It reports the call in its own words, and nothing makes it honor the answer or ask at all. So a guardian receipt proves **what the Guardian decided, on what request, under which policy, and when**. It does not prove that the call happened or did not happen. The [gateway](usage.md) is the enforcement point an agent cannot skip: it holds the tool credentials and forwards the call itself. ACS supplies the hooks. agent-custody supplies the proof, and the gateway where it matters.
|
|
29
|
+
|
|
30
|
+
| ACS | receipt |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `params.metadata.agent_id` | `agent.id`, `claimed`: nothing on the wire binds it to the agent |
|
|
33
|
+
| `params.metadata.session_id`, `params.request_id` | `session.id`, `session.toolUseId`, `claimed` |
|
|
34
|
+
| `payload.tool.name` | `tool.name`, `claimed`; also the Cedar action and resource |
|
|
35
|
+
| toolCallRequest `payload.arguments` | `request.args`, `claimed`: each `{value, provenance}` unwrapped to its value |
|
|
36
|
+
| toolCallResult `exit_status`, `outputs`, `duration_ms`, `request_id_ref` | `request.args`, `claimed`: the result is what the agent submitted for a decision |
|
|
37
|
+
| the method | `issuer.framework`, e.g. `acs steps/toolCallRequest` |
|
|
38
|
+
| the decision | `policy`, `observed`; `execution.status` is `withheld` for an allow (the Guardian forwards nothing) and `denied` for a deny |
|
|
39
|
+
| `request_hash` and `chain_hash` (§8.1, §8.2) | the `acsStep` fact, `observed`: `{method, request_id, request_hash, entry_id, previous_hash, chain_hash, request_ref?}` |
|
|
40
|
+
|
|
41
|
+
The answer is an ordinary ACS result: `type: "final"`, `decision`, `reasoning`, `reason_codes` on a deny (`policy_denied` or `policy_error`), `policy_references` (the Cedar rule ids, each with its `@reason` and the policy's sha256), `chain_hash`, and `metadata.evaluator: "deterministic"`. The receipt rides in `policy_data["agent-custody"]` as `{receiptId, keyid, receipt}`. The README sample and the Guardian's answer to it both validate against the ACS `request-envelope.json`, `hooks/tool-call-request.json`, and `response-envelope.json`.
|
|
42
|
+
|
|
43
|
+
### The policy
|
|
44
|
+
|
|
45
|
+
Cedar, as everywhere else in agent-custody. The principal is `Agent::"<agent_id>"`, and the action and resource are the tool name. The context is:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
context.args the argument values (toolCallRequest), or {exit_status, outputs, duration_ms?, request_id_ref?} (toolCallResult)
|
|
49
|
+
context.acs.method "steps/toolCallRequest" | "steps/toolCallResult"
|
|
50
|
+
context.acs.capability, context.acs.operation when the payload carries them
|
|
51
|
+
context.acs.requestRef on a result with request_id_ref: {resolved, decision?, tool?, agent?, consumed?}: the decision this
|
|
52
|
+
Guardian gave that request in this session, its tool and agent, and whether a result for it was already allowed
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`examples/acs/policy.cedar` allows `file_read` under `/reports/`, and refuses any path containing `..`, because `like` matches characters, not paths: `/reports/../etc/passwd` matches `/reports/*`. The tool should resolve the path as well. The policy lets one result through, and only for a `file_read` request this Guardian allowed. A policy that permits results for several tools should compare `context.acs.requestRef.tool` with the action, or a result for one tool could ride on a request allowed for another. When a result names a `request_id_ref` the Guardian cannot resolve, the receipt records it as `resolved: false`, as ACS `hooks.md` (toolCallResult) requires, and the policy decides what that means. Everything else is denied: Cedar is default deny, and an evaluation error is a deny.
|
|
56
|
+
|
|
57
|
+
The policy file is re-read when it changes, and the next call is decided under the new one. A changed file that does not parse is refused with a message on stderr, and the policy in force stays. Each receipt names the digest of the policy it was decided under.
|
|
58
|
+
|
|
59
|
+
## Run it
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
agent-custody keygen --dir keys --name guardian
|
|
63
|
+
cp examples/acs/policy.cedar .
|
|
64
|
+
cat > acs.json <<'EOF'
|
|
65
|
+
{ "identity": { "keyFile": "keys/guardian.key" }, "policyFile": "policy.cedar", "receiptsDir": "receipts", "logFile": "log.jsonl" }
|
|
66
|
+
EOF
|
|
67
|
+
agent-custody acs --config acs.json < examples/acs/tool-call-request.json > answer.json
|
|
68
|
+
jq '.result.policy_data["agent-custody"].receipt' answer.json > receipt.json
|
|
69
|
+
agent-custody verify receipt.json --issuer-key keys/guardian.pub --log log.jsonl
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`examples/acs/tool-call-request.json` is the sample from the ACS README ("A hook, on the wire"), byte for byte. The answer is `allow`. The verifier reports `issuer kind is known (guardian / acs steps/toolCallRequest)`, `guardian receipt carries a policy decision`, `guardian decided, executed nothing`, the signature, and the log inclusion, then `RESULT: VERIFIED`. With the Guardian's own local log, as here, the tree head is signed by the Guardian's key too. For a verifier who should not have to trust the Guardian, point `log` at a log someone else runs and verify with `--log-key` as well. [Example 43](../examples/43-acs-guardian.ts) does that, then runs a denied read, a result let through, a result for an unknown request, and a consistency check of the log.
|
|
73
|
+
|
|
74
|
+
`acs` reads one JSON document from stdin, either one request or a JSON-RPC batch evaluated in order, and prints the answer. It exits 0 when every answer is a decision, deny included, and 1 when any answer is an error, such as `-32603` for a receipt that could not be written. In code, `createAcsGuardian(cfg).handle(message)` does the same with no transport, so it can sit behind any HTTP or stdio server. Calls in one session are decided one at a time, in arrival order, so concurrent calls cannot both pass the replay check or fork the chain. Calls in different sessions do not wait for each other.
|
|
75
|
+
|
|
76
|
+
A session belongs to the agent that opened it. A call that names the same `session_id` with another `agent_id` is refused with `-32000` (`SESSION_REFUSED`, `data.reason: "agent_mismatch"`), so a second caller who knows a session id cannot extend its chain or ride on its allowed requests. That binds the claimed id, not the agent. Without ACS signatures, a caller who knows both ids can still speak for the agent.
|
|
77
|
+
|
|
78
|
+
Only a decision gets a receipt. An invalid request, an unknown method, a version mismatch, a replay, an agent mismatch, and a receipt that could not be written are answered with a JSON-RPC error and leave no receipt. A `system/ping` leaves none either.
|
|
79
|
+
|
|
80
|
+
## What a verifier checks
|
|
81
|
+
|
|
82
|
+
Besides the checks every receipt gets (signature, structure, argument digest, log inclusion):
|
|
83
|
+
|
|
84
|
+
- `guardian receipt carries a policy decision`: every step is decided by policy.
|
|
85
|
+
- `guardian decided, executed nothing`: an allow is `withheld` and a deny is `denied`. A guardian receipt that says `executed` is one someone re-signed.
|
|
86
|
+
|
|
87
|
+
The TypeScript, browser, and Python verifiers all run these. `vectors/receipts.json` carries `guardian-acs-allow`, `guardian-acs-deny`, and two re-signed cases that must fail.
|
|
88
|
+
|
|
89
|
+
The verifiers do not read the `acsStep` fact. They do not recompute `chain_hash` from `previous_hash` and `request_hash`, and they do not check that one receipt's `previous_hash` is the previous receipt's `chain_hash`. The fields are signed, so nobody but the key holder can change them. But a verifier that holds a session's receipts could recompute the links itself (`acsEntryHash` does it, and the tests do it with an independent implementation). That check is not built.
|
|
90
|
+
|
|
91
|
+
Trust is by key, not by kind. A verifier accepts a `guardian` receipt signed by any key it is given as an issuer key, so the holder of a gateway's or an SDK's trusted key could sign one. Give `--issuer-key` only the Guardian's key when checking Guardian decisions.
|
|
92
|
+
|
|
93
|
+
## What it does not implement
|
|
94
|
+
|
|
95
|
+
- **The handshake (§4).** There is no `handshake/hello` and no ServerHello. Nothing negotiates versions, methods, timeouts, `on_decision_failure`, or profiles. `handshake/hello` gets `-32601`. ACS-Core requires the handshake.
|
|
96
|
+
- **ACS signatures (§10).** A request's `signature` is not checked, with HMAC or anything else, and the answer carries none. The answer therefore does not meet ACS-Core's signature requirement, and its `chain_hash` is not covered by a response signature as §8.6 requires. The receipt's own signature covers it instead. Ed25519 is not in the ACS algorithm registry (§10.1), so the receipt sits beside an ACS-Crypto signature and does not replace one.
|
|
97
|
+
- **Most of the hooks.** Only `steps/toolCallRequest` and `steps/toolCallResult` are decided, and `system/ping` is answered. The other 17 `steps/*` hooks, `protocols/MCP/*`, and `agbom/*` get `-32601`.
|
|
98
|
+
- **Dispositions other than allow and deny.** There is no `modify`, `ask`, or `defer`, and so none of the substitution rules in §6.5 and §9.2.
|
|
99
|
+
- **Replay protection (§10.3), in part.** A repeated `request_id` in a session is refused with `REPLAY_DETECTED` (`-32005`), and no second receipt is written. The timestamp skew window is not enforced, so the README sample, stamped September 2026, is accepted. Nonces are not tracked.
|
|
100
|
+
- **Provenance (§7).** Argument and output `provenance` objects are dropped before the policy sees the values. There is no trust derivation from `origin`, and no `provenance_producer`. A policy cannot express FIDES or CaMeL-style rules here.
|
|
101
|
+
- **SessionContext and Intent (§8).** The chain is kept in memory, per process, with no bound or expiry. The CLI runs one process per document, so each run starts a new chain at `previous_hash: null`. Use `handle()` in one long-lived process, or a batch, to keep a session together. There is no `provenance_summary`, no Intent, and no `CHAIN_MISMATCH` check against the agent's `session_state.chain_hash`.
|
|
102
|
+
- **Canonical JSON.** `request_hash` and `entry_hash` use agent-custody's canonical JSON (sorted keys, no whitespace). That matches RFC 8785 for ordinary JSON, but it is not a full JCS implementation: edge cases in number formatting and lone surrogates may differ. ACS publishes no chain-hash vector to check against. The tests recompute the chain with an independent implementation.
|
|
103
|
+
- **Engines.** The Guardian uses Cedar only. ACS §12.1 names OPA/Rego as its v0.1 reference engine and Cedar as v0.2. The gateway already evaluates Rego, but it is not wired in here. There is no agent (LLM) layer, which §12.2 makes optional.
|
|
104
|
+
- **Transports.** There is no HTTP server and no stdio `Content-Length` framing. The CLI reads one document from stdin.
|
|
105
|
+
- **Decision failure (§6.4).** When the receipt cannot be written, the Guardian gives no decision: it answers `-32603` with `data.reason: "receipt_not_written"`. ACS's default failure posture is `proceed`, so an agent left at that default carries on unguarded. A deployment that wants every decision on record sets `on_decision_failure: deny`.
|
|
106
|
+
- **Trace and Inspect.** No OTel or OCSF events, and no AgBOM.
|
|
107
|
+
- **Identity.** `agent_id` is whatever the wire says. ACS leaves authentication to the deployment (§11), and nothing here binds the id to the agent. For agent identity, the gateway's signed grant is the mechanism.
|