Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 58 additions & 23 deletions docs/data/boundary.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/design/decisions/README.md

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions docs/design/decisions/ws-090-the-agent-run-statement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
schema: 1
id: "ws-090"
title: "The agent-run statement"
state: "decided"
area: "D5"
source:
issue: "INTENTIUS/chant#3192"
row: "agent-run statement signed by a runner or steward key (DSSE)"
revision: null
question: "How does a runner or steward vouch for an agent run, so that a reader can tell a run it vouched for from a run whose writer only reported itself: what does the signed statement assert, which keys may sign it, where is it kept, and how do runs, runs verify and workspace verify use it?"
options:
- id: "a"
label: "an in-toto statement over the run record's hash in a DSSE envelope, signed by a runner key trust.json lists, kept as a statement line in the run's ledger file"
how: "The statement's subjects are the commits the run made, each by gitCommit with its patch-id as an annotation; the predicate (https://intentius.io/chant/agent-run/v1) holds the signer's principal, the run id and the SHA-256 of the canonical JSON of its start and end lines, and the unit, harness, model, provider and the principal the run worked for. It is signed with an Ed25519 key .chant/trust.json lists at base under runners, the keys runner evidence uses (ws-069), class runner or service; a key the signers file lists is refused. chant workspace runs sign <id> --key signs here; runs statement <id> --signer prints the payload for a signer that keeps its key elsewhere, and runs sign <id> --envelope checks and stores what it returns. The envelope is appended to _agent-runs/<id>.jsonl on chant/lifecycle as a statement line after the end. runs --json gives each run its record hash, its statements and an attestation judged against the keys at base; runs verify reports and fails only with --require signed; workspace verify counts a commit a signed run made as attested by the agent-run attestor, and --require attested-runs asks that of every commit a run made."
tradeoff: "One trust root for machines, the runner keys at base, so a key is added and revoked by the same protected write as evidence keys, and removing it makes what it signed read as untrusted from then on. Verification is offline and repeated on every read, never trusted from the write. Readers that run an older chant count the new line as malformed until they upgrade. The trailer that marks a commit as a run's is still the committer's word, so attested-runs covers commits that name a run, and a run that hides its trailer is caught only by its own end's list."
- id: "b"
label: "the steward signs the commits themselves with an ssh key in allowed_signers"
how: "A steward or lobby key is listed in .chant/allowed_signers with namespaces=\"git\" and signs each commit the run makes, as a person does."
tradeoff: "No new format, and workspace verify already checks it. ws-069 rejected machine keys in the file that names people, the signature says nothing about the run, its model or its cost, and studio-034 keeps the key in the lobby, which never holds the box's commits to sign."
- id: "c"
label: "a separate statements directory or record kind"
how: "Statements kept in _agent-run-statements/ on chant/lifecycle, or as records in the working tree."
tradeoff: "Older readers would not see a new line in the run file, but a statement would live apart from the record it signs, and a record kind puts a never-revised fact through review, which ws-068 and ws-076 keep ledgers out of."
- id: "d"
label: "sign the run file's bytes"
how: "The statement's digest is the SHA-256 of _agent-runs/<id>.jsonl as stored."
tradeoff: "Simple to compute, but storing the statement in the file changes the bytes it signed, and a second signer would sign a different digest."
choice:
option: "a"
reason: "studio-033 c and studio-034 a have the lobby sign with one key it keeps from Infisical, which is one entry in .chant/trust.json's runners rather than one per plant, and studio-036 b asks the statement to carry the run record's hash and the unit plus the model and harness, with the commits and patch-ids of ws-076 as subjects. ws-069 already put machine keys in trust.json, refused a person's key there and made DSSE over in-toto the format, so a run statement reuses the envelope, the keys and the refusal codes of runner evidence. Hashing the canonical start and end lines leaves the file free to gain statement lines, so several signers can sign one record. Keeping the statement in the run's own ledger file follows ws-074 and ws-076: it is a fact about the run, written once, beside the record it signs. studio-035 d wants a report before a requirement, so runs verify and workspace verify report without failing, and --require signed and --require attested-runs are the switch for when the lobby signer runs."
rejected:
- option: "b"
why: "ws-069 keeps machine keys out of the signers file, and a commit signature does not carry the run's model, harness or record."
- option: "c"
why: "It separates the statement from the record it signs, and a record kind puts a ledger fact through review."
- option: "d"
why: "Storing the statement would change the bytes it signed."
supersedes: []
evidence:
- title: "INTENTIUS/chant#3192, agent-run statement signed by a runner or steward key (DSSE)"
url: "https://github.com/INTENTIUS/chant/issues/3192"
as_of: "2026-10-03T00:00:00Z"
- title: "INTENTIUS/chant#2553, signer rotation and DSSE runner evidence, which handed the agent-run statement on"
url: "https://github.com/INTENTIUS/chant/issues/2553"
as_of: "2026-10-03T00:00:00Z"
- title: "ws-069, signer rotation, and where runner keys come from"
url: "https://github.com/INTENTIUS/chant/blob/main/docs/design/decisions/ws-069-signer-rotation-runner-keys.md"
as_of: "2026-10-03T00:00:00Z"
- title: "ws-076, the agent run record"
url: "https://github.com/INTENTIUS/chant/blob/main/docs/design/decisions/ws-076-the-agent-run-record.md"
as_of: "2026-10-03T00:00:00Z"
- title: "studio-033, the signing identity for agent runs"
url: "https://github.com/arugula-salad/studio/blob/integration/next/decisions/studio-033-the-signing-identity-for-agent-runs.md"
as_of: "2026-10-03T00:00:00Z"
- title: "studio-034, where the agent-run signing key is kept"
url: "https://github.com/arugula-salad/studio/blob/integration/next/decisions/studio-034-where-the-agent-run-signing-key-is-kept.md"
as_of: "2026-10-03T00:00:00Z"
- title: "studio-035, whether studio repos require attested agent commits"
url: "https://github.com/arugula-salad/studio/blob/integration/next/decisions/studio-035-whether-studio-repos-require-attested-agent-comm.md"
as_of: "2026-10-03T00:00:00Z"
- title: "studio-036, what an agent run's statement asserts"
url: "https://github.com/arugula-salad/studio/blob/integration/next/decisions/studio-036-what-an-agent-run-s-statement-asserts.md"
as_of: "2026-10-03T00:00:00Z"
- title: "arugula-salad/studio#286, lobby metering wants a signed run statement it can trust"
url: "https://github.com/arugula-salad/studio/issues/286"
as_of: "2026-10-03T00:00:00Z"
decided_by: "lex00"
decided_on: "2026-10-03"
reviews: []
constrains:
- "INTENTIUS/chant#3192"
- "arugula-salad/studio#281"
- "arugula-salad/studio#286"
- "ws-069"
- "ws-076"
- "path:packages/core/src/workspace/trust/run-statement.ts"
- "path:packages/core/src/workspace/runs.ts"
---

