gunk-dev/the-valley
the-valley:ida-9771e3aidearaw

A machine holds one principal with a key per role

State
question or idea
Created
2026-10-27 by contributor

Body

Operator feedback, 2026-10-27: it feels counterintuitive that every change-triggered job on a host needs its own machine identity.

The separation itself is sound. An identity per distinct power keeps one compromised or buggy component to one power:
- The restacker, which adds versions, must not sign the evidence that they pass. Once approvals carry across a rebase (oc-d28b43a), a carried approval plus self-signed evidence would land rebased code with no independent check.
- Agents must not hold `restack`, which adds versions to anyone's ready change.
- The integrator already never counts its own signature as evidence.

Each power is enforced by a distinct key held by a distinct Unix user, and the records name which principal did what (review's "clean restack of an approved one", oc-359f588, relies on that).

The cost is bookkeeping. Grants hang on principals, so each power is its own registry entry, with its own expiry and key ceremony, and each new controller adds one. Controllers with no power of their own (the identity compiler, the web publisher) already have none.

Direction:
- **Role keys under one machine principal.** A machine entry lists a key per role, and each key carries its own grants and `signs` name. A human principal can already hold several keys with different `signs` names. Grants would move from principal to key (or a key would narrow its principal's grants). The separation stays (distinct keys, distinct Unix users); the registry shows one entry per machine.
- **Later, host-minted role credentials.** The host's own key issues short-lived credentials to its role users, so adding a controller adds no registry ceremony. This fits signatures and claims as the single authorization model.

Open questions:
- Does a per-key grant compose with the registry's boundaries and expiry, or does each role key need its own expiry?
- How does review or `valley status` name the actor: by machine and role, or by key?
- What does revoking one role look like when the machine entry stays?

Comments

  1. contributor2026-10-27 18:49 UTC
    Analysis, 2026-10-27, after the operator questioned whether short-lived workload credentials (the OIDC model) fit the valley.
    
    Short-lived credentials move the long-lived root; they don't remove it. Every issuer checks a proof that ends in something long-lived, such as a platform's keys, a cluster's signing key or a human's hardware key. In a cloud the platform holds that root behind a boundary the workload can't cross. On a self-hosted machine nothing sits underneath, so a machine role asking for a short-lived credential can only present its own long-lived key. The one non-circular proof on one host is the kernel vouching for the caller's Unix user over a Unix socket. That still makes the host's key the root and lets any code running as the role mint credentials. What it buys, that a stolen credential expires after eviction, a hardware-bound key buys more cheaply.
    
    Most of what the valley produces is evidence, not access: approvals, attestations and transfer statements must verify later and offline. That takes signatures by recorded keys. Bearer tokens leave no evidence. Short-lived signing certificates (Sigstore's model) need a CA and a transparency log to prove validity at signing time, which here is layers over the same keys.
    
    Revised direction:
    - Role keys under one machine principal, as above, are the substance. Make each one hard to steal rather than short-lived, by binding it to hardware (a TPM or a security key) where the machine has one, and keep grants narrow, with registry expiry as forced rotation.
    - Host-minted role credentials add little on a single host. Drop them from the direction unless roles move across machines.
    - Short-lived, scoped credentials pay off for agent runs, where the threat is the holder misbehaving (prompt injection), not theft. An orchestrator-signed claim such as "run R may push change C's branch until T" is delegation from the orchestrator's key, not circular, and fits signed claims as the single authorization model. The value is the scope; the expiry is secondary.
    - Humans keep signing directly with their hardware key. A web surface would sign in with the same key (as a passkey) and still sign each approval with presence.
    
    Constraint: TPM 2.0 chips generally implement RSA and ECDSA P-256/P-384, not Ed25519, and the registry and note format accept only `ssh-ed25519` (`schema/identity.cue`). A TPM-bound key therefore needs a second key class (ECDSA P-256) in the registry, the hook's SSH admission and the note format. Security keys with Ed25519 PIV support avoid that, at the cost of a device per machine.