Skip to content

Vault: our own key store, decided in .t27 - agents lease secrets by name and never see values; one encrypted file to migrate #1759

Open

Description

@gHashTag

The owner, 2026-10-10 (translated): "build our own service for storing keys, in .t27, and for managing them: for working with agents and for convenient migration."

Today the keys live in Railway variables, spread over 59 services, in an account that may be cut off (Trinity-S-AI-DNA/t27#8675). Agents must reach them without ever seeing them. The only portable copy is the owner's age file from 2026-10-10.

Design rules (owner law and security, not style)

  1. No agent and no LLM context ever sees a secret value.
    • An agent asks for a capability by NAME.
    • The vault injects the values straight into the environment of a child process. This is tri vault run --scope <s> -- <cmd>, in the spirit of railway run.
    • Values never reach stdout, logs, events, receipts or PR text.
    • A test scans every log line and event for the bytes of the test secrets.
  2. Only the owner enters or rotates a value, at a TTY prompt (vault put NAME). The value never travels through an agent's tool call.
  3. Encrypted at rest with a proven primitive, never home-made crypto. Use age (X25519 plus ChaCha20-Poly1305) or libsodium sealed boxes.
    • Every secret is encrypted to the vault's identity, plus the owner's recovery recipient.
    • The recovery key lives only in the owner's password manager.
    • So the encrypted store alone is enough to move: the owner's recovery key opens it on any new machine or account.
  4. Every decision is a .t27 spec with real tests, compiled to a card. TypeScript is glue: storage, HTTP, process spawn, and calls into the crypto library. The decisions are:
  5. Workload identity. A requester proves who it is with an ed25519 signature: the host key of trios#1756, or a per-service key. There are no bearer passwords between services.
  6. Audit. Every lease, deny, put, rotate and export becomes an event on the existing events bus. Each event carries names, scopes and hashes, never values.

MVP (slice 1)

  • Specs in gHashTag/t27, specs/vault/:
    • policy.t27: secret classes, scopes, tiers, TTL, rotation and export rules;
    • audit.t27: event kinds and their fields.
  • Runtime in trios on an integration branch vault-mvp, behind TRIOS_VAULT=on, off by default:
    • store: ciphertext rows in Postgres, or an encrypted file on a volume;
    • endpoints: lease, renew, revoke, list names, audit read;
    • workload auth by signature.
  • CLI tri vault or trios vault. Owner commands: init, put, rotate, export, import. Workload commands: run --scope.
    • import takes the owner's decrypted KV stream on stdin, e.g. age -d ~/dr/railway-999-env.age | ... vault import. The OWNER runs it.
  • Tests: dummy secrets only, generated at test time. They cover:
    • cross-scope deny and public-tier deny;
    • TTL expiry;
    • an export that opens with the recovery key and does not open without it;
    • an import round-trip;
    • the no-value-in-logs scan.

Not in slice 1

  • Migrating real secrets. That is the owner's own step, after the MVP lands.
  • Switching services from Railway variables to the vault. That is one service at a time, by data.

Activity

  1. gHashTag commented on Oct 10, 2026

    @gHashTag
    CollaboratorAuthor

    Owner addition, 2026-10-10 (translated): "they are partly in the key manager now: store them all safely, remove duplicates and move them."

    The current sources are named in 999-multibots-telegraf's CLAUDE.md §4:

    • Infisical, a cloud secret manager that 999 reads through its CLI (infisical secrets get NAME), with envs dev and prod;
    • Railway variables, which partly duplicate it. The owner's encrypted export of project 999's variables is railway-999-env.age, in the railway variables --kv format with ### <service> headers.

    Slice 1 adds:

    • vault import --stdin --source <label> --format dotenv|railway-kv. The owner pipes infisical export and age -d into it. Every entry keeps its provenance.
    • Duplicates found inside the vault and reported by name only, for example "same value under X and Y", or "same name, different values in Infisical and Railway". The report never contains values or plain hashes. The owner picks a canonical name per group; aliases keep services working until each one is switched.
    • The merge rules live in specs/vault/. A conflict always needs the owner, so no source wins silently.

    No agent extracts or moves a value. The two import commands are the owner's own steps, run in his terminal after slice 1 lands. Removing the duplicates from Railway and Infisical comes after the services read from the vault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions