Secrets

Trinity stores every API key, token, and config file your project needs in one encrypted store. The full management surface lives in Project Settings → Secrets, which splits into three sub-tabs:

  • Overview — a glance card with counts (configured / needs setup), a pending-setup list per service, and a "Re-sync files" button for your service configuration documents.
  • Shared — package-bound secrets every member of the workspace can see (tier 3/4). Table view, filters, bulk .env import, per-package editing.
  • Yours — your personal overrides for this project (tier 1/2). Same editor, scoped to your account; no other member sees these rows.

When an agent asks for a key on a card, it also proposes who can use it: only on hosts it names, signing only, or readable by the agent. The card shows that proposal under the key with a plain summary of what it allows. Keep it or choose Change to pick another class, edit the hosts or mark a host never-intercept, and the key is saved with what you leave there. A key you have not given a class cannot be saved, and the card says which one is missing. Keys that already have a value are named on the card and not asked for again; change who can use one of those in Secrets.

A key saved from a run's card shows up like any other: a team secret under Shared, and a key kept with Only mine under Yours, where it can be removed.

A key card can also save a key at Workspace (every project), once for the whole workspace, if you are allowed to manage secrets for the workspace. Every project that declares that key name picks it up, with no need to paste it again, and the Secrets page shows the project's declared key as From workspace instead of Missing. A key you saved for the project, or kept as Only mine, wins over the workspace's. The workspace's keys are listed under Workspace app keys below the project's own, where someone who may manage the workspace's secrets can remove one.

Paste a whole .env block into a value field on a key card, or into its Paste .env area, to fill the keys it asked for by name. Every other key in the block becomes a row you can review and remove, and Add key adds one by hand. The rows you add save as project secrets with the one class you choose for them, and a key you add never replaces one that is already stored: the card says which name is taken. The whole save goes through together or not at all. The Add secret dialog in Project settings takes the same paste and the same rows. A key the card asked for can instead use a secret you already have, found by searching your own, your team's and the workspace's keys by name: nothing is copied, the key follows that secret, and who can use it is set on that secret. When the agent introduces a key nothing reads yet, you can change the name the card proposes, and the agent is told the name you kept. A key your package declares keeps its name.

End-to-end encryption

Every secret is encrypted and decrypted on your own devices — the server stores and serves only ciphertext. There is no server-side key: nobody without one of your enrolled devices can read your values, including Trinity.

Two keys decide who can decrypt a row, and they are deliberately different things — one is yours alone, the other is the group's:

  • Your member key is per-person. It encrypts everything scoped to you — your Yours rows and your own workspace-wide rows. Nobody else in the workspace can decrypt them, even though the rows sit in the same shared database.
  • The workspace key is the group key. It encrypts the shared rows (project-shared rows and workspace defaults). Only the devices of current members hold it, and removing a member rotates it — see Workspaces.

A device only holds keys once it's been approved. Rows your device can't decrypt show as locked rather than exposing anything. Manage devices, approvals, and your recovery code in App Settings → Profile → Devices.

Where secrets land on disk

Secrets never touch your project's files. A secret that is an environment variable reaches a process Trinity starts when it starts. A credential that has to be a file (like a service-account JSON) reaches the process through a one-time pipe that only that process reads, and nothing is left on disk. The .env file in each checkout lists your secret names with placeholder values, so tools that look for the file still find it. See Files and the placeholder .env below.

The Shared and Yours editors

Open Project Settings → Secrets and pick Shared or Yours. You'll see a table grouped by key name. A key with two target overrides shows up as one row that expands to reveal the per-target values.

What each row tells you

Column Meaning
Key name The env var name (e.g. STRIPE_SECRET_KEY)
Package Which package (codebase directory) this row binds to. Every secret binds to one package.
Service The service that owns this key (e.g. stripe, dexie-cloud)
Purpose runtime (env var), provider (AI provider key), file (materializes to disk)
Value Masked. Click the eye icon to reveal — your device decrypts it locally and shows briefly.
Updated Last write time

Filters

  • Search — substring match on key name
  • Targets — filter by "All targets" or check one or more individual packages (each shown by the target label(s) it ships).
  • Purpose — narrow to runtime, provider, or file-purpose secrets

Adding a secret

Click Add secret. The dialog asks for:

  • Key name — the env var name (e.g. STRIPE_SECRET_KEY)

  • Value — what you're storing. Sensitive by default; the input masks the value as you type.

  • Targets — required. Pick a specific package (shown by its target label), or choose "All targets" to fan the value out to every package (one row per package). One key can fan out to multiple packages in a single submit.

  • Purpose — defaults to runtime. Pick provider for AI provider keys, file for a credential that has to be a file (see Files and the placeholder .env).

  • Who can use this secret — required, with nothing chosen to start. Each choice says what an agent can and cannot see:

    • Only on hosts you choose — Trinity adds the value to requests sent to the hosts you list, and the agent works with a stand-in. For each host you give the host (such as api.stripe.com, or *.stripe.com for every subdomain), where the value goes (a header, a query string or the URL path, with the header or parameter name) and the request types it may go on. Use Add another host for more than one. The agent sees the name, the hosts and whether it is set, never the value. A Go program built with a module go line below 1.27 can't verify Trinity's certificate on macOS and fails closed; raise the module's go line to 1.27 or later. The editor says so beside the hosts.

      Under Where the value comes from, choose GitHub App to have Trinity make a short-lived GitHub token for each run instead of storing a value, so there is no Value to enter. Give the App ID, the installation ID, the repositories the token covers (names without the owner) and the permissions it carries, each as name:level such as contents:read, and the name of another secret that holds the App's private key. Set that secret to Signing only with the step mint_github_app_token. The token covers only what you list, is added only on the hosts you chose, and is revoked when the run ends; a run longer than an hour needs a new one. The agent sees the name, the hosts and what the token may reach, never the token or the key. The choice is offered for a key with no value, and the Architect cannot propose it.

      Under Where the value comes from, choose AWS role to have Trinity assume an AWS role for each run and sign the run's AWS requests with that session. Give the role's ARN, its region, how long the session lasts (15 minutes to an hour) and, if you want, a session policy that narrows the role; name two Signing only secrets with the step assume_aws_role that hold the access key ID and secret access key that assume it; and name the three variables a program in the run finds holding stand-ins (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN). AWS cannot end a session early, so one can outlast the run by the length you set.

      For access keys you store yourself, switch on Signs AWS requests on each secret of the pair (the access key ID, the secret access key and, for a session, the session token) and give each the same three variable names. A program in the run signs with stand-ins and Trinity replaces each signature with one made by the real keys, only for the hosts you list; a request to any other host gets no real signature. Each host asks only for its name, since the signature covers every request type. The Secrets page lists each use as Request signed.

      For an API that wants an HMAC over the request or a JWT, choose HMAC or JWT under What the proxy does with it on a secret you store. For HMAC, list what the signature covers in order (method, path, query, body_sha256, timestamp, nonce or header:<name>), pick the algorithm and encoding, say whether the key you store is text, Base64 or Hex (Trinity decodes it before signing), and name the header the signature goes in; a timestamp or nonce also names its header, and a request without a header you listed is refused. For a JWT, give the algorithm, the one audience, any fixed claims (typed as a JSON object), how long a token lives (up to an hour) and the header. A program in the run signs with a stand-in and Trinity replaces what it wrote with a signature or token made with the real key, only for the hosts you list. A JWT with RS256 or ES256 signs with a private key in PEM form; a program in the run finds a throwaway key of the same kind there, so a library that parses the key before it signs still works. Two secrets can't write the same header for the same host, and Trinity refuses the second.

      For a Postgres password, choose Database under What the proxy does with it on the secret that holds the password. Give the database's host and port, the role and the database, whether the connection needs TLS (choose no TLS only for a database on this machine, such as one a compose stack publishes) and the variable the run finds its connection string under (DATABASE_URL by default). A program in the run is given a connection string for a proxy on your machine, with a placeholder where the password goes, and Trinity logs in to the database with the real password. A connection as another role, to another database or as a replication connection is refused. The Secrets page lists each connection as Database login.

      Never intercept this host sits under each host you give. Tick it for a host that pins certificates or asks for a client certificate: Trinity then leaves requests to it alone, so it injects no secret there. The mark is for every secret in the project that names the host, it is saved as soon as you tick it (not with the secret), and you need permission to manage secrets to change it. A host Trinity cannot leave alone, such as a bare ending like *.com, says why beside the host.

    • Signing only — only Trinity's signing step uses the value, for the steps you list. The agent sees the name and the steps, never the value. Under Where the key is kept, choose SSH agent or GPG agent for a key that lives in your own agent: name the hosts and repositories it may sign for, and turn on Ask me before each signature to approve every signature on a card. Save the key's fingerprint (ssh-add -l) or keygrip (gpg --list-keys --with-keygrip) as the secret's value; the key itself stays in your agent.

    • The agent can read it — for test or throwaway keys that are cheap to replace. The agent can read the value, print it and use it in any command. Do not use it for a real credential.

    Save stays off, with the reason beside it, until the choice is complete.

  • Sensitive — UI dimension only; controls whether the value is masked by default. Every row is encrypted at rest regardless.

  • Registry publish setting — turn this on for what a release uses to publish the package to its registry. NPM_TOKEN (an npm package) or CARGO_REGISTRY_TOKEN (a Rust crate) is the token. NPM_REGISTRY is the registry an npm package's token publishes to, as a URL such as https://npm.example.com/; leave it unset to publish to npm's public registry. A crate always publishes to crates.io. The name must be one of those. A registry setting stays out of the package's .env, so your app and your agents never see it; only the release's publish step reads it. The list marks a token Registry token and a registry Publish registry. A key name already stored the other way on a package (an ordinary NPM_TOKEN your install needs, say) has to be deleted before it can be stored as a registry setting there.

    You don't have to open this dialog to give a package its registry settings. After a plan commits with a package that publishes, Architect asks for the token and the registry on a key card in the conversation, and the release agent asks again on the release's thread before a promote if the token is still missing. Fill the card and each value is saved as a registry setting: marked Registry token or Publish registry, kept out of the package's .env, and offered at your own scope or the team's but never the whole workspace, since a publish credential belongs to one package. Leave the registry empty to publish to npm's public registry. Each name is offered only to a package whose ecosystem takes it (NPM_TOKEN and NPM_REGISTRY for npm, CARGO_REGISTRY_TOKEN for Cargo). Choose Later and the settings stay unset until you ask again or add them here.

    The token only ever goes to that registry. A package whose package.json names a different registry in publishConfig doesn't publish: the release stops and names both registries, so you either store that registry as NPM_REGISTRY or remove it from the manifest.

Trinity infers sensitive from the key name (*_SECRET, *_KEY, *_TOKEN, *_PASSWORD default to true) when you don't override.

No packages yet? Because every secret binds to a package, a project with no packages has nothing to add a secret to. Instead of an add form, the page shows guidance: "No packages yet — project secrets are bound to a package, and your packages are set up during architect planning. Finish planning and you can add secrets here." A Continue in Architect button goes there, switching to the project whose secrets you were looking at on the way, so Architect opens that project rather than whichever one was active. Once the project has at least one package, the add form appears.

Editing a secret

Click any row to open the edit dialog. You can change the value, change who can use the secret, update the label, or delete the entry. Each key's list row names who can use it (Only on hosts you choose, Signing only or The agent can read it), Signs AWS requests for one of an AWS pair, Signs with HMAC or Mints a JWT for a signing key, Database login for a database password, or Made for each run for a key Trinity makes a token or session for, and the Overview card says how many of the project's secrets an agent can read.

Changing who can use a secret that already holds a value never applies on its own. Review change shows what the secret stops allowing and starts allowing, line by line, with a warning when an agent will be able to read the value. Nothing changes until you press Confirm change, and Back leaves it as it was. A change staged some other way waits on the same screen under A change is waiting for you, with Confirm change and Keep current, and the list and the Overview card mark it. A secret with no value takes a new choice at once.

An agent can ask Trinity which secrets exist and how each may be used, and gets the name, the description, the build, who can use it and whether it is set, never a value. The choice of who can use a secret is yours alone: an agent cannot set or change it.

Secrets resolve per package: if you have your own Yours value for DATABASE_URL on a package and there's also a shared value for the same key on that package, your personal value wins for your runs. Two things that ship from one codebase directory read the same .env, because there is only one file there.

Permissions

Who can edit, reveal, or delete a secret depends on the row's tier and the workspace's Manage Secrets permission setting.

Tier Edit / reveal / delete
Project-shared (Shared) Owner / manager always. Members pass when the workspace's Manage Secrets permission is set to "All Members", blocked when set to "Owner Only".
Project per-member (Yours) Each member only. Pinned to your account — nobody else sees, edits, or reveals your Yours rows.
Workspace default (workspace-wide) Same Manage Secrets setting as project-shared rows, read at the workspace level: owner / manager always, members too when it is set to "All Members". Every member can read masked values and use them at runtime whatever it is set to.
Your workspace-wide row (/me) Each member only. Same isolation as project per-member — nobody else can see the rows your member key encrypts.

Configure the Manage Secrets permission in Workspace Settings → Access Control → Permissions, with optional per-project overrides in Project Settings → General → Permissions. The default is "owner only", and the check runs in every workspace — in one that is just you, you pass it as its owner. A per-project override governs that project's own secrets; the workspace-wide rows read the workspace setting, since they belong to no project.

Bulk .env import

Click Import .env to paste a .env file. Trinity:

  1. Parses the file (handles quoted values, escaped newlines, inline comments)
  2. Runs the sensitivity heuristic per key
  3. Lets you pick which package each key binds to ("All targets" fans the value out to every package — one row each)
  4. Picks a conflict policy: keep existing, overwrite, or skip
  5. Submits everything in one transactional write — the whole batch rolls back on any failure

Per-row conflict overrides are available if you want different behavior for some keys. Result rows report created | updated | skipped | error so you can see exactly what happened.

Provider keys

