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
2 changes: 1 addition & 1 deletion docs/design/decisions/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
schema: 1
id: "ws-109"
title: "A gate approval signed outside chant, with an ssh key or a passkey"
state: "decided"
area: "D5"
source:
issue: "INTENTIUS/chant#4646"
row: "approve: accept a signature made outside chant (device keys, passkeys) for signed-only gates"
revision: null
question: "A gate under identity.gates counts only an approval sealed with chant approve --sign, which needs the key on the machine running chant. A platform that collects the approval elsewhere, such as a person approving on a phone with a passkey, can only relay it unsigned. How does chant take a signature made somewhere else over the same approval, check it against keys a workspace lists, and keep it on the ledger so anyone can check it again?"
options:
- id: "a"
label: "print the existing statement, take an ssh signature or a WebAuthn assertion over it, and list passkeys in .chant/trust.json"
how: "chant approve --statement runs the approval's checks, records nothing, and prints gateSealPayload's bytes for the gate as a chant-gate-statement/v1 document with the time fixed, the SHA-256 digest and the WebAuthn challenge (base64url of that digest). chant approve --signature <file> --at <time> takes either an armored ssh signature in the chant-gate namespace, checked against the signers file as --sign's seal is, or a WebAuthn assertion, checked against a passkey listed under passkeys in .chant/trust.json at base (principal, credential id, SPKI public key, rpId, origins) per WebAuthn level 2: type webauthn.get, the statement's challenge, an allowed origin, the rpIdHash, the UP and UV flags and the signature over authenticatorData and the client data's hash. A passkey's seal is kind webauthn and keeps the assertion, so the one check (checkGateSignature) that chant approve, the identity.gates rule, a sealed gate, gate-decision and checkGateSeal share reads it again from the ledger."
tradeoff: "The statement is the one --sign already signs, so an ssh seal made elsewhere is the same seal and old ledgers don't change. The passkey list is policy at base like the signers file, and changing it is a protected write. The signature counter is not checked, since a ledger line can't know the authenticator's last count, so a cloned authenticator isn't caught here. An older chant reads a trust.json with passkeys as invalid and turns attestation off, which fails closed."
- id: "b"
label: "a new statement format for signatures made elsewhere"
how: "Define a JSON statement (op, gate, plan digest, actor, time) canonicalised with JCS, signed by whatever key, beside the ssh seal's LF-joined lines."
tradeoff: "A self-describing statement, but two statements for one approval, two verifiers to keep in step, and a gate would count seals over either."
- id: "c"
label: "passkeys as lines in the signers file"
how: "Extend allowed_signers with a webauthn key type and options for the rpId and origins."
tradeoff: "One key list, but ssh-keygen and git read that file, and a line they don't understand would break git log --show-signature and every older chant's parser."
- id: "d"
label: "the platform vouches"
how: "Keep relaying unsigned and let a signed-only gate trust a relay principal the role grants name."
tradeoff: "No new key handling, but the gate would rest on the platform's word, which is what identity.gates exists to avoid (ws-080)."
choice:
option: "a"
reason: "It keeps one statement and one check for every way an approval is signed, so a seal made on a phone is judged where and as an ssh seal is, offline and at base. The passkey's public key, rpId and origins are what a relying party checks an assertion against, and keeping them in trust.json beside runners keeps the signers file readable by ssh-keygen and git."
rejected:
- option: "b"
why: "Two statements for one approval double what a gate must verify and what can drift."
- option: "c"
why: "The signers file must stay ssh-keygen's format."
- option: "d"
why: "A signed-only gate must not rest on the relay's word."
supersedes: []
evidence:
- title: "INTENTIUS/chant#4646, approve: accept a signature made outside chant"
url: "https://github.com/INTENTIUS/chant/issues/4646"
as_of: "2026-11-01T00:00:00Z"
- title: "arugula-salad/arugula#1988, Arugula on chant"
url: "https://github.com/arugula-salad/arugula/issues/1988"
as_of: "2026-11-01T00:00:00Z"
- title: "Web Authentication level 2, verifying an authentication assertion"
url: "https://www.w3.org/TR/webauthn-2/#sctn-verifying-assertion"
as_of: "2026-11-01T00:00:00Z"
- title: "ws-080, a person is a forge identity or a signer"
url: "https://github.com/INTENTIUS/chant/blob/main/docs/design/decisions/ws-080-person-identity-forge-or-signer.md"
as_of: "2026-11-01T00:00:00Z"
decided_by: "lex00"
decided_on: "2026-11-01"
reviews: []
constrains:
- "INTENTIUS/chant#4646"
- "ws-080"
- "path:packages/core/src/lifecycle/gate-seal.ts"
- "path:packages/core/src/lifecycle/gate-webauthn.ts"
- "path:packages/core/src/lifecycle/gate-statement.ts"
---

