Secrets for a team
An encrypted secret is a file you can commit. Every person and machine that should read it has a key, and the value is encrypted to all their public keys, the workspace’s recipients. This guide covers the runy secret commands. The Secrets page explains the model.
Your key
Section titled “Your key”runy secret keyprints this machine’s public key (age1...) and creates the key when it is missing. The private key is secrets.key in the state folder, readable by you only, and is created once and never replaced. A runy daemon inside a machine created from a pack has no key.
Recipients
Section titled “Recipients”List the public keys in the workspace config, .runy.json:
{ "sources": [".runy"], "recipients": { "alice": "age1...", "ci": "age1..." }}The names are labels for you. A recipient that is not an age public key makes the config invalid.
Setting and reading values
Section titled “Setting and reading values”printf '%s' "$GITHUB_TOKEN" | runy secret set githubruny secret get githubruny secret lsset reads the value from stdin, drops one trailing newline and encrypts it to every recipient (none is an error). It replaces only the encrypted: block of the secret’s document, in the file the daemon read it from, and keeps the rest of the file as it was. A secret the daemon does not know yet is written as <source>/<name>.secret.yaml in the one source whose default namespace is the secret’s. When several sources hold that namespace, set fails with several sources hold that namespace: pass --source <folder>; --source <folder> or --file <yaml> resolves it. Pass -n <namespace> for another namespace, --source <folder> to choose the folder and --file <yaml> to name the file, which asks the daemon nothing. A secret that reads command, file or env is refused, and so is an applied one: edit it and runy apply it again.
get decrypts an encrypted secret and prints the value. ls lists the secrets in the workspace’s sources with their file, where the value comes from and their state. See runy secret for every flag.
set and rekey make the daemon read the resource files again, and warn when this machine’s key is not a recipient, since its daemon could not read the value.
Adding a person or a machine
Section titled “Adding a person or a machine”- The new person or machine runs
runy secret keyand sends you the public key. - Add it to
recipientsin.runy.json. - On a machine that can already read the values, run
runy secret rekey. It decrypts everyencryptedsecret in the workspace’s sources (or the--sourcefolders) first and writes nothing when one does not decrypt, listing those. Then it writes each one encrypted to the current recipients. - Commit the changed files. The new machine reads the secrets once it has them.
Removing one
Section titled “Removing one”- Delete the entry from
recipients. - Run
runy secret rekey, so the files are encrypted to the remaining recipients. - Rotate the values the person could read: set a new token at its provider, then
runy secret setit.
The rekey is not enough on its own. Removing a recipient does not revoke what they already read, since they may have kept a copy of the value or of the old file.
What to back up
Section titled “What to back up”secrets.key in the state folder is the only copy of this machine’s private key. Without it the machine can no longer decrypt the values encrypted to it. Back it up where you keep your other keys, or add a second recipient that you hold elsewhere.
secrets.revision next to it is a random key that the daemon uses for the placeholders’ revisions. It decrypts nothing. Keeping it means the same value renders the same placeholder after a restart or an upgrade, so processes that read the secret are not restarted for nothing. Losing it restarts them once.
Not a recipient
Section titled “Not a recipient”A secret whose value this machine’s key cannot read is in Error with:
not a recipient: add `age1...` to the workspace's recipients and run `runy secret rekey` where the value can be readThe message names this machine’s public key. Send it to someone whose machine can read the value, have them add it to recipients and run runy secret rekey, then pull the changed files. If nobody can read the value any more, set it again with runy secret set from its provider.

