@agent-custody/receipts 0.16.2 → 0.16.4

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 CHANGED
@@ -16,6 +16,7 @@ Anyone holding the public keys can verify a receipt offline. The agent is not tr
16
16
 
17
17
  - [Reference](https://docs.agent-custody.dev/reference/): every function, endpoint, MCP tool, and command with its request and response
18
18
  - [Tutorials](docs/tutorials.md): runnable examples, one per aspect of the code, all executed by the test suite
19
+ - [Put the door in front of a site](docs/door-quickstart.md): a fifteen-minute quick start for a site owner, from keys to verified receipts.
19
20
  - [The door](docs/door.md): a receipted reverse proxy in front of your own site or API; what it knows about an arrival, how an arrival becomes a Cedar request, what the arrival gets back, and what it does not do yet
20
21
  - [The egress witness](docs/egress.md): a receipted forward proxy for calls that go around the gateway; lockdown, how the witness knows the agent, the Cedar request (or Rego input) per destination, the receipt, and what it cannot see: payloads, traffic when lockdown is off, and non-HTTP protocols
21
22
  - [Writing egress policies](../../site/guide/egress-policies.md): per-agent allow lists, wildcard hosts and the `*.example.com` trap, ports, IP literals, why a provider that needs a credential stays in the gateway, `forbid`, and rolling out from observe mode with `egress draft-policy`; every example is tested
@@ -363,7 +364,7 @@ The design is several producers feeding one verifier. The SDK is the top of the
363
364
  - The signer, keys, and checkpoints: the key in its own process (`signer`, `--signer-url`), the key document at `/.well-known/agent-custody-log.json` fetched and pinned by `verify --log-url` and `audit --log-url`, and signed checkpoints per log published to a directory and a table for a verifier who was not watching. Phase 3 of [issue #6](https://github.com/svayatta/agent-custody/issues/6).
364
365
  - The log over Postgres: `log --db-env`, leaves as hashes in one table keyed by tenant, one writer per tenant by advisory lock, tenants and hashed tokens in tables managed by `log-admin`, rate limits and a body cap, retries in the sink, and `import` for an existing file log. Phase 2 of [issue #6](https://github.com/svayatta/agent-custody/issues/6).
365
366
  - A log for someone else: `hashOnly` sends leaf hashes so the log never holds a receipt; the reference server runs several tenant logs at `/t/<tenant>/` with their own tokens and ids; tree heads name their log and the verifier checks it with `--log-id`. Phase 1 of the hosted log, [issue #6](https://github.com/svayatta/agent-custody/issues/6).
366
- - OpenTelemetry export: with `otel` in either config, every receipt is also one span at the collector the team already runs, trace id equal to the receipt id, attributes for tool, agent, principal, status, decision, and log position; after the receipt, best effort, never on the evidence path. A reconciliation receipt is marked and carries no policy decision, so a dashboard never counts it as a second allowed call.
367
+ - OpenTelemetry export: with `otel` in either config, every receipt is also one span at the collector the team already runs, trace id equal to the receipt id, attributes for tool, agent, principal, status, decision, and log position; after the receipt, best effort, never on the evidence path. A door receipt is a `SERVER` span, since it records an inbound request, and every other receipt is a `CLIENT` span. A reconciliation receipt is marked and carries no policy decision, so a dashboard never counts it as a second allowed call.
367
368
  - Delegation chains for sub-agents: a grant that names the agent's key lets it delegate a narrower grant, with the parent embedded, up to three deep; the verifier and the gateway walk the chain to the principal, refusing any link that escalates scope, widens the window, changes the principal, or is signed by the wrong key; the receipt names the sub-agent and the principal and carries the chain. Pinned by the `gateway-chain-*` vectors and mirrored in the browser verifier.
368
369
  - One gateway for many agents: `gateway --http` serves the gateway over Streamable HTTP, one session per connection under the grant that connection presents, sessions sharing the upstreams and the policy and nothing else; a platform team runs one gateway in front of the tools instead of one process per agent.
369
370
  - Splunk export: with `splunk` in either config, every receipt is also one event at the HTTP Event Collector, with the receipt id, tool, agent, principal, status, decision, and log position as searchable fields and the token from the environment; the same best-effort rule.
package/dist/check.d.ts CHANGED
@@ -25,5 +25,9 @@ export declare function isDoorConfig(configPath: string): boolean;
25
25
  export declare function permitsNamingAgentWithoutVerifiedArrival(policyText: string): string[];
26
26
  /** `agent-custody check` on a door config: what the door would fail on at startup, and what it would silently do less than the config seems to promise. */
27
27
  export declare function checkDoorConfig(configPath: string): CheckFinding[];
28
+ /** True when the file is an egress witness config: it names agents, and no upstream or origin. */
29
+ export declare function isEgressConfig(configPath: string): boolean;
30
+ /** `agent-custody check` on an egress witness config: what the witness would fail on at startup. */
31
+ export declare function checkEgressConfig(configPath: string): CheckFinding[];
28
32
  export declare function checkConfig(configPath: string, options?: CheckOptions): Promise<CheckFinding[]>;
29
33
  export declare function formatFindings(findings: CheckFinding[]): string;
package/dist/check.js CHANGED
@@ -6,7 +6,7 @@ import * as cedar from "@cedar-policy/cedar-wasm/nodejs";
6
6
  import { accessSync, constants, existsSync, mkdtempSync, readFileSync, rmSync, statSync } from "node:fs";
7
7
  import { tmpdir } from "node:os";
8
8
  import { delimiter, dirname, isAbsolute, join, resolve } from "node:path";
9
- import { DoorConfigSchema, GatewayConfigSchema, loadConfig, loadDoorConfig, strictRefusals } from "./config.js";
9
+ import { DoorConfigSchema, EgressConfigSchema, GatewayConfigSchema, loadConfig, loadDoorConfig, loadEgressConfig, ONE_LOG, strictRefusals } from "./config.js";
10
10
  import { generateKeyPair, loadPrivateKey, loadPublicKey, writeKeyPair } from "./crypto.js";
11
11
  import { delegationValidAt, verifyDelegation } from "./delegation.js";
12
12
  import { hasPermitRule } from "./policy.js";
@@ -36,6 +36,9 @@ function writableAncestor(path) {
36
36
  dir = up;
37
37
  }
38
38
  try {
39
+ // the path itself may be a file; anything above it must be a directory
40
+ if (dir !== resolve(path) && !statSync(dir).isDirectory())
41
+ return null;
39
42
  accessSync(dir, constants.W_OK);
40
43
  return dir;
41
44
  }
@@ -200,6 +203,98 @@ export function checkDoorConfig(configPath) {
200
203
  }
201
204
  return out;
202
205
  }
206
+ /** True when the file is an egress witness config: it names agents, and no upstream or origin. */
207
+ export function isEgressConfig(configPath) {
208
+ try {
209
+ const raw = JSON.parse(readFileSync(configPath, "utf8"));
210
+ return !!raw && typeof raw === "object" && !Array.isArray(raw) && "agents" in raw && !("upstream" in raw) && !("upstreams" in raw) && !("origin" in raw);
211
+ }
212
+ catch {
213
+ return false;
214
+ }
215
+ }
216
+ /** `agent-custody check` on an egress witness config: what the witness would fail on at startup. */
217
+ export function checkEgressConfig(configPath) {
218
+ const out = [];
219
+ const add = (level, check, message) => out.push({ level, check, message });
220
+ let raw;
221
+ try {
222
+ raw = JSON.parse(readFileSync(configPath, "utf8"));
223
+ }
224
+ catch (e) {
225
+ add("error", "config", `${configPath} is not readable JSON: ${e instanceof Error ? e.message : String(e)}`);
226
+ return out;
227
+ }
228
+ const known = Object.keys(EgressConfigSchema.shape);
229
+ if (raw && typeof raw === "object" && !Array.isArray(raw)) {
230
+ for (const key of Object.keys(raw)) {
231
+ if (known.includes(key))
232
+ continue;
233
+ const near = known.find((k) => distance(k.toLowerCase(), key.toLowerCase()) <= 2);
234
+ add("error", "config", `unknown key "${key}" is ignored by the egress witness${near ? `; did you mean "${near}"?` : ""} A mistyped key leaves the setting it was meant for at its default`);
235
+ }
236
+ }
237
+ const parsed = EgressConfigSchema.safeParse(raw);
238
+ if (!parsed.success) {
239
+ for (const issue of parsed.error.issues)
240
+ add("error", issue.message === ONE_LOG ? "log" : "config", `${issue.path.join(".") || "(root)"}: ${issue.message}`);
241
+ return out;
242
+ }
243
+ add("ok", "config", "the config parses");
244
+ const cfg = loadEgressConfig(configPath);
245
+ add("ok", "log", cfg.logFile ? `receipts are logged to ${cfg.logFile}` : `receipts are logged to ${cfg.log.url}`);
246
+ if (!existsSync(cfg.identity.keyFile))
247
+ add("error", "key", `${cfg.identity.keyFile} does not exist, and the witness does not start without it; \`agent-custody keygen\` creates it, and the container creates it at EGRESS_KEY before it starts the witness`);
248
+ else {
249
+ try {
250
+ loadPrivateKey(cfg.identity.keyFile);
251
+ add("ok", "key", `the witness key at ${cfg.identity.keyFile} loads`);
252
+ if (process.platform !== "win32" && (statSync(cfg.identity.keyFile).mode & 0o077) !== 0)
253
+ add("warn", "key", `${cfg.identity.keyFile} is readable by other users; make it mode 0600`);
254
+ }
255
+ catch (e) {
256
+ add("error", "key", `${cfg.identity.keyFile}: ${e instanceof Error ? e.message : String(e)}`);
257
+ }
258
+ }
259
+ const unset = cfg.agents.filter((a) => !process.env[a.secretEnv]);
260
+ for (const a of unset)
261
+ add("error", "credentials", `agent ${a.id}: the secret variable ${a.secretEnv} is not set in this environment`);
262
+ if (!unset.length)
263
+ add("ok", "credentials", cfg.agents.length === 1 ? "the agent's secret variable is set" : `the secret variables of all ${cfg.agents.length} agents are set`);
264
+ if (!existsSync(cfg.policyFile))
265
+ add("error", "policy", `${cfg.policyFile} does not exist`);
266
+ else if (isRegoFile(cfg.policyFile)) {
267
+ const errors = compileRego(readFileSync(cfg.policyFile, "utf8")).errors;
268
+ for (const e of errors)
269
+ add("error", "policy", `${cfg.policyFile}: ${e}`);
270
+ if (!errors.length)
271
+ add("ok", "policy", "the Rego policy compiles");
272
+ }
273
+ else {
274
+ const text = readFileSync(cfg.policyFile, "utf8");
275
+ const r = cedar.checkParsePolicySet({ staticPolicies: text });
276
+ if (r.type !== "success")
277
+ for (const e of r.errors)
278
+ add("error", "policy", `${cfg.policyFile}: ${e.message}`);
279
+ else if (!hasPermitRule(text))
280
+ add("warn", "policy", `${cfg.policyFile} has no permit rule, so every connection is refused`);
281
+ else
282
+ add("ok", "policy", "the policy parses");
283
+ }
284
+ if (cfg.mode === "observe")
285
+ add("warn", "mode", "observe mode relays every connection from a known agent and records what the policy would have decided; nothing is refused by policy");
286
+ if (cfg.log?.tokenEnv && !process.env[cfg.log.tokenEnv])
287
+ add("error", "credentials", `log token variable ${cfg.log.tokenEnv} is not set in this environment`);
288
+ if (cfg.splunk?.tokenEnv && !process.env[cfg.splunk.tokenEnv])
289
+ add("error", "credentials", `splunk token variable ${cfg.splunk.tokenEnv} is not set in this environment`);
290
+ for (const v of Object.values(cfg.otel?.headersEnv ?? {}))
291
+ if (!process.env[v])
292
+ add("error", "credentials", `otel header variable ${v} is not set in this environment`);
293
+ for (const f of cfg.log?.keys ?? [])
294
+ if (!existsSync(f))
295
+ add("error", "log keys", `${f} does not exist`);
296
+ return out;
297
+ }
203
298
  export async function checkConfig(configPath, options = {}) {
204
299
  const out = [];
205
300
  const add = (level, check, message) => out.push({ level, check, message });
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ import { CheckpointPublisher, fileResolver } from "./log-sink.js";
30
30
  import { createRequire } from "node:module";
31
31
  import { pruneLog } from "./retention.js";
32
32
  import { serveSidecar } from "./sidecar.js";
33
- import { checkConfig, checkDoorConfig, formatFindings, isDoorConfig } from "./check.js";
33
+ import { checkConfig, checkDoorConfig, checkEgressConfig, formatFindings, isDoorConfig, isEgressConfig } from "./check.js";
34
34
  import { serveConsole } from "./console.js";
35
35
  import { TREEHEAD_TYPE } from "./receipt.js";
36
36
  import { MerkleLog } from "./log.js";
@@ -307,7 +307,7 @@ async function main(argv) {
307
307
  const { values } = parseArgs({ args: rest, options: { config: { type: "string" }, connect: { type: "boolean", default: false }, json: { type: "boolean", default: false } } });
308
308
  if (!values.config)
309
309
  throw new Error("check needs --config");
310
- const findings = isDoorConfig(values.config) ? checkDoorConfig(values.config) : await checkConfig(values.config, { connect: values.connect });
310
+ const findings = isDoorConfig(values.config) ? checkDoorConfig(values.config) : isEgressConfig(values.config) ? checkEgressConfig(values.config) : await checkConfig(values.config, { connect: values.connect });
311
311
  console.log(values.json ? JSON.stringify(findings, null, 2) : formatFindings(findings));
312
312
  return findings.some((f) => f.level === "error") ? 1 : 0;
313
313
  }
package/dist/config.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ export declare const ONE_LOG = "exactly one of logFile or log is required";
2
3
  /** One REST endpoint offered to the agent as a tool. `{name}` segments in the path come from the call's arguments; the rest go to the query on GET and DELETE, or to a JSON body otherwise. */
3
4
  declare const RestToolSchema: z.ZodObject<{
4
5
  name: z.ZodString;
package/dist/config.js CHANGED
@@ -3,7 +3,8 @@ import { readFileSync } from "node:fs";
3
3
  import { dirname, resolve } from "node:path";
4
4
  /** Where receipts are logged: a local file, or a log reached over HTTP whose bearer token comes from an environment variable. */
5
5
  const LogSchema = z.object({ url: z.string().url(), tokenEnv: z.string().min(1).optional(), /** send leaf hashes only; the log never holds the receipt. Use it for any log run by someone else */ hashOnly: z.boolean().optional(), /** milliseconds one append may take before the log counts as unreachable; default 10000 */ timeoutMs: z.number().int().positive().optional(), /** the log's public key files; every append's answer is checked against them before a call is forwarded. Without them the log's key document is fetched from the log itself on first use and pinned, which catches a log that turns dishonest later but not one dishonest from the start; required with precommit. */ keys: z.array(z.string().min(1)).optional(), /** the id the log must write into every tree head; an answer for another log is refused */ logId: z.string().min(1).optional() });
6
- const oneLog = { message: "exactly one of logFile or log is required" };
6
+ export const ONE_LOG = "exactly one of logFile or log is required";
7
+ const oneLog = { message: ONE_LOG };
7
8
  /** Optional OpenTelemetry export: every receipt also becomes a span at this OTLP/HTTP collector, after it is issued. Never on the evidence path. */
8
9
  const OtelSchema = z.object({ url: z.string().url(), headersEnv: z.record(z.string(), z.string().min(1)).optional(), serviceName: z.string().min(1).optional() });
9
10
  const SplunkSchema = z.object({ url: z.string().url(), tokenEnv: z.string().min(1), index: z.string().min(1).optional(), source: z.string().min(1).optional(), sourcetype: z.string().min(1).optional(), host: z.string().min(1).optional() });
package/dist/log-sink.js CHANGED
@@ -9,7 +9,7 @@ import { dsseSign, dsseVerify, loadPublicKey } from "./crypto.js";
9
9
  import { createHash } from "node:crypto";
10
10
  import { leafHash, MerkleLog, verifyInclusion } from "./log.js";
11
11
  import { fileBackend, RateLimiter } from "./log-store.js";
12
- import { fetchLogKeys, localSigner } from "./signer.js";
12
+ import { fetchLogKeys, localSigner, shownUrl } from "./signer.js";
13
13
  import { adminRoutes } from "./log-admin.js";
14
14
  import { TREEHEAD_TYPE } from "./receipt.js";
15
15
  function signedHead(e, key, logId) {
@@ -46,22 +46,23 @@ export function fileLog(file, key) {
46
46
  */
47
47
  export function httpLog(url, opts = {}) {
48
48
  const f = opts.fetch ?? fetch;
49
+ const shown = shownUrl(url);
49
50
  const base = url.endsWith("/") ? url : `${url}/`;
50
51
  const attempts = opts.retries ?? 3;
51
52
  const timeoutMs = opts.timeoutMs ?? 10_000;
52
53
  let pinned = opts.keys?.length ? Promise.resolve(opts.keys) : null;
53
- const keys = () => (pinned ??= fetchLogKeys(base, f).then((r) => r.keys).catch((e) => { pinned = null; throw new Error(`log ${url}: its keys could not be fetched to check the append, and none are configured: ${e instanceof Error ? e.message : String(e)}`); }));
54
+ const keys = () => (pinned ??= fetchLogKeys(base, f).then((r) => r.keys).catch((e) => { pinned = null; throw new Error(`log ${shown}: its keys could not be fetched to check the append, and none are configured: ${e instanceof Error ? e.message : String(e)}`); }));
54
55
  const checked = async (entry, leaf) => {
55
56
  const th = dsseVerify(entry.treeHead, await keys());
56
57
  if (!th.ok || entry.treeHead.payloadType !== TREEHEAD_TYPE)
57
- throw new Error(`log ${url} answered with a tree head that does not verify against its keys${th.ok ? " (wrong payload type)" : `: ${th.error}`}`);
58
+ throw new Error(`log ${shown} answered with a tree head that does not verify against its keys${th.ok ? " (wrong payload type)" : `: ${th.error}`}`);
58
59
  const head = th.payload;
59
60
  if (opts.logId !== undefined && head.log !== opts.logId)
60
- throw new Error(`log ${url} signed a tree head for log "${head.log ?? ""}", not "${opts.logId}"`);
61
+ throw new Error(`log ${shown} signed a tree head for log "${head.log ?? ""}", not "${opts.logId}"`);
61
62
  if (head.treeSize !== entry.inclusion.treeSize)
62
- throw new Error(`log ${url} answered with a tree head of size ${head.treeSize} and a proof for size ${entry.inclusion.treeSize}`);
63
+ throw new Error(`log ${shown} answered with a tree head of size ${head.treeSize} and a proof for size ${entry.inclusion.treeSize}`);
63
64
  if (!verifyInclusion(leafHash(leaf), entry.inclusion, head.rootHash))
64
- throw new Error(`log ${url} answered with an inclusion proof that does not place this leaf under the signed root`);
65
+ throw new Error(`log ${shown} answered with an inclusion proof that does not place this leaf under the signed root`);
65
66
  return entry;
66
67
  };
67
68
  return {
@@ -80,7 +81,7 @@ export function httpLog(url, opts = {}) {
80
81
  });
81
82
  }
82
83
  catch (e) {
83
- last = `log ${url} unreachable: ${e instanceof Error ? e.message : String(e)}`;
84
+ last = `log ${shown} unreachable: ${e instanceof Error ? e.message : String(e)}`;
84
85
  if (i + 1 < attempts)
85
86
  await new Promise((r) => setTimeout(r, 200 * 2 ** i));
86
87
  continue;
@@ -88,10 +89,10 @@ export function httpLog(url, opts = {}) {
88
89
  if (res.ok) {
89
90
  const body = (await res.json());
90
91
  if (!body.inclusion || !body.treeHead)
91
- throw new Error(`log ${url} returned a malformed append result`);
92
+ throw new Error(`log ${shown} returned a malformed append result`);
92
93
  return checked(body, leaf);
93
94
  }
94
- last = `log ${url} refused the append: ${res.status} ${(await res.text()).slice(0, 200)}`;
95
+ last = `log ${shown} refused the append: ${res.status} ${(await res.text()).slice(0, 200)}`;
95
96
  if (res.status !== 429 && res.status < 500)
96
97
  break;
97
98
  if (i + 1 < attempts) {
package/dist/otel.js CHANGED
@@ -47,7 +47,7 @@ export function spanFor(p, bundle, serviceName) {
47
47
  traceId,
48
48
  spanId: traceId.slice(0, 16),
49
49
  name: reconciliation ? `${p.tool.name} reconciliation` : `${p.tool.name}`,
50
- kind: 3, // CLIENT: the agent calling out
50
+ kind: p.issuer.kind === "door" ? 2 : 3, // SERVER for an inbound request; CLIENT for the agent calling out
51
51
  startTimeUnixNano: start.toString(),
52
52
  endTimeUnixNano: (end > start ? end : start).toString(),
53
53
  attributes,
@@ -1,7 +1,7 @@
1
1
  // Adapter for Claude Code hooks (command hooks over stdin/stdout) and the Claude Agent SDK (in-process hooks).
2
2
  // Both use the same input and output JSON, so one handler serves both.
3
3
  import { reasonOfRule } from "../policy.js";
4
- import { createSdkIssuer, receiptIdOf, denies } from "./index.js";
4
+ import { createSdkIssuer, noReceipt, receiptIdOf, denies } from "./index.js";
5
5
  /** What Claude Code and the person see. A rule with a `@reason` gives its text; any other rule gives its id. The rules are in file order. A deny with no rule keeps the plain text. */
6
6
  function denialText(issuer, policy, reason, evidence) {
7
7
  if (policy.reasons.length === 0)
@@ -33,7 +33,7 @@ export async function handleHookEvent(issuer, input) {
33
33
  evidence = `receipt ${receiptIdOf(await issuer.record(ev, { status: "denied", reason }, policy))}`;
34
34
  }
35
35
  catch (e) {
36
- evidence = `no receipt: ${e instanceof Error ? e.message : String(e)}`;
36
+ evidence = noReceipt(e);
37
37
  }
38
38
  return {
39
39
  continue: true,
@@ -17,7 +17,7 @@
17
17
  // `agent-custody hook` command works through it unchanged, one process per call. This plugin is the in-process path.
18
18
  import { z } from "zod";
19
19
  import { loadSdkConfig } from "../config.js";
20
- import { createSdkIssuer, denies, receiptIdOf } from "./index.js";
20
+ import { createSdkIssuer, denies, noReceipt, receiptIdOf } from "./index.js";
21
21
  function toEvent(exec) {
22
22
  const raw = exec.arguments;
23
23
  const args = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : { input: raw ?? null };
@@ -43,7 +43,7 @@ export function deepseekHarnessHooks(issuer) {
43
43
  return { kind: "deny", reason: `agent-custody: ${reason} (receipt ${receiptIdOf(bundle)})` };
44
44
  }
45
45
  catch (e) {
46
- return { kind: "deny", reason: `agent-custody: ${reason}; the denial receipt could not be issued (${e instanceof Error ? e.message : String(e)})` };
46
+ return { kind: "deny", reason: `agent-custody: ${reason} (${noReceipt(e)})` };
47
47
  }
48
48
  },
49
49
  postExecute: async (exec, result, next) => {
@@ -47,4 +47,10 @@ export declare class PolicyDeniedError extends Error {
47
47
  constructor(tool: string, reason: string, receiptId: string);
48
48
  }
49
49
  export declare function createSdkIssuer(cfg: SdkConfig): SdkIssuer;
50
+ /**
51
+ * The end of a deny reason whose receipt could not be issued: `no receipt: <why>`. The reason reaches the model, so it
52
+ * names the failure class only; the error itself, which can carry a log URL with credentials or the text of the log's
53
+ * answer, goes to stderr.
54
+ */
55
+ export declare function noReceipt(e: unknown): string;
50
56
  export declare function receiptIdOf(bundle: ReceiptBundle): string;
package/dist/sdk/index.js CHANGED
@@ -101,6 +101,15 @@ export function createSdkIssuer(cfg) {
101
101
  },
102
102
  };
103
103
  }
104
+ /**
105
+ * The end of a deny reason whose receipt could not be issued: `no receipt: <why>`. The reason reaches the model, so it
106
+ * names the failure class only; the error itself, which can carry a log URL with credentials or the text of the log's
107
+ * answer, goes to stderr.
108
+ */
109
+ export function noReceipt(e) {
110
+ console.error(`agent-custody: no receipt: ${e instanceof Error ? e.message : String(e)}`);
111
+ return "no receipt: the receipt could not be recorded";
112
+ }
104
113
  export function receiptIdOf(bundle) {
105
114
  const st = JSON.parse(Buffer.from(bundle.envelope.payload, "base64").toString());
106
115
  return st.predicate.receiptId;
@@ -4,7 +4,7 @@
4
4
  // observeRunner: receipts only, from the runner's agent_tool_start / agent_tool_end events. Cannot block, so it
5
5
  // evaluates no policy. Use one or the other per tool, not both.
6
6
  // Typed structurally so this file does not import the package.
7
- import { receiptIdOf, denies } from "./index.js";
7
+ import { noReceipt, receiptIdOf, denies } from "./index.js";
8
8
  function parseArgs(input) {
9
9
  if (!input)
10
10
  return {};
@@ -33,8 +33,12 @@ export function wrapTools(issuer, tools) {
33
33
  const policy = issuer.decide(ev);
34
34
  if (denies(policy)) {
35
35
  const reason = [...policy.reasons, ...policy.errors].join("; ") || "no permit policy matched";
36
- const bundle = await issuer.record(ev, { status: "denied", reason }, policy);
37
- return `Denied by policy: ${reason} (receipt ${receiptIdOf(bundle)})`;
36
+ try {
37
+ return `Denied by policy: ${reason} (receipt ${receiptIdOf(await issuer.record(ev, { status: "denied", reason }, policy))})`;
38
+ }
39
+ catch (e) {
40
+ return `Denied by policy: ${reason} (${noReceipt(e)})`;
41
+ }
38
42
  }
39
43
  try {
40
44
  const result = await t.invoke(ctx, input, details);
@@ -8,7 +8,7 @@
8
8
  // import { registerOpenClaw } from "@agent-custody/receipts/sdk/openclaw";
9
9
  // export default definePluginEntry({ id: "agent-custody", name: "agent-custody", description: "A receipt for every tool call",
10
10
  // register(api) { registerOpenClaw(api, createSdkIssuer(loadSdkConfig(process.env.AGENT_CUSTODY_CONFIG!))); } });
11
- import { denies, receiptIdOf } from "./index.js";
11
+ import { denies, noReceipt, receiptIdOf } from "./index.js";
12
12
  function toEvent(event, ctx) {
13
13
  const raw = event.params;
14
14
  const args = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : { input: raw ?? null };
@@ -34,7 +34,7 @@ export function openclawHooks(issuer) {
34
34
  return { block: true, blockReason: `agent-custody: ${reason} (receipt ${receiptIdOf(bundle)})` };
35
35
  }
36
36
  catch (e) {
37
- return { block: true, blockReason: `agent-custody: ${reason}; the denial receipt could not be issued (${e instanceof Error ? e.message : String(e)})` };
37
+ return { block: true, blockReason: `agent-custody: ${reason} (${noReceipt(e)})` };
38
38
  }
39
39
  },
40
40
  after_tool_call: async (event, ctx) => {
package/dist/signer.d.ts CHANGED
@@ -57,6 +57,8 @@ export declare function serveSigner(kp: KeyPair, opts: SignerServerOptions & {
57
57
  port: number;
58
58
  host?: string;
59
59
  }): Promise<RunningSigner>;
60
+ /** The URL for an error message: no user, password, query, or fragment. */
61
+ export declare function shownUrl(url: string): string;
60
62
  /** For verifiers: the keys a log publishes, fetched from its origin and returned as key references pinned by keyid. */
61
63
  export declare function fetchLogKeys(logUrl: string, f?: typeof fetch): Promise<{
62
64
  doc: KeyDocument;
package/dist/signer.js CHANGED
@@ -29,29 +29,30 @@ export function localSigner(kp, opts = {}) {
29
29
  export async function connectSigner(url, opts = {}) {
30
30
  const f = opts.fetch ?? fetch;
31
31
  const base = url.endsWith("/") ? url : `${url}/`;
32
+ const shown = shownUrl(url);
32
33
  const headers = { "content-type": "application/json", ...(opts.token ? { authorization: `Bearer ${opts.token}` } : {}) };
33
34
  const res = await f(new URL("keys", base), { headers, signal: AbortSignal.timeout(10_000) });
34
35
  if (!res.ok)
35
- throw new Error(`signer ${url} refused the key request: ${res.status}`);
36
+ throw new Error(`signer ${shown} refused the key request: ${res.status}`);
36
37
  const doc = (await res.json());
37
38
  const current = doc.keys[0];
38
39
  if (!current)
39
- throw new Error(`signer ${url} lists no key`);
40
+ throw new Error(`signer ${shown} lists no key`);
40
41
  return {
41
42
  keyid: current.keyid,
42
43
  async sign(payloadType, payload) {
43
44
  const r = await f(new URL("sign", base), { method: "POST", headers, body: JSON.stringify({ payloadType, payload }), signal: AbortSignal.timeout(5000) });
44
45
  if (!r.ok)
45
- throw new Error(`signer ${url} refused to sign: ${r.status} ${(await r.text()).slice(0, 200)}`);
46
+ throw new Error(`signer ${shown} refused to sign: ${r.status} ${(await r.text()).slice(0, 200)}`);
46
47
  const env = (await r.json());
47
48
  if (typeof env.payload !== "string" || !Array.isArray(env.signatures))
48
- throw new Error(`signer ${url} returned a malformed envelope`);
49
+ throw new Error(`signer ${shown} returned a malformed envelope`);
49
50
  return env;
50
51
  },
51
52
  async keys() {
52
53
  const k = await f(new URL("keys", base), { headers, signal: AbortSignal.timeout(10_000) });
53
54
  if (!k.ok)
54
- throw new Error(`signer ${url} refused the key request: ${k.status}`);
55
+ throw new Error(`signer ${shown} refused the key request: ${k.status}`);
55
56
  return (await k.json());
56
57
  },
57
58
  };
@@ -118,18 +119,28 @@ export function serveSigner(kp, opts) {
118
119
  });
119
120
  });
120
121
  }
122
+ /** The URL for an error message: no user, password, query, or fragment. */
123
+ export function shownUrl(url) {
124
+ try {
125
+ const u = new URL(url);
126
+ return `${u.protocol}//${u.host}${u.pathname}`;
127
+ }
128
+ catch {
129
+ return "(a URL that does not parse)";
130
+ }
131
+ }
121
132
  /** For verifiers: the keys a log publishes, fetched from its origin and returned as key references pinned by keyid. */
122
133
  export async function fetchLogKeys(logUrl, f = fetch) {
123
134
  const res = await f(new URL("/.well-known/agent-custody-log.json", logUrl), { signal: AbortSignal.timeout(10_000) });
124
135
  if (!res.ok)
125
- throw new Error(`log ${logUrl} serves no key document: ${res.status}`);
136
+ throw new Error(`log ${shownUrl(logUrl)} serves no key document: ${res.status}`);
126
137
  const doc = (await res.json());
127
138
  if (!Array.isArray(doc.keys) || doc.keys.length === 0)
128
- throw new Error(`log ${logUrl} lists no keys`);
139
+ throw new Error(`log ${shownUrl(logUrl)} lists no keys`);
129
140
  const keys = doc.keys.map((k) => {
130
141
  const ref = publicKeyFromPem(k.publicKeyPem);
131
142
  if (ref.keyid !== k.keyid)
132
- throw new Error(`log ${logUrl} lists key ${k.keyid.slice(0, 12)} whose pem has keyid ${ref.keyid.slice(0, 12)}`);
143
+ throw new Error(`log ${shownUrl(logUrl)} lists key ${k.keyid.slice(0, 12)} whose pem has keyid ${ref.keyid.slice(0, 12)}`);
133
144
  return ref;
134
145
  });
135
146
  return { doc, keys };
package/dist/verify.js CHANGED
@@ -570,6 +570,7 @@ export function auditExtends(older, newer, proof, keys, logId, opts = {}) {
570
570
  const ISSUER_NOTE = {
571
571
  gateway: "enforced outside the agent's process; the agent could neither skip nor forge this receipt",
572
572
  sdk: "self-reported by the agent's own process; tamper-evident after issue, but nothing here was enforced outside the agent",
573
+ door: "enforced in front of the business's own HTTP surface; the arriving party could not forge this receipt and is attested only when it presented a grant, and a request that reached the origin some other way leaves no receipt",
573
574
  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
575
  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",
575
576
  };
@@ -0,0 +1,198 @@
1
+ # Put the door in front of a site
2
+
3
+ This page is for someone who runs a website or an API. In about fifteen minutes you run the door in front of a small stand-in site, write one policy for a sign-up form, and watch four arrivals: a bot that is refused and told how to pass the challenge, a bot that only claims to be an agent, a person who passes the challenge, and an agent that shows a passport. Then you verify the receipts with public keys only.
4
+
5
+ You need Node 22 or later and `curl`. The person in step 6 passes Cloudflare Turnstile with its public test keys, which needs no account but does call Cloudflare once. Everything else runs on your machine.
6
+
7
+ The door does not have its own container yet ([#258](https://github.com/svayatta/agent-custody/issues/258)), so this page runs the CLI from npm:
8
+
9
+ ```bash
10
+ alias agent-custody='npx -y -p @agent-custody/receipts@0.16.4 agent-custody'
11
+ mkdir door-quickstart && cd door-quickstart
12
+ ```
13
+
14
+ ## 1. Keys
15
+
16
+ The door signs every receipt with its own key. The principal key belongs to whoever vouches for an agent: it signs the agent's passport, and the door trusts the passports it signs.
17
+
18
+ ```bash
19
+ agent-custody keygen --dir keys --name door
20
+ agent-custody keygen --dir keys --name principal
21
+ ```
22
+
23
+ ## 2. A stand-in site
24
+
25
+ Your real site goes here later. This one answers a page on `GET /` and accepts a sign-up on `POST /form`:
26
+
27
+ ```bash
28
+ node -e 'require("http").createServer((q,s)=>{s.setHeader("content-type","text/plain");s.end(q.method==="GET"?"the sign-up page\n":"thanks, you are signed up\n")}).listen(3000,"127.0.0.1")' &
29
+ ```
30
+
31
+ ## 3. The policy
32
+
33
+ The door names each request by the route it falls under, and the policy decides per route. Anything the policy does not permit is refused. `policy.cedar`:
34
+
35
+ ```cedar
36
+ // The page is public.
37
+ permit(principal, action == Action::"page", resource);
38
+
39
+ // The form takes a person who has passed the challenge...
40
+ permit(principal, action == Action::"form", resource)
41
+ when { context.facts.arrival.challenge.outcome == "passed" };
42
+
43
+ // ...or an agent whose passport covers the form.
44
+ permit(principal, action == Action::"form", resource)
45
+ when { context.facts.arrival.class == "verified" };
46
+ ```
47
+
48
+ ## 4. The door's config
49
+
50
+ `door.json`:
51
+
52
+ ```json
53
+ {
54
+ "identity": { "keyFile": "keys/door.key" },
55
+ "origin": { "url": "http://127.0.0.1:3000" },
56
+ "routes": [
57
+ { "name": "page", "methods": ["GET"], "path": "/" },
58
+ { "name": "form", "methods": ["POST"], "path": "/form" }
59
+ ],
60
+ "trustedPrincipalKeys": ["keys/principal.pub"],
61
+ "policyFile": "policy.cedar",
62
+ "receiptsDir": "receipts",
63
+ "logFile": "log.jsonl",
64
+ "challenge": {
65
+ "provider": "turnstile",
66
+ "siteKey": "1x00000000000000000000AA",
67
+ "secretEnv": "TURNSTILE_SECRET",
68
+ "hostnames": ["example.com"]
69
+ }
70
+ }
71
+ ```
72
+
73
+ `1x00000000000000000000AA` and the secret below are Cloudflare's [test keys](https://developers.cloudflare.com/turnstile/troubleshooting/testing/): every token passes, and the answer names the host `example.com`. Check the config before you start the door; it should end with `no errors, 0 warnings`:
74
+
75
+ ```bash
76
+ export TURNSTILE_SECRET=1x0000000000000000000000000000000AA
77
+ agent-custody check --config door.json
78
+ ```
79
+
80
+ ## 5. Start the door
81
+
82
+ ```bash
83
+ agent-custody door --config door.json --port 8780 &
84
+ curl -s http://127.0.0.1:8780/
85
+ ```
86
+
87
+ ```text
88
+ the sign-up page
89
+ ```
90
+
91
+ The page went through the door, so it already has a receipt.
92
+
93
+ ## 6. Four arrivals at the form
94
+
95
+ **A bot.** It presents nothing. The policy refuses it, and the 403 says how to pass the challenge, so your page can show the widget and try again:
96
+
97
+ ```bash
98
+ curl -si -X POST http://127.0.0.1:8780/form -H 'content-type: application/json' -d '{"email":"a@example.com"}'
99
+ ```
100
+
101
+ ```text
102
+ HTTP/1.1 403 Forbidden
103
+ x-agent-custody-receipt: 454a8bef-8044-4cc7-9806-b421918507d2
104
+ x-agent-custody-class: unknown
105
+
106
+ {"error":"refused by the door's policy","reason":"no permit policy matched","receipt":"454a8bef-8044-4cc7-9806-b421918507d2","challenge":{"provider":"turnstile","siteKey":"1x00000000000000000000AA","header":"x-agent-custody-challenge"}}
107
+ ```
108
+
109
+ **A bot that says it is an agent.** A name in a header is a claim, and the door records it as one: the class is `claimed`, and no permit reads a claim:
110
+
111
+ ```bash
112
+ curl -si -X POST http://127.0.0.1:8780/form -H 'content-type: application/json' -H 'x-agent-custody-agent: shopping-agent' -d '{"email":"a@example.com"}'
113
+ ```
114
+
115
+ ```text
116
+ HTTP/1.1 403 Forbidden
117
+ x-agent-custody-class: claimed
118
+ ```
119
+
120
+ **A person.** On a real page the Turnstile widget produces a token, and the page sends it in `x-agent-custody-challenge`. The door asks Cloudflare whether it is good. With the test secret any token passes:
121
+
122
+ ```bash
123
+ curl -si -X POST http://127.0.0.1:8780/form -H 'content-type: application/json' -H 'x-agent-custody-challenge: XXXX.DUMMY.TOKEN.XXXX' -d '{"email":"a@example.com"}'
124
+ ```
125
+
126
+ ```text
127
+ HTTP/1.1 200 OK
128
+ x-agent-custody-class: unknown
129
+
130
+ thanks, you are signed up
131
+ ```
132
+
133
+ The class stays `unknown`: a passed challenge says the arrival solved a challenge, not who it is.
134
+
135
+ **An agent with a passport.** The principal signs a grant that names the agent and the routes it may use. The agent sends it, base64url-encoded, in `x-agent-custody-grant` (or as `Authorization: Bearer`):
136
+
137
+ ```bash
138
+ agent-custody grant --key keys/principal.key --principal agent-co --agent shopping-agent --scopes form --out grant.json
139
+ PASSPORT=$(node -e 'process.stdout.write(Buffer.from(require("fs").readFileSync("grant.json","utf8")).toString("base64url"))')
140
+ curl -si -X POST http://127.0.0.1:8780/form -H 'content-type: application/json' -H "x-agent-custody-grant: $PASSPORT" -d '{"email":"agent@example.com"}'
141
+ ```
142
+
143
+ ```text
144
+ HTTP/1.1 200 OK
145
+ x-agent-custody-receipt: 3e30a694-f144-4b78-9b57-a906c8777803
146
+ x-agent-custody-class: verified
147
+
148
+ thanks, you are signed up
149
+ ```
150
+
151
+ ## 7. Verify the receipts
152
+
153
+ Every arrival left a receipt in `receipts/`, refused or not, and every one is in the log. A sign-up has two: the door commits it to the log before your site hears of it, then receipts the outcome. Your receipt ids differ from the ones here; take them from the `x-agent-custody-receipt` headers.
154
+
155
+ The refused bot, checked with the door's public key and the log:
156
+
157
+ ```bash
158
+ agent-custody verify receipts/454a8bef-8044-4cc7-9806-b421918507d2.json --issuer-key keys/door.pub --log log.jsonl
159
+ ```
160
+
161
+ ```text
162
+ PASS policy decision consistent with execution (deny -> denied)
163
+ PASS log inclusion proof (leaf 2 of 3, root c1b6db0a0f60)
164
+
165
+ RESULT: VERIFIED
166
+
167
+ ISSUER: door (http), enforced in front of the business's own HTTP surface; the arriving party could not forge this receipt and is attested only when it presented a grant, and a request that reached the origin some other way leaves no receipt
168
+ ```
169
+
170
+ The agent, with the principal's key as well, so the passport is checked too:
171
+
172
+ ```bash
173
+ agent-custody verify receipts/3e30a694-f144-4b78-9b57-a906c8777803.json --issuer-key keys/door.pub --principal-key keys/principal.pub --log log.jsonl
174
+ ```
175
+
176
+ ```text
177
+ PASS delegation signature (principal key) (signed by 9ebc1bcd4701)
178
+ PASS executed tool within delegated scope (form)
179
+ PASS authorization logged before execution (authorization leaf 6, receipt leaf 7)
180
+
181
+ RESULT: VERIFIED
182
+
183
+ principal attested agent-co
184
+ agent attested shopping-agent
185
+ policy observed allow [policy2] policy fbb0e37266c4
186
+ ```
187
+
188
+ The output above is cut to the lines that matter; the full report lists every check. The request body is not in either receipt, only its digest: the door withholds by default ([what a receipt records](door.md#what-a-receipt-records-of-the-query-and-the-body)).
189
+
190
+ Stop the door and the stand-in site with `kill %1 %2`.
191
+
192
+ ## Before you put it in front of your own site
193
+
194
+ - **Use your own Turnstile keys.** Put the widget on the page that posts the form, set `siteKey`, the secret in `TURNSTILE_SECRET`, and `hostnames` to your site's hosts. A token serves one request, so the page takes a new one for each submit ([challenging a human](door.md#what-the-door-knows-about-an-arrival)).
195
+ - **Make the door the only way in.** A request that reaches your site some other way leaves no receipt. Bind the site to a private address, or have it require a header that only the door adds (`origin.headerEnv`).
196
+ - **Behind your own TLS proxy,** set `trustProxy` so the door reads the client's address, not the proxy's.
197
+ - **A passport is bearer-grade.** The door checks its signature, window, and scope, not that the sender holds the agent's key. Keep the time to live short.
198
+ - **Read [the door](door.md)** for every field of the config, and [door signals](door-signals.md) for what each fact about an arrival does and does not establish, before you write a policy for a route that matters.
package/docs/door.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The gateway stands between an agent and the tools it uses. The door stands between the world and your own HTTP surface: a website, an API, a form. Every arrival, a browser, an API client, a crawler, or an agent acting for someone, is classified by what it presented, decided by a Cedar policy for the route it hit, relayed to your origin or refused, and receipted either way. The receipt is the same signed, logged, independently verifiable receipt the gateway issues, with `issuer.kind: "door"`.
4
4
 
5
+ New to the door? [Put the door in front of a site](door-quickstart.md) walks through one form in about fifteen minutes.
6
+
5
7
  This is the first piece of the agent front door. It answers "what may this arrival do here" and "what did it do, provably". It does not yet answer "is this an agent" for web traffic: that is detection, and the door records only what it can check. Read [what the door knows](#what-the-door-knows-about-an-arrival) before writing a policy.
6
8
 
7
9
  ```bash
@@ -84,6 +86,173 @@ and a refused arrival that has not passed is told how in the 403 body: `challeng
84
86
 
85
87
  **A token serves one request.** Turnstile and hCaptcha refuse a token they have seen (`timeout-or-duplicate`, `already-seen-response`), and the door keeps no pass between requests: it does not set a cookie or remember an address. So the page must take a new token for every request it sends to a challenged route, and for every retry: call `turnstile.reset()` or `hcaptcha.reset()` after each request, and wait for the new token before the next. The door checks the token before it reads the body, so a request refused for its size (413), its path (400), or by the policy has used its token too. A second request that sends the same token is `failed`, and the person sees another 403. The outcome is a signal, not a class: a `verified` agent that also passes a challenge is still the agent its grant names, and an `unknown` arrival that passes is still `unknown`, with `challenge.outcome: "passed"` beside it. What the provider's pass means, and what it does not, is in [door signals](door-signals.md). Passkeys are not a provider here: a passkey proves possession of a credential the site registered, which is a login, not a challenge, and belongs to the origin.
86
88
 
89
+ ### A run against Turnstile's test keys
90
+
91
+ The tests stub `siteverify`. This run calls the real one once. Cloudflare publishes [test keys](https://developers.cloudflare.com/turnstile/troubleshooting/testing/) that need no account: the site key `1x00000000000000000000AA`, the secret `1x0000000000000000000000000000000AA` (validation always succeeds), the secret `2x0000000000000000000000000000000AA` (validation always fails), and the dummy token `XXXX.DUMMY.TOKEN.XXXX`. The test secrets accept only the dummy token. Cloudflare answers a test key with the hostname `example.com`, so the config names that hostname. These secrets are public. A real secret still goes only into the environment, never into the config or a flag.
92
+
93
+ The run used the CLI from this repository on 2026-11-10. `policy.cedar`:
94
+
95
+ ```cedar
96
+ // The form is for an arrival that has passed the challenge.
97
+ permit(principal, action == Action::"form", resource)
98
+ when { context.facts.arrival.challenge.outcome == "passed" };
99
+ ```
100
+
101
+ `door.json`:
102
+
103
+ ```json
104
+ {
105
+ "identity": { "keyFile": "keys/door.key" },
106
+ "origin": { "url": "http://127.0.0.1:3000" },
107
+ "routes": [{ "name": "form", "methods": ["POST"], "path": "/form" }],
108
+ "policyFile": "policy.cedar",
109
+ "receiptsDir": "receipts",
110
+ "logFile": "log.jsonl",
111
+ "challenge": {
112
+ "provider": "turnstile",
113
+ "siteKey": "1x00000000000000000000AA",
114
+ "secretEnv": "TURNSTILE_SECRET",
115
+ "hostnames": ["example.com"]
116
+ }
117
+ }
118
+ ```
119
+
120
+ A stand-in origin answers every request with `{"ok":true}`:
121
+
122
+ ```bash
123
+ agent-custody keygen --dir keys --name door
124
+ node -e 'require("http").createServer((q,s)=>{s.setHeader("content-type","application/json");s.end(JSON.stringify({ok:true}))}).listen(3000,"127.0.0.1")' &
125
+ ```
126
+
127
+ **The pass run.** Start the door with the secret that always succeeds, and send the dummy token:
128
+
129
+ ```bash
130
+ TURNSTILE_SECRET=1x0000000000000000000000000000000AA agent-custody door --config door.json --port 8780 &
131
+ curl -sS -i -X POST http://127.0.0.1:8780/form -H 'content-type: application/json' \
132
+ -H 'x-agent-custody-challenge: XXXX.DUMMY.TOKEN.XXXX' -d '{"name":"test"}'
133
+ ```
134
+
135
+ ```text
136
+ HTTP/1.1 200 OK
137
+ x-agent-custody-receipt: 74c1e645-3b3e-4306-a70c-057ea0e61d41
138
+ content-type: application/json
139
+ date: Tue, 10 Nov 2026 02:24:05 GMT
140
+ x-agent-custody-class: unknown
141
+ Connection: keep-alive
142
+ Keep-Alive: timeout=5
143
+ Transfer-Encoding: chunked
144
+
145
+ {"ok":true}
146
+ ```
147
+
148
+ **The fail run.** Stop the door. Start it again with the secret that always fails, and send the same request:
149
+
150
+ ```bash
151
+ TURNSTILE_SECRET=2x0000000000000000000000000000000AA agent-custody door --config door.json --port 8780 &
152
+ curl -sS -i -X POST http://127.0.0.1:8780/form -H 'content-type: application/json' \
153
+ -H 'x-agent-custody-challenge: XXXX.DUMMY.TOKEN.XXXX' -d '{"name":"test"}'
154
+ ```
155
+
156
+ ```text
157
+ HTTP/1.1 403 Forbidden
158
+ x-agent-custody-receipt: 01b840df-6a79-408a-9d3b-32dac88787d8
159
+ content-type: application/json
160
+ cache-control: no-store
161
+ x-agent-custody-class: unknown
162
+ Date: Tue, 10 Nov 2026 02:24:13 GMT
163
+ Connection: keep-alive
164
+ Keep-Alive: timeout=5
165
+ Transfer-Encoding: chunked
166
+
167
+ {"error":"refused by the door's policy","reason":"no permit policy matched","receipt":"01b840df-6a79-408a-9d3b-32dac88787d8","challenge":{"provider":"turnstile","siteKey":"1x00000000000000000000AA","header":"x-agent-custody-challenge"}}
168
+ ```
169
+
170
+ **Verify both receipts.** Both exit 0:
171
+
172
+ ```bash
173
+ agent-custody verify receipts/74c1e645-3b3e-4306-a70c-057ea0e61d41.json --issuer-key keys/door.pub --log log.jsonl
174
+ ```
175
+
176
+ ```text
177
+ PASS receipt signature (issuer key) (keyid e316d40ebc50)
178
+ PASS receipt payload type
179
+ PASS structural parts in clear
180
+ PASS issuer kind is known (door / http)
181
+ PASS issuer keyid matches signer
182
+ PASS door receipt carries a policy decision
183
+ PASS principal is claimed, not attested (no signed delegation in this receipt)
184
+ PASS request args digest (committed, not recomputed: 1 value(s) withheld; disclose them to recompute)
185
+ PASS execution result digest
186
+ PASS withheld facts.arrival.resultDigest (committed, not recomputed: 1 value(s) withheld; disclose them to recompute)
187
+ PASS policy decision consistent with execution (allow -> executed)
188
+ PASS no policy errors on an allow
189
+ PASS authorization signature (issuer key) (keyid e316d40ebc50)
190
+ PASS authorization names this call (form for receipt 74c1e645-3b3)
191
+ PASS authorization tree head signature (keyid e316d40ebc50)
192
+ PASS authorization log inclusion proof (leaf 0 of 1)
193
+ PASS authorization logged before execution (authorization leaf 0, receipt leaf 1)
194
+ PASS tree head signature (issuer key e316d40ebc50)
195
+ PASS tree head matches inclusion proof size
196
+ PASS log inclusion proof (leaf 1 of 2, root 67f4115b31c2)
197
+ PASS log file root matches tree head (recomputed 67f4115b31c2)
198
+
199
+ RESULT: VERIFIED
200
+
201
+ ISSUER: door (http), unknown issuer kind
202
+
203
+ field provenance value
204
+ principal claimed (none)
205
+ agent claimed unknown
206
+ model claimed (none supplied)
207
+ tool observed form
208
+ args claimed {"$rest":{"$custody":"withheld","sha256":"8f41daf2…"},"bodyBytes":15,"headers":{"accept":"*/*","content-type":"application/json","host":"127.0.0.1:8780","user-agent":"curl/8.7.1"},"method":"POST","path":"/form"}
209
+ fact.arrival observed {"challenge":{"outcome":"passed","provider":"turnstile"},"class":"unknown","grant":"absent","method":"POST","path":"/form","rate":{"burst":1,"by":"remote","minute":1},"remote":"127.0.0.1","route":"form","signature":false,"subject":"unknown"}
210
+ policy observed allow [policy0] policy 71e3eefa3599
211
+ authorization observed committed to the log as leaf 0, before the call was forwarded
212
+ execution observed executed
213
+ ```
214
+
215
+ ```bash
216
+ agent-custody verify receipts/01b840df-6a79-408a-9d3b-32dac88787d8.json --issuer-key keys/door.pub --log log.jsonl
217
+ ```
218
+
219
+ ```text
220
+ PASS receipt signature (issuer key) (keyid e316d40ebc50)
221
+ PASS receipt payload type
222
+ PASS structural parts in clear
223
+ PASS issuer kind is known (door / http)
224
+ PASS issuer keyid matches signer
225
+ PASS door receipt carries a policy decision
226
+ PASS principal is claimed, not attested (no signed delegation in this receipt)
227
+ PASS request args digest (committed, not recomputed: 1 value(s) withheld; disclose them to recompute)
228
+ PASS withheld facts.arrival.resultDigest (committed, not recomputed: 1 value(s) withheld; disclose them to recompute)
229
+ PASS withheld execution.reason (committed, not recomputed: 1 value(s) withheld; disclose them to recompute)
230
+ PASS policy decision consistent with execution (deny -> denied)
231
+ PASS no policy errors on an allow
232
+ PASS tree head signature (issuer key e316d40ebc50)
233
+ PASS tree head matches inclusion proof size
234
+ PASS log inclusion proof (leaf 2 of 3, root 54a065656fa2)
235
+ PASS log file root matches tree head (recomputed 54a065656fa2)
236
+
237
+ RESULT: VERIFIED
238
+
239
+ ISSUER: door (http), unknown issuer kind
240
+
241
+ field provenance value
242
+ principal claimed (none)
243
+ agent claimed unknown
244
+ model claimed (none supplied)
245
+ tool observed form
246
+ args claimed {"$rest":{"$custody":"withheld","sha256":"255b518c…"},"bodyBytes":15,"headers":{"accept":"*/*","content-type":"application/json","host":"127.0.0.1:8780","user-agent":"curl/8.7.1"},"method":"POST","path":"/form"}
247
+ fact.arrival observed {"challenge":{"error":"invalid-input-response","outcome":"failed","provider":"turnstile"},"class":"unknown","grant":"absent","method":"POST","path":"/form","rate":{"burst":1,"by":"remote","minute":1},"remote":"127.0.0.1","route":"form","signature":false,"subject":"unknown"}
248
+ policy observed deny [] policy 71e3eefa3599
249
+ execution observed denied: (reason withheld under the capture rule)
250
+ ```
251
+
252
+ The pass run's receipt records `challenge.outcome: "passed"`, and the door relayed the request. The fail run's receipt records `challenge.outcome: "failed"` with Cloudflare's code `invalid-input-response`, and the policy refused the request. The token does not appear in either receipt.
253
+
254
+ **What this run shows, and what it does not.** Test keys prove the wire path, not bot detection. The door reaches the real `siteverify`, sends the secret and the token, and records the answer. A test secret gives a fixed answer and no widget runs, so the run says nothing about how well Turnstile tells a person from a bot. The run did not exercise the `unavailable` outcome, a hostname mismatch, an action mismatch, the `timeout-or-duplicate` code, or `remoteip` (the config sets no `trustProxy`, so the door sent none). `test/door.test.ts` covers those against a stubbed `siteverify`. In the output above, the two `sha256` digests are shortened to eight characters and `…`. Nothing else is changed. The CLI was `agent-custody` 0.16.2, run from this repository at commit `64285ef`. That version had no note for door receipts, so its `ISSUER` lines end with `unknown issuer kind`; later versions say what a door receipt proves there: the arriving party could not forge it and is attested only when it presented a grant, and a request that reached the origin some other way leaves no receipt.
255
+
87
256
  ## How an arrival becomes a Cedar request
88
257
 
89
258
  | Cedar slot | value |
package/docs/egress.md CHANGED
@@ -44,6 +44,8 @@ Each receipt is an **observed bypass**: evidence that the agent connected to a d
44
44
 
45
45
  Run it with `agent-custody egress --config egress.json [--port 8791] [--host 127.0.0.1]`.
46
46
 
47
+ `agent-custody check --config egress.json` reports what it can find before the witness starts: unknown keys; a key file that is missing or does not load (the witness does not start without it); an unset secret variable of an agent, and an unset `log.tokenEnv`, `splunk.tokenEnv`, or `otel.headersEnv` variable (by name, never the value); a missing `log.keys` file; a policy that does not exist, a Cedar policy that does not parse, or a Rego policy that does not compile (this needs `opa` on PATH, as the witness does); and that exactly one of `logFile` and `log` is set. It warns on a key file that other users can read, a Cedar policy with no permit rule, and `mode: "observe"`. It exits 1 on an error.
48
+
47
49
  ## How an agent uses it
48
50
 
49
51
  The agent sets `HTTPS_PROXY` and `HTTP_PROXY` to `http://<agent id>:<secret>@<witness>:8791`, and `NO_PROXY` to the gateway's host, because the gateway receipts its own calls. Most HTTP clients send the credential from the URL as `Proxy-Authorization: Basic`. Node's `fetch` reads these variables when `NODE_USE_ENV_PROXY=1` is set, on versions that support it. Other clients need their own proxy setting.
@@ -171,7 +173,6 @@ Vectors `egress-*` and `resigned-egress-*` in `vectors/receipts.json` cover them
171
173
 
172
174
  - Record the byte counts of a connection open when the witness is killed: the committed authorization is in the log, the closing receipt is not.
173
175
  - Identify an agent by its source address or by a signed grant. Today only per-agent proxy credentials identify an agent.
174
- - `agent-custody check` does not read an egress config yet.
175
176
  - Ask an OPA server for the decision. A `.rego` file works; `opa: { url }` does not, because the decision is made synchronously before the relay.
176
177
 
177
178
  Tutorials: [41-egress.ts](../examples/41-egress.ts), and [44-egress-rego.ts](../examples/44-egress-rego.ts) for a Rego policy.
@@ -20,7 +20,7 @@ jobs:
20
20
  runs-on: ubuntu-latest
21
21
  steps:
22
22
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
23
- - uses: svayatta/agent-custody@<commit sha of the release> # 0.16.2
23
+ - uses: svayatta/agent-custody@<commit sha of the release> # 0.16.4
24
24
  with:
25
25
  path: .custody/receipts
26
26
  issuer-key: .custody/keys/agent.pub
@@ -37,7 +37,7 @@ Pin the action to the commit of a release, as you pin every other action. A movi
37
37
  | `principal-key` | the public key files of the principals whose grants a gateway receipt carries, one path on each line; SDK and Claude Code hook receipts need none | |
38
38
  | `log-url` | the URL of the log; the action fetches the log key from it (`verify --log-url`) | |
39
39
  | `log-id` | the id that every tree head must name (`verify --log-id`) | |
40
- | `version` | the `@agent-custody/receipts` version that `npx` runs | `0.16.2` |
40
+ | `version` | the `@agent-custody/receipts` version that `npx` runs | `0.16.4` |
41
41
  | `github-token` | a token that can write pull request comments; an empty value writes the job summary only | `github.token` |
42
42
  | `comment-author` | the login of the account that `github-token` posts as; the action edits only a comment from this account | `github-actions[bot]` |
43
43
 
package/docs/sdk.md CHANGED
@@ -120,6 +120,8 @@ A rule with no annotation gives its id in place of the reason: `agent-custody de
120
120
 
121
121
  The receipt does not change. It keeps the policy ids and the policy digest, and its `execution.reason` stays the list of ids. The reason text is for the agent and for the person who reads the session. The other adapters in this file still return the rule ids.
122
122
 
123
+ When the denial receipt cannot be issued, the call is blocked all the same, and the reason ends with `(no receipt: <why>)` in place of the receipt id. `<why>` names the kind of failure and nothing more. In TypeScript it is `the receipt could not be recorded`. In Python it is `the sidecar could not be reached`, `the sidecar answered HTTP <status>`, `the sidecar refused the request`, `the sidecar's answer was malformed`, or `an unexpected <exception type>`. The reason goes into the model's context, and the error behind it can carry a log or sidecar URL with credentials in it, or the text of an upstream answer. So the error itself goes to stderr in TypeScript and to the `agent_custody` logger at `WARNING` in Python, never into the reason, and the URL in it is shown without its user, password, or query string. Every adapter that answers a deny with text works this way: Claude Code, the Claude Agent SDK and OpenAI Agents in both languages, OpenClaw, DeepSeek Harness, Hermes, Google ADK, and CrewAI. OpenAI Agents in both languages and CrewAI used to raise the error when the denial receipt failed; they now return the denial text, as the others do, and the tool still does not run. The Vercel AI `wrapTools` and `issuer.wrap` throw `PolicyDeniedError`, which needs a receipt id, so there a failed denial receipt still rejects with the log's error.
124
+
123
125
  ### The report
124
126
 
125
127
  ```bash
package/docs/usage.md CHANGED
@@ -125,7 +125,7 @@ At startup the gateway fetches the agent's card from `<url>/.well-known/agent-ca
125
125
 
126
126
  Exactly one of the two. The bearer token comes from the named environment variable, never from the file, and a missing variable fails at startup. Add `"hashOnly": true` for any log run by someone else: the gateway then sends only the leaf hash, sha256 of the receipt envelope with the RFC 6962 prefix, so the log commits to the receipt without ever holding it, and the receipts with their arguments and results stay in `receiptsDir`. The verifier does not change; it hashes the envelope itself. A log that serves several tenants is reached at `<url>/t/<tenant>/`, and each of its tree heads names its log, which a verifier checks with `--log-id`. With a remote log the tree head in each receipt is signed by the log's key, and a verifier must be given that key with `--log-key`. The gateway does not take the log's answer on trust either: the tree head in every append's answer must verify against the log's keys, name the expected log, match the proof's size, and the inclusion proof must place that very leaf under the signed root, all before a pre-committed call is forwarded and before any receipt is handed out; an answer that fails any of it is a refusal. `"keys": ["keys/log.pub"]` pins the log's public keys, `"logId"` the id its heads must carry; without `keys` the log's key document at `/.well-known/agent-custody-log.json` is fetched from the log itself once, on the first append, and pinned. That catches a log that turns dishonest later, not one that is dishonest from the start, so a gateway config with `precommit` and a remote log must list `keys`. When the log rotates its key, add the new public key to `keys`; a gateway that fetched the keys needs a restart. An append that gets no answer within `timeoutMs` (default 10000) counts as unreachable and is retried like a server error, so a log that accepts connections and never answers cannot hold a call forever. If the log does not take a receipt, the gateway keeps the signed receipt in `receipts/outbox/<receiptId>.json` and returns the real outcome of the call to the agent, with the receipt id and `_meta["agent-custody/log-pending"]: true`. The gateway appends the outbox at startup and every 30 seconds, and writes `receipts/<receiptId>.json` when the log takes the receipt. Until then no bundle exists, so no receipt that was never logged is handed out. The table [below](#when-the-log-fails) gives each case. For a tool named in `precommit` the order is reversed, below, and the action never happens. A fact lookup is different: it runs before the policy decides, because the policy decides on it, and only once the intercepted tool is in the grant's scope, so a fact tool must be a read. Naming a fact tool in `precommit` is refused at startup; `"*"` covers the tools the agent calls, not the gateway's own lookups. Every lookup is on the receipt with its arguments. The reference log server is `node src/cli.ts log --file log.jsonl --key keys/log.key --port 8787 --token-env AGENT_CUSTODY_LOG_TOKEN [--log-id <id>] [--tenants tenants.json]`. It serves `POST /append` with `{leaf}` or `{leafHash}` (token required when one is configured), `GET /root?size=N`, `GET /consistency?old=M&new=N`, and `GET /head`; [verification.md](verification.md) says what each proves. `--log-id` writes that id into every tree head. `--tenants` names a JSON file, `{ "acme": { "file": "acme.jsonl", "tokenEnv": "ACME_TOKEN", "logId": "acme-eu" } }`, and each tenant is its own log at `/t/acme/…` with its own token and id; the default log stays at the root paths. With `--hash-only` the server refuses `{leaf}` at append and accepts only `{leafHash}`, so a log run for other people never receives a receipt regardless of the client's configuration; the hosted deployment sets it. With `--db-env DATABASE_URL` the server keeps its logs in Postgres instead of files, and needs the `pg` package beside it: leaves as hashes in one table keyed by tenant, one writer per tenant enforced with an advisory lock so a second instance is safe, tenants and their tokens in tables of their own with tokens stored only as hashes, and rate limits per token (50 appends a second, burst 100, a 64 KB body cap; a refused append answers 429 with `retry-after`, and the gateway's sink retries a few times). Tenants are managed with `log-admin --db-env DATABASE_URL`: `tenant add <id> [--log-id <id>]`, `token add <tenant> --label <text>` (the token is printed once), `token revoke <tenant> <hash-prefix>`, `tenant disable <id>`, `tenant plan <id> <free|team|enterprise>`, and `import --file log.jsonl [--tenant default]` to bring an existing file log in as hashes. Every tenant is on a plan, `free` unless moved: free allows ten thousand appends a calendar month, team a million, enterprise has no allowance. An append past the allowance is refused with 429, the numbers, and a `retry-after` that reaches the start of next month; the gateway behind it then withholds pre-committed calls and financial operations, so a tenant out of quota never acts on those without evidence. Any other call is forwarded, and its receipt waits in the outbox ([below](#when-the-log-fails)). The tenant's own `GET /t/<name>/usage` reports the plan and quota beside the month's appends. The tenant portal, `agent-custody portal --db-env DATABASE_URL --secret-env PORTAL_SECRET --public-url <log url> [--checkpoints-url <url>] [--portal-url <url>] [--stripe-key-env NAME --stripe-webhook-env NAME --stripe-price-team <price id>] [--trust-proxy]`, is the self-serve front of the same tables: a team registers with an email, a password (scrypt), and a tenant id and gets the tenant and its first key shown once with the welcome sheet; the dashboard shows appends against the plan, the tree size and root, the latest checkpoint, the log's URLs, keys, and the audit rows; keys are minted and revoked there, recorded as `portal:<email>`; the export command is on the page; and with the three Stripe variables the team plan is bought through Stripe Checkout, the signed webhook moving the plan (`stripe:<event>` in the audit trail) and the customer portal handling cancellation. Sessions are a signed cookie, `SameSite=Strict`, and every write needs a JSON body. Each member has a role (`owner`, `admin`, `reviewer`, `readonly`), an account can turn on TOTP MFA, and the operator can set up single sign-on through the tenant's own OIDC or SAML identity provider with `log-admin sso set`; the [hosted log reference](https://docs.agent-custody.dev/reference/hosted) lists the routes. SAML needs `@node-saml/node-saml` beside the CLI. The compose file runs it as the `portal` service at `PORTAL_HOST`. The root paths serve the tenant `default`, created on first start with `--log-id`, and `--token-env` still works for it. The key that signs tree heads can live in its own process: `agent-custody signer --key keys/log.key --port 8790 --token-env SIGNER_TOKEN` holds it and answers `POST /sign` with the shared secret and `GET /keys` to anyone; the log server then runs with `--signer-url http://signer:8790/ --signer-token-env SIGNER_TOKEN` instead of `--key`, and the process that faces the internet never holds the key. Either way the log serves its keys at `/.well-known/agent-custody-log.json`, current key first and retired keys (`--retired-key old.pub`) after it, so verifiers fetch and pin them with `verify --log-url` and `audit --log-url` rather than receiving a key file from the operator. With `--checkpoint-dir <dir>` the server publishes a signed checkpoint, every `--checkpoint-every` seconds (default 300), for each log whose tree has grown, and every `--checkpoint-heartbeat` seconds (default 21600, six hours) for a log that has not, so a quiet log's latest checkpoint is never more than six hours old and the monitor can tell quiet from stalled, as `<dir>/<tenant>/<treeSize>.json` and `latest.json`, and with a database also as rows; `GET /checkpoints?since=<size>` and `GET /t/<tenant>/checkpoints` list them. Serve the directory read-only from a second host, so the record of what the log signed does not depend on the log's API being up; a verifier who kept an earlier head audits against a later checkpoint with `audit --older <bundle> --newer <checkpoint> --log-url <url>`. With `--admin-token-env ADMIN_TOKEN` (Postgres only) the server also serves the operator's page at `/admin` and its API under `/admin/`: list and create tenants, mint a token that is shown once beside the tenant's welcome sheet, revoke tokens, disable tenants. Everything under `/admin`, the page included, needs the admin token: the browser asks for it (any user name, the token as the password) and an API client sends it as a bearer; a handful of wrong attempts from one address are throttled for a minute. Every change made there or with `log-admin` is recorded: who (the name entered at the browser prompt and the address, `bearer` for an API client, or the user and host for the command line), what (`tenant.add`, `tenant.disable`, `token.add`, `token.revoke`), which tenant, and the detail, never the token itself; the page shows it under Activity, `GET /admin/audit?tenant=&limit=` and `log-admin audit` list it, and a tenant reads their own rows at `GET /t/<name>/audit` with their token. Nothing else is stored by the page. Behind a reverse proxy, start the server with `--trust-proxy` so those per-address limits key on `X-Forwarded-For` instead of on the proxy's own address, and only there, since the header is otherwise the client's to forge. `--public-url` and `--checkpoints-url` fill the sheet in. The witness closes the last gap: `agent-custody witness --key witness.key --log-url <url> --checkpoints-url <url> --out <dir> [--tenant <name>]...` runs on a machine the log's operator does not control, fetches each watched log's latest checkpoint, verifies it against the log's published keys, proves with the log's consistency proof that it extends the last head the witness signed, and countersigns it into `<dir>/<tenant>/<size>.json` and `latest.json`; a checkpoint that does not extend, or a second history at the same size, gets `ALARM.json` instead. Its key document is `<dir>/.well-known/agent-custody-witness.json`. Serve `<dir>` from the witness's own host; verifiers add `--witness-url` (or `--witness-key`) to `audit`, and the newer head must then carry the witness's signature. Two more things an operator needs. `agent-custody log-check --log-url <url> --checkpoints-url <url> [--witness-url <url>] [--tenant <name>]... [--max-lag <seconds>]` is the outside monitor: it verifies the head against the published keys, that the latest checkpoint verifies and keeps up with the head, that the head extends the checkpoint, and, with a witness, that the witness has countersigned, keeps up, and has raised no alarm; it exits 1 on any failure, so cron or a scheduled workflow on a machine that is not the log's turns it into an alert. `GET /health` on the server is the liveness check for a load balancer. And `GET /admin/usage?month=YYYY-MM`, on the admin page and as `/admin/usage.csv`, is the metering: appends per tenant for the month, leaves in total, live tokens, the numbers any invoice rests on. A tenant needs none of that to leave with their evidence: `agent-custody log-export --log-url <url> --tenant <name> --token-env AGENT_CUSTODY_LOG_TOKEN --out <dir>` fetches, with their own token, every leaf hash (`GET /t/<name>/leaves?since=&limit=`, pages of up to ten thousand), the signed head, the published keys, the signed checkpoints, their own usage (`GET /t/<name>/usage?month=`), and the administrative actions on their tenant (`GET /t/<name>/audit`, into `audit.json`), checks that the head and every checkpoint verify against the keys and that the leaves fetched hash to their roots, and writes `log.jsonl` in the format `verify --log` and `audit --log` read, so the export verifies receipts with no server at all. It exits 1 and says what did not add up if anything does not. Both routes answer only to that tenant's token. [deploy/](../../deploy/README.md) runs the server, the signer, Postgres, and the checkpoints host as containers, and [deploy/witness/](../../deploy/witness/) the witness.
127
127
 
128
- `otel`, optional in both the gateway and SDK configs, sends every receipt to the collector you already run as one span over OTLP/HTTP, after the receipt is issued: `"otel": { "url": "http://localhost:4318", "headersEnv": { "x-api-key": "OTEL_KEY" }, "serviceName": "support-agents" }`. The span's trace id is the receipt id, its attributes carry the tool, agent, principal, execution status, policy decision, and log position, and its status is an error only when the upstream failed or errored, since a denial is the policy working. Export is best effort: a collector that is down or refuses costs a line on stderr, never a receipt. Tutorial 18 shows it against a stand-in collector.
128
+ `otel`, optional in both the gateway and SDK configs, sends every receipt to the collector you already run as one span over OTLP/HTTP, after the receipt is issued: `"otel": { "url": "http://localhost:4318", "headersEnv": { "x-api-key": "OTEL_KEY" }, "serviceName": "support-agents" }`. The span's trace id is the receipt id, its attributes carry the tool, agent, principal, execution status, policy decision, and log position, and its status is an error only when the upstream failed or errored, since a denial is the policy working. A door receipt records an inbound request, so its span kind is `SERVER`; every other issuer's span is `CLIENT`. Export is best effort: a collector that is down or refuses costs a line on stderr, never a receipt. Tutorial 18 shows it against a stand-in collector.
129
129
 
130
130
  `splunk`, optional in both configs and usable beside `otel`, sends every receipt to a Splunk HTTP Event Collector as one event: `"splunk": { "url": "https://splunk.example.com:8088", "tokenEnv": "HEC_TOKEN", "index": "agents" }`, with optional `source` (default `agent-custody`), `sourcetype` (default `agent-custody:receipt`), and `host`. The token is read from the named environment variable at startup and never appears in the config. Each event carries `receipt_id`, `tool`, `agent`, `principal`, `status`, `reason`, `policy_decision`, `policy_digest`, `args_digest`, `log_leaf_index`, `log_tree_size`, and `authorization_leaf_index` as plain fields, so a search like `sourcetype="agent-custody:receipt" status=denied` needs no field extraction and every alert leads to the receipt by id. The same rule holds: the event is a copy, the receipt is the evidence, and a collector outage costs a warning. Tutorial 19 shows it.
131
131
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-custody/receipts",
3
- "version": "0.16.2",
3
+ "version": "0.16.4",
4
4
  "mcpName": "io.github.svayatta/agent-custody",
5
5
  "description": "Proof of what your AI agents did. Give your agents real power, without losing control of them: signed, verifiable receipts for tool calls, an MCP gateway with Cedar or Rego policy, and a Merkle transparency log.",
6
6
  "license": "Apache-2.0",