# A gate approval signed outside chant, with an ssh key or a passkey

The statement, the `passkeys` entries and the checks are described in [Workspace Declaration](https://intentius.io/chant/reference/workspace-declaration/#approvals-signed-outside-chant), and the flags in [Operator](https://intentius.io/chant/cli/operator/).
5 changes: 5 additions & 0 deletions docs/src/content/docs/cli/operator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,17 @@ chant approve fountain-apply rollout-gate
chant approve fountain-apply rollout-gate --actor alex --url "https://github.com/org/repo/pull/123"
chant approve fountain-apply rollout-gate --note "paged on-call first; see the incident channel"
chant approve fountain-apply rollout-gate --actor github:alice --relayed-by github:hud-follower --sign
chant approve fountain-apply rollout-gate --actor github:alice --statement
chant approve fountain-apply rollout-gate --actor github:alice --at 2026-11-01T10:00:00.000Z --signature assertion.json
```

| Flag | Default | Meaning |
|---|---|---|
| `--actor <name>` | `$GITHUB_ACTOR` / `$GITLAB_USER_LOGIN` / `$USER` | Who resolved the gate, recorded on the resolution fact. A surface that signs people in (hud, studio) passes the person's forge identity, such as `github:alice`, or a principal the signers file lists. Under a workspace's `identity.attribution: "identified"` any other name is refused ([Identity](/chant/reference/workspace-declaration/#identity)) |
| `--sign [<key file>]` | — | Seal the approval with an ssh key, or with git's `user.signingkey` when no file is given. The seal attests `--actor` when the signers file at base lists the key for them. A gate the workspace's `identity.gates` names counts only a sealed approval, from its class when it names one, and without `--sign` `chant approve` refuses it ([#3163](https://github.com/INTENTIUS/chant/issues/3163)) |
| `--statement` | — | Print the statement an approval would sign, as a `chant-gate-statement/v1` document on stdout, and record nothing. It runs the same checks and takes the same `--actor`, `--relayed-by`, `--plan` and `--env`. For a signature made outside chant ([Approvals signed outside chant](/chant/reference/workspace-declaration/#approvals-signed-outside-chant), [#4646](https://github.com/INTENTIUS/chant/issues/4646)) |
| `--signature <file>` | — | Record an approval signed elsewhere over the statement: an armored ssh signature in the `chant-gate` namespace, or a passkey's WebAuthn assertion in JSON. `-` reads stdin. It needs `--at`, is checked against the signers file and the `passkeys` of `.chant/trust.json` at base for `--actor`, and counts toward an `identity.gates` gate as `--sign` does. Not with `--sign` |
| `--at <timestamp>` | — | The statement's time, as `--statement` printed it. With `--statement` it fixes the time, and with `--signature` it is required |
| `--relayed-by <principal>` | — | Who carried the approval to chant for `--actor`, such as a follower program relaying a person's approval through hud. Recorded as `relayedBy` on the resolution line, covered by `--sign` (the seal signs it as a seventh line, `relayed-by <principal>`), and listed with the approval in `chant workspace status --json`. The approver is still `--actor`, and the seal is still theirs. Under `identity.attribution: "identified"` the relay must be a checkable principal too ([#3402](https://github.com/INTENTIUS/chant/issues/3402)) |
| `--url <url>` | the surrounding CI job's PR/MR, when there is one | The address this resolution happened at, typically the PR or MR that carried the change. Recorded typed on the resolution fact so a reader is not sniffing free text for a link. Must be an absolute http or https URL |
| `--note <text>` | — | Free-text context recorded alongside the resolution. The link belongs in `--url`; this is for everything else |
Expand Down
55 changes: 53 additions & 2 deletions docs/src/content/docs/reference/workspace-declaration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ A record's `by`, `decided_by`, reviewer or answerer, and a gate approval's `--ac
| Form | Written as | What vouches for it |
|---|---|---|
| forge identity | `github:<login>`, `gitlab:<login>`, or `<forge>@<host>:<login>` for `forgejo`, `gitea` or a self-hosted `github` or `gitlab`, such as `forgejo@codeberg.org:alice` | The surface that signed the person in through the forge. chant records it as given, folding case. |
| signer | a principal `.chant/allowed_signers` lists at base, often the person's forge identity | A seal made with `--sign` by a key listed for that principal, verified against the signers at base. |
| signer | a principal `.chant/allowed_signers` lists at base, often the person's forge identity, or one with a passkey under `passkeys` in `.chant/trust.json` | A seal made with `--sign` by a key listed for that principal, or a signature made elsewhere and brought with `--signature` ([below](#approvals-signed-outside-chant)), verified against the signers and passkeys at base. |
| role holder | a principal holding the `agent`, `runner` or `service` role at base, or listed by a declared agent session | The role grant at base. Not a person. |
| name | anything else, such as a hud roster name or `$USER` | Nothing. |

Expand All @@ -326,7 +326,7 @@ The role grants in `.chant/trust.json` and the signers file name people by the s
| Field | Value |
|---|---|
| `attribution` | `any`, the default, takes any name. `identified` refuses a name: [`records new`, `amend` and `review`](/chant/cli/workspace-records/#writing-records), [`points answer`](/chant/cli/workspace-points/) and `chant approve` refuse a `--by`, author field, answerer or `--actor` that is not a forge identity, a signer or a role holder, with `principal-unidentified`. |
| `gates` | Gates by name. A gate of that name, in any member, Op or component, counts only an approval sealed with `chant approve --sign` by a key the signers file at base lists for its approver. With `class`, the approver must also be in that class, read from the role grants at base. A class no pinned package supplies lets nothing through. Without a signers file at base, nothing passes. The gate named `release` also says who may cut a release: [`chant release cut`](/chant/cli/release/#who-may-cut) then needs `--sign`, by an actor in its class. |
| `gates` | Gates by name. A gate of that name, in any member, Op or component, counts only an approval sealed with `chant approve --sign` by a key the signers file at base lists for its approver, or signed elsewhere with such a key or a passkey `.chant/trust.json` lists and brought with `chant approve --signature`. With `class`, the approver must also be in that class, read from the role grants at base. A class no pinned package supplies lets nothing through. Without a signers file at base, nothing passes. The gate named `release` also says who may cut a release: [`chant release cut`](/chant/cli/release/#who-may-cut) then needs `--sign`, by an actor in its class. |
| `gates.<gate>.quorum` | The approval rules an Op gate of that name takes, in place of the Op's own `approval.quorum` ([#4324](https://github.com/INTENTIUS/chant/issues/4324)). One rule or a list, each `{ targets?, count, roles? }` as in [Approval Rules](/chant/guide/approval-rules/): `count` distinct people, `roles` read from `.chant/trust.json` at base, `targets` globs over the run's environment. `notAuthor` is refused with `declaration-invalid`, since an Op gate has no author to judge by. Absent, the Op's own quorum applies. A chant older than 0.124.47 refuses the field, so set `minReader` to at least that version when you use it. |
| `gates.<gate>.policy`, `.mode`, `.context` | The rest of an Op gate's `approval` block, read at base the way `quorum` is ([#4404](https://github.com/INTENTIUS/chant/issues/4404)). `policy` is the policy set object the owning lexicon's helper renders (the cedar lexicon's `gatePolicy()`): `kind`, `lexicon`, `name`, `version` (the digest of `text`) and `text`. `mode` is `log-only` or `enforce`. `context` is an object of strings, numbers, booleans and lists of strings. Each replaces the Op's field. A `context` key here wins over the Op's, and a key only the Op sets, such as a step output the run computes, still reaches the policy. A field this entry leaves out is read from the Op, which the change being run can edit, and [`WSP153`](/chant/cli/workspace-check/) names the gates that still rely on that. A chant older than 0.124.49 refuses the fields, so set `minReader` to at least that version when you use them. |

Expand All @@ -342,6 +342,57 @@ The seal is an ssh signature in the `chant-gate` namespace over the op or compon

An approval of a gate that resumes ([Resuming at the approved gate](/chant/guide/ops/#resuming-at-the-approved-gate), [#3947](https://github.com/INTENTIUS/chant/issues/3947)) also carries the digest of the checkpoint its run stored. Its seal is version 2: the signature covers one more line, `checkpoint <digest>`, after the others, and the seal records `version: 2`. Changing or removing the digest then stops the seal verifying, so the step outputs a resumed run carries on with are the ones the approver signed for. An approval with no checkpoint digest is sealed as before.

### Approvals signed outside chant

`--sign` needs the key on the machine running chant. A platform that collects the approval somewhere else, such as a phone with a passkey or a device key on another machine, has the person sign the same statement and hands chant the signature ([#4646](https://github.com/INTENTIUS/chant/issues/4646)):

```bash
chant approve web ship --env prod --actor github:alice --statement > statement.json
# the platform has github:alice sign the statement's bytes, then:
chant approve web ship --env prod --actor github:alice --at <timestamp> --signature signature.json
```

`--statement` runs the checks an approval runs, records nothing, and prints a `chant-gate-statement/v1` document whose JSON Schema ships in the package as `@intentius/chant/gate-statement.schema.json`. Its `text` is the statement and `statement` is the same bytes in base64: the lines the seal above signs, joined by LF with no final newline.

```
<op or component>
<gate>
<environment, or empty>
<plan digest, or empty>
<approver>
<timestamp>
relayed-by <principal> (only when --relayed-by is given)
checkpoint <digest> (only when the gate resumes; seal version 2)
```

The statement fixes the time, `timestamp`, which `--at` must repeat with the same `--actor`, `--relayed-by`, `--plan` and `--env`. A time before the gate's pending fact or more than five minutes ahead is refused. `digest` is `sha256:` and the bytes' SHA-256 in hex, and `challenge` is the same hash in base64url with no padding.

`--signature <file>`, or `-` for stdin, takes either of these:

- An ssh signature over the bytes in the `chant-gate` namespace (`ssh-keygen -Y sign -n chant-gate -f <key>`), checked against the keys the signers file at base lists for `--actor`. A device key that is an ssh key, or a security key (`sk-ssh-ed25519`, `sk-ecdsa-sha2-nistp256`), signs this way. The seal recorded is the one `--sign` would have made.
- A WebAuthn assertion from `navigator.credentials.get` with `challenge` as its challenge, as JSON: `{ "id", "clientDataJSON", "authenticatorData", "signature" }`, each base64url, or a `PublicKeyCredential`'s `toJSON()` with the last three under `response`. It is checked against a passkey `.chant/trust.json` at base lists for `--actor`.

A passkey is listed under `passkeys` in `.chant/trust.json`:

```json
{
"schema": 1,
"passkeys": [
{
"principal": "github:alice",
"id": "<credential id, base64url>",
"publicKey": "<DER SubjectPublicKeyInfo, base64url>",
"rpId": "control.example.com",
"origins": ["https://control.example.com"]
}
]
}
```

`publicKey` is what `AuthenticatorAttestationResponse.getPublicKey()` returns at registration. Ed25519 (EdDSA), P-256 (ES256) and RSA (RS256) keys verify. The check follows WebAuthn level 2 for what a ledger line can be checked for. The client data's type is `webauthn.get`, its challenge is the statement's, its origin is one of `origins`, and it isn't cross-origin. The authenticator data's rpIdHash is SHA-256 of `rpId`, and its user-present and user-verified flags are both set. The signature over the authenticator data followed by SHA-256 of the client data verifies with `publicKey`. The signature counter isn't checked. Listing a passkey is a change to the trust config, a [protected write](/chant/cli/workspace-verify/#the-policy). As with ssh seals, nothing counts unless the signers file exists at base, so a workspace whose people sign only with passkeys keeps an empty one.

A signature that doesn't verify for `--actor` is refused before anything is written, whether or not the gate is under `gates`. A passkey's seal on the resolution line is `{ "kind": "webauthn", "signer", "key", "signature", "clientDataJSON", "authenticatorData" }`, with the credential id as `key` and `version: 2` when it signs a checkpoint. An ssh seal has no `kind`. A run, `chant workspace status`, `@intentius/chant/gate-decision` and the seal check read either kind against the policy at base, so anyone can check the approval again offline. Chant 0.124.63 and newer write and read `passkeys` and passkey seals. An older chant reads a trust config with `passkeys` as invalid, which turns attestation off, and counts no passkey seal toward a gate.

A gate that lists an old name as an alias ([Renaming a gate](/chant/guide/ops/#renaming-a-gate), [#3949](https://github.com/INTENTIUS/chant/issues/3949)) counts an approval recorded under that name only when it passes the new gate's `identity.gates` rule. The seal is checked against the op, gate, time and checkpoint digest it was signed under, which the carried line keeps in `carriedFrom`. A rename therefore doesn't break a seal. `chant build` refuses a gate whose alias `identity.gates` names when the gate has no entry of its own, or lacks the alias's class (OPS017).

## CI
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"./capabilities/templates.json": "./src/capabilities/templates.json",
"./notify.schema.json": "./src/notify.schema.json",
"./health.schema.json": "./src/health.schema.json",
"./gate-statement.schema.json": "./src/gate-statement.schema.json",
"./workspace/factory-rules": {
"development": "./src/workspace/factory-rules.ts",
"types": "./dist/workspace/factory-rules.d.ts",
Expand Down
Loading
Loading