The Project Settings → AI Models → Providers card is a focused view of purpose='provider' rows for AI providers (Anthropic, OpenAI, DeepSeek, Moonshot, Z.ai, Qwen, Xiaomi, xAI, Ollama, Sakana). Same encrypted store underneath; the card just narrows the table to provider rows.

You can also set provider keys for the whole workspace, across every project in it, from the Provider Configuration card in Workspace Settings → Mine → AI Models → Providers. Cascade rule: a project-scoped key wins over a workspace-wide one.

Files and the placeholder .env

Some credentials have to be a file — a service-account JSON, a certificate. You add them as purpose='file' secrets. Trinity doesn't write them anywhere in your project. When it starts something for you, it hands the file to that process through a pipe that exists only for that process: the process reads it once (a tool that reads the file again, such as a restarted dev server, finds it gone), and the pipe is gone when the process ends, however it ends. A docker stack's containers get environment variables only. The secret's name is the environment variable that tells the process where to read, so name a file secret GOOGLE_APPLICATION_CREDENTIALS and the process finds the file there.

What gets a file:

  • Run Project scripts, and the gates and checks Trinity runs for your project's own commands.
  • Only secrets marked Agent may hold. A secret that Trinity injects on the wire, or one only the signing broker may use, is never handed over as a file, and a file secret with no class set is held back too.
  • Not a command an agent types or overrides itself.

The .env in each checkout holds the name of every secret your project declares, each with a placeholder value that is plainly not a credential. It holds no real value, so a tool that reads it gets the names it expects and an agent reading it learns nothing it could misuse. The real value of an Agent may hold secret reaches a process when Trinity starts it.

Trinity writes the documents a stack service's configuration asks for into your checkout. These are configuration, not secrets. They are written:

  • Right after a worktree is created (so every parallel story sees the right files)
  • After the setup runner finishes capturing values from a CLI
  • After successful story commits
  • On demand via Project Settings → Re-sync files

Keeping these files out of git

Trinity never commits a file it writes for you. Each configuration document, the placeholder .env Trinity composes for each codebase, and the local Docker state it keeps under a codebase's .trinity/local/ folder are listed in a Trinity block inside your repo's .git/info/exclude — git's own per-machine ignore file, which is never committed:

# === Trinity-managed (do not edit between markers) ===
**/.trinity/local/
.env
/apps/web/.env.local
/config/dexie-cloud.json
# === /Trinity-managed ===

.env and .trinity/local/ are always listed, even in a project with no secrets. Nothing broader is, so the documentation Trinity keeps in each codebase's .trinity/docs/ is committed like any other file.

Trinity leaves your .gitignore to you. The one change it makes there is removing a Trinity block that ignores .trinity/, and only in a repo a story works in, as part of that story's pull request. Don't edit between the markers in the exclude file — Trinity rewrites the block. If a configuration document stops being part of your project, Trinity removes the file and its line on the next pass.

How agents see your secrets

When a story executes, Trinity assembles the env var bag from:

  1. Package-specific rows for the package the story's target ships from
  2. Global rows (across all your projects)

The first hit wins per key name. Multi-package stories that don't have a clear package binding raise a card so you can split the secret per-package.

For file-purpose secrets, the process Trinity starts reads the file through its pipe (see Files and the placeholder .env). An agent's own shell commands are not handed one.

An agent can't be handed a secret by asking for access. When it needs a key, it asks for the key itself, and you choose how the key is used when you add it: a key set to Only on hosts you choose is added to a request by Trinity on the way out, so the agent works with a stand-in and never holds the value, and Where secrets were sent, under the list on this page, shows each time Trinity sent one and where.

Where secrets were sent

Under the list on the Secrets page, Where secrets were sent shows what Trinity did with your Only on hosts you choose secrets. Each row names the secret, the host and the request (such as POST api.stripe.com), where in the request the value went (a header, a query parameter, the URL path, the request's signature or a database login), the command that sent it (an agent run, a sandbox command, a queued check, a gate or Run Project) and how long ago. A row says Value sent, Request signed or Database login when Trinity added the value. A request Trinity refused because it carried a stand-in anywhere its choice does not allow reads Refused, with the reason. A request that did not reach the host reads Not delivered, with whether the host failed or the run was cancelled.

The list never holds a value, a stand-in or any part of either, and an agent cannot read it. A row appears when the command that used the secret ends, so a command still running has not written its rows yet. Trinity keeps the newest rows for each project. The refresh button reads the list again. Until a command has used one of these secrets the list says nothing has been sent yet.

Service setup cards

If you start a story that needs a service Trinity sees as unconfigured, the story waits on you with a service setup required card. The card on the story's thread has the setup runner pre-bound to the right target — finish the flow and the story resumes automatically. Agents can also raise this card mid-execution via the signal_service_required tool when they hit a missing service that wasn't on Trinity's radar.

See Needs You for everything that can wait on you.