# The agent-run statement

`chant workspace runs sign`, `runs statement` and `runs verify` are described in [chant workspace runs](https://intentius.io/chant/cli/workspace-runs/#signed-statements), and `--require attested-runs` in [chant workspace verify](https://intentius.io/chant/cli/workspace-verify/#what-passes).
48 changes: 47 additions & 1 deletion docs/src/content/docs/cli/workspace-runs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ chant workspace runs [--unit <id>] [--decision <id>] [--by <principal>] [--since
chant workspace runs start --from <file|->
chant workspace runs end <run id> [--from <file|->]
chant workspace runs record --from <file|->
chant workspace runs sign <run id> (--key <runner key.pem> | --envelope <file|->) [--base <rev>]
chant workspace runs statement <run id> --signer <principal>
chant workspace runs verify [<run id>] [--require signed] [--base <rev>] [--json]
```

## Description
Expand Down Expand Up @@ -113,9 +116,52 @@ A checkout with no `chant/lifecycle` branch reads no runs and says so with the r

[`chant workspace graph --intent`](/chant/cli/workspace-graph/#chants-trailers) links each commit in a region to the run that made it, with the model and the cost.

Each run also carries `record`, the hash a statement signs, `statements`, the signed statements its ledger file holds, and `attestation`, those statements judged against the runner keys at base. `trust` says which base that was and which runner principals it lists. The next section has the rest.

## Signed statements

A run's record is as trustworthy as whatever wrote it: a box that reports its own run can report anything. A statement is a runner's or a steward's signed word for it ([#3192](https://github.com/INTENTIUS/chant/issues/3192), [ws-090](https://github.com/INTENTIUS/chant/blob/main/docs/design/decisions/ws-090-the-agent-run-statement.md)). It is an [in-toto Statement v1](https://github.com/in-toto/attestation/blob/main/spec/v1/statement.md) in a [DSSE envelope](https://github.com/secure-systems-lab/dsse), the format of [runner evidence](/chant/cli/workspace-evidence/), with the predicate type `https://intentius.io/chant/agent-run/v1`.

| Part | Holds |
|---|---|
| `subject` | each commit the run made, `{ name: <sha>, digest: { gitCommit: <sha> } }`, with `annotations.patchId` when the commit has a patch. The commits are the ones its end lists and the ones that carry its `Chant-Run` trailer |
| `predicate.signer` | the runner principal whose key signs, as `.chant/trust.json` lists it |
| `predicate.run` | `{ id, record: { sha256 } }`: the run and the hash of its record, the SHA-256 of the canonical JSON (keys sorted, no whitespace) of `[start line, end line]`. The record holds the cost, tokens and transcript hash, so the hash covers them |
| `predicate.unit`, `harness`, `model`, `provider`, `by` | the work item, harness, model and provider, and the principal the run worked for, as the record has them, so a policy can read them without the record |

The signing key is a runner key, listed at base under `runners` in `.chant/trust.json` with class `runner` for a CI job or `service` for a hosted signer such as a lobby or a steward. A key the signers file lists is refused: a person's key never signs for a run. Only an ended run can be signed, since the end is part of what the hash covers.

| Command | Does |
|---|---|
| `runs sign <id> --key <pem>` | builds the statement from the ledger, signs it with the Ed25519 key, and appends it to the run's file as a `statement` line |
| `runs statement <id> --signer <principal>` | prints the statement, the `payloadType` and the `payload` to sign, in base64, for a signer whose key is kept elsewhere. It writes nothing |
| `runs sign <id> --envelope <file\|->` | takes an envelope signed elsewhere, checks it, and appends it |

Studio's lobby keeps its key away from the box (studio-033, studio-034). The box sends it the statement. The lobby checks the fields it can vouch for, such as the model it proxied. It then signs the DSSE pre-authentication encoding of `payloadType` and the decoded payload. The envelope goes back to the box, and `runs sign <id> --envelope -` stores it.

```sh
chant workspace runs statement 20261003T061522Z-3f9a1c2e --signer lobby > statement.json
# the lobby signs statement.json's payload and returns envelope.json
chant workspace runs sign 20261003T061522Z-3f9a1c2e --envelope envelope.json
```

Either way `sign` checks the envelope before it writes. The signature must be by a runner key at base, and the statement must name that key's principal as its `signer`. It must also be for this run and match its record. A refusal writes nothing and names one of `runner-key-invalid`, `runner-key-is-signer`, `runner-key-unlisted`, `envelope-unreadable`, `envelope-invalid`, `envelope-untrusted`, `run-statement-invalid`, `run-statement-signer-mismatch`, `run-statement-mismatch`, `run-not-ended`, `run-unknown` or `trust-policy-unreadable`. A stored statement is a fact in the ledger and is never removed. `sign` prints the `runs-write.schema.json` document with `verb: "sign"` and `statement: { signer, class, keyid, envelope }`.

A reader never trusts that a statement was checked when it was stored. `runs --json` and `runs verify` judge every stored statement again, against the runner keys at base, so removing a runner key from `.chant/trust.json` makes what it signed read as `untrusted` from then on.

| `attestation.status` | Meaning |
|---|---|
| `signed` | a stored statement verifies. `signer`, `class` and `keyid` say whose, and `commits` lists the commits it names |
| `unsigned` | the ledger holds no statement for the run |
| `mismatch` | a listed key signed a statement that does not match the record, with the code `run-statement-mismatch` |
| `untrusted` | no listed key signed it, `envelope-untrusted`: an unknown key, or one removed at base |
| `invalid` | not a DSSE envelope, not an agent-run statement, or naming another signer |

`runs verify [<run id>]` prints the verdicts for every run, or for one, as `run-statement.schema.json` with `--json`. It reports and exits 0. With `--require signed` it exits 1 when an ended run is not `signed`, and `failures` says why. A running run is never required. [`chant workspace verify --require attested-runs`](/chant/cli/workspace-verify/#what-passes) asks the same of each commit a pull request's runs made.

## Exit codes

| Code | Meaning |
|---|---|
| 0 | The read succeeded, or the write was made |
| 1 | The declaration could not be read, `--since` names no commit, the command line is wrong, or the write was refused |
| 1 | The declaration could not be read, `--since` names no commit, the command line is wrong, the write was refused, or `runs verify --require signed` found a run that is not signed |
16 changes: 13 additions & 3 deletions docs/src/content/docs/cli/workspace-verify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The same holds for a closed record's [seal](/chant/cli/workspace-records/#seals-
## Synopsis

```
chant workspace verify [--base <rev>] [--head <rev>] [--require attested] [--json]
chant workspace verify [--base <rev>] [--head <rev>] [--require attested | attested-runs] [--json]
```

## Description
Expand Down Expand Up @@ -63,7 +63,9 @@ Some signer lines are never used, and the command reports each one with the reas
| Protected writes | A commit that changes the signers file, its rotation file or `.chant/trust.json` needs a signature from someone the base policy trusts. If an admin role is granted, only an admin's signature counts. Deleting the signers file is a protected write too. |
| Rotation | A change to the signer set must be the next version, signed by a threshold of the set at base. In the `--json` report, `rotation` holds the version proposed and who signed it, or the version it had to follow with a [reason code](/chant/cli/workspace-signers/#reason-codes). See [`chant workspace signers`](/chant/cli/workspace-signers/). |
| History | The signer history at base must be unbroken. Every version has to be signed by a threshold of the one before it. If it isn't, nothing verifies. |
| `--require attested` | Every commit in the change must be `attested`. A merge with no changes of its own is skipped, and the commits it brings in are checked instead. |
| Agent runs | A commit an agent run made, named by its `Chant-Run` trailer or listed by the run's end, is `attested` with the attestor `agent-run` when a [run statement](/chant/cli/workspace-runs/#signed-statements) that a runner or steward key at base signed names it ([#3192](https://github.com/INTENTIUS/chant/issues/3192)). The `principal` is the runner, so a reader tells a person's signed commit from a run's attested one by the attestor. The `runs` part of the report lists each commit of the change a run made, the runs that name it, and whether a statement covers it. |
| `--require attested` | Every commit in the change must be `attested`, by a signer or by a run statement. A merge with no changes of its own is skipped, and the commits it brings in are checked instead. |
| `--require attested-runs` | Every commit in the change that an agent run made must be covered by a verified run statement. A commit no run names needs nothing, so a person's commits pass unsigned. It needs runner keys in `.chant/trust.json` at base and no signers file. |

The command doesn't call `git verify-commit`, because that reads its signing program and signers file from git config. It takes the signature and the signed bytes out of the commit object and passes them to `ssh-keygen -Y verify`, along with a signers file built from the base policy.

Expand All @@ -76,6 +78,7 @@ A signature this machine can't check is reported as `attested-unverifiable-here`
| `--base <rev>` | The revision the policy is read from. Defaults to the target branch: `origin/HEAD`, then `main`, then `master`. Never `HEAD`. |
| `--head <rev>` | The tip of the change. Defaults to `HEAD`. |
| `--require attested` | Fail unless every commit in the change is attested. |
| `--require attested-runs` | Fail unless every commit an agent run made is covered by a verified run statement. |
| `--json` | Print the report as JSON. |

## Exit codes
Expand All @@ -93,6 +96,13 @@ A signature this machine can't check is reported as `attested-unverifiable-here`
- run: npx chant workspace verify --base origin/${{ github.base_ref }} --require attested
```

Without `--require` the report fails nothing over agent runs, so a workspace can see which agent commits are attested before it requires them (studio-035 d). Run statements live on `chant/lifecycle`, so a job that checks them fetches it first, `git fetch origin chant/lifecycle`; the command reads the local branch, then `origin/chant/lifecycle`, and never fetches.

```yaml
- run: git fetch origin chant/lifecycle
- run: npx chant workspace verify --base origin/${{ github.base_ref }} --require attested-runs
```

The base has to be a revision the change can't move, which is the target branch tip. With squash merges, the commit that lands is signed by the forge rather than the author. Records then read as `attested-unverifiable-here` on the target branch, so merge commits or rebase merges keep attestation.

## In the chant repository
Expand All @@ -101,4 +111,4 @@ The chant repository uses this on its own pull requests ([#2547](https://github.

## See also

[`chant workspace records`](/chant/cli/workspace-records/) reports each record's provenance level, and can require `attested` too. Beside it, a record's `attested` says whether its author sealed it, checked against the same signers file at base. [`chant workspace signers`](/chant/cli/workspace-signers/) rotates the signer set. [`chant workspace evidence`](/chant/cli/workspace-evidence/) signs and checks runner evidence.
[`chant workspace records`](/chant/cli/workspace-records/) reports each record's provenance level, and can require `attested` too. Beside it, a record's `attested` says whether its author sealed it, checked against the same signers file at base. [`chant workspace signers`](/chant/cli/workspace-signers/) rotates the signer set. [`chant workspace evidence`](/chant/cli/workspace-evidence/) signs and checks runner evidence, and [`chant workspace runs sign`](/chant/cli/workspace-runs/#signed-statements) signs an agent run.
Loading
Loading