What an agent did, and on whose instruction
A worked example, end to end: a support agent's run is recorded as it happens, closed, and handed to the customer's auditor, who checks it without asking anyone.
Northwind Robotics runs a support agent that can read a customer's ticket, look up the refund policy, approve a refund under a limit, and email the customer. A customer later disputes what the agent did. This example records one run so that the question has one answer.
What gets recorded
One record per run. The first entry names the run and carries the fingerprint of the instruction. Then one entry per action, in order. Then the close.
| Entry | Title | kind | payloads |
|---|---|---|---|
| 1 | Support run for ticket 4471, 15 September | agent-run | The instruction the agent was given |
| 2 | Read the refund policy, version of 12 September | read | The policy as read |
| 3 | Refund of 240.00 approved under the 250.00 limit | decision | The decision as written |
| 4 | Closed ticket 4471 and emailed the customer | ticket-close | The email as sent |
| 5 | Run finished | agent-run-close, lifecycle: 'closed' | The run's summary |
The code
The harness runs the agent loop, holds the key, and writes each entry after the action it records. The model never sees the key.
import { PacSpace, fingerprint } from '@pacspace-io/sdk';
const pac = new PacSpace({ apiKey: process.env.PACSPACE_API_KEY! });
const record = `run-${runId}`;
const actorId = 'support-agent-3';
const instructedBy = 'j.alvarez';
// 0. The run opens.
await pac.records.emit({
record,
title: `Support run for ticket ${ticketId}, 15 September`,
kind: 'agent-run',
occurredAt: startedAt,
actorId,
instructedBy,
payloads: [await fingerprint(instructionBytes)],
idempotencyKey: `${record}:open`,
});
// 1. What the agent read.
await pac.records.emit({
record,
title: 'Read the refund policy, version of 12 September',
kind: 'read',
occurredAt: readAt,
actorId,
instructedBy,
payloads: [await fingerprint(policyBytes)],
idempotencyKey: `${record}:step-1`,
});
// 2. What it decided.
await pac.records.emit({
record,
title: 'Refund of 240.00 approved under the 250.00 limit',
kind: 'decision',
occurredAt: decidedAt,
actorId,
instructedBy,
payloads: [await fingerprint(decisionBytes)],
idempotencyKey: `${record}:step-2`,
});
// 3. What it did.
await pac.records.emit({
record,
title: `Closed ticket ${ticketId} and emailed the customer`,
kind: 'ticket-close',
occurredAt: closedAt,
actorId,
instructedBy,
payloads: [await fingerprint(emailBytes)],
idempotencyKey: `${record}:step-3`,
});
// 4. The run closes. Nothing can be added after this.
await pac.records.emit({
record,
title: 'Run finished',
kind: 'agent-run-close',
lifecycle: 'closed',
occurredAt: finishedAt,
actorId,
instructedBy,
payloads: [await fingerprint(summaryBytes)],
idempotencyKey: `${record}:close`,
});Each write answers QUEUED. The harness listens for record.committed at its webhook, or reads the history, and stores each entry's number against the step.
Handing it over
The customer's auditor asks what the agent did. Northwind shares the run's record and sends the code by phone.
curl -X POST https://app.pacspace.io/api/v1/records/machine-action-record/run-8f2c/share \
-H "x-api-key: $PACSPACE_API_KEY" -H "Content-Type: application/json" \
-d '{ "sharedWith": "the customer'"'"'s auditor", "expiresInDays": 30 }'The auditor opens the link, enters the code, and the record opens with the check already run: "This record has 5 entries and is closed. All 5 are here, and all 5 match what was committed. Closed 15 September 2026, 16:05 UTC. Nothing can be added after this." Each entry shows what was written, its seal, "Written by Northwind Robotics, harness key", and "support-agent-3 is who acted. It does not hold this key."
The auditor was also given the email the customer received. They drop it on the page, the browser fingerprints it, and the page says "This file matches an entry in the record." They press "Record that you checked this", and the record now carries "Acknowledged through the link issued to the customer's auditor, 20 September. Entry 5 was checked and it matched."
What the record answers
- What did the agent do, in what order? Entries 1 to 3, with their times.
- On whose instruction?
instructedBy: j.alvarez, sealed with every entry. - What version of the policy did it have? The fingerprint in entry 2; the auditor can be handed the policy file and check it the same way.
- Did anything happen after the run ended? The record is closed; an attempt after the close would be in it, marked.
- Could Northwind have edited any of this afterward? No. The auditor's browser recomputed every seal, without asking Northwind or PacSpace.
What it does not answer
Whether the refund was the right call. The record shows the agent approved 240.00 under a 250.00 limit and cites the policy it read. Whether the policy was right, or the agent read it correctly, is for the people who read the record. The check shows the record is unchanged since it was committed. It does not show that what was recorded was true.