Skip to content

age values experimental ​

Store individual secrets in mise.toml as age encrypted values. mise encrypts and decrypts them itself, so you need only an age identity or an SSH key. Commit the encrypted values and share identities outside the repository.

Experimental

age values are experimental. Enable them with experimental = true under [settings], or run mise settings experimental=true.

Decrypted values behave like other [env] values: your activated shell, tasks and mise env see the plaintext. mise redacts them in task output by default.

Quick start ​

1. Get an identity ​

An existing SSH key works: ~/.ssh/id_ed25519 or ~/.ssh/id_rsa, with its .pub file beside it. The key must have no passphrase: mise does not prompt for one, so a protected key can encrypt values but not decrypt them. To use a dedicated age identity instead, create one. Skip age-keygen if age.txt already holds an identity you want to keep:

sh
mise use -g age
mkdir -p ~/.config/mise
mise exec -- age-keygen -o ~/.config/mise/age.txt
# Public key: age1...

The public key is a recipient: share it with people who encrypt values for you. age.txt holds the private identity that decrypts them; keep it outside the repository.

2. Encrypt a value ​

sh
mise set --age-encrypt --prompt DB_PASSWORD
# Enter value for DB_PASSWORD: [hidden input]

--prompt reads the value without echoing it, so the plaintext stays out of your shell history. mise writes the ciphertext to mise.toml:

mise.toml
[env]
DB_PASSWORD = { age = "<base64>" }

3. Use it ​

mise decrypts the value before it starts a command or task:

sh
mise exec -- sh -c 'test -n "$DB_PASSWORD" && echo "DB_PASSWORD is available"'

mise env and mise set DB_PASSWORD print the decrypted value; mise set with no arguments shows [redacted].

Who can decrypt ​

Without recipient flags, mise set --age-encrypt encrypts to:

  • the public keys of the identities in ~/.config/mise/age.txt, or in the file named by age.key_file when that setting is set
  • ~/.ssh/id_ed25519 and ~/.ssh/id_rsa, when their .pub files exist

age cannot encrypt one value to both a post-quantum key (age1pq1..., what age-keygen makes since age 1.4) and a classic one (X25519 or SSH). When the key file holds a post-quantum identity, mise encrypts only to the post-quantum keys in it, and the SSH keys are not used.

If none of these exist, the command fails and asks for recipients.

Share with a team ​

Pass --age-recipient once for each teammate's age public key, or --age-ssh-recipient with an SSH public key or the path to one. --age-key-file adds the public keys of the identities in another key file as recipients. When you pass any of these flags, mise encrypts only to the recipients you name:

sh
mise set --age-encrypt --prompt \
  --age-recipient age1... \
  --age-ssh-recipient ~/.ssh/teammate.pub \
  DB_PASSWORD

To change a value or add a recipient, run mise set --age-encrypt again with the full recipient list. See mise set for every flag.

Decryption identities ​

mise tries identities from these sources, in order:

  1. The MISE_AGE_KEY environment variable, which can hold one or more raw AGE-SECRET-KEY-... lines or the contents of an age identity file
  2. The files in age.identity_files
  3. The file in age.key_file
  4. ~/.config/mise/age.txt, if it exists
  5. The SSH keys in age.ssh_identity_files, then ~/.ssh/id_ed25519 and ~/.ssh/id_rsa

Plugin identities (AGE-PLUGIN-... lines) from any of the first four sources come after all of these, so a software identity that can decrypt a value is used without touching hardware. See Hardware-backed keys.

Paths in age.key_file, age.identity_files and age.ssh_identity_files resolve against the config root of the file that sets them. They support templates, including {{ config_root }} and values from env. Absolute paths and paths that start with ~ keep their meaning.

Decryption is strict by default: when no identity is found, no identity can decrypt a value, or the payload is invalid, mise fails instead of continuing with a partial environment. To skip values it cannot decrypt and resolve the rest, set age.strict to false:

sh
mise settings age.strict=false

Decrypted values are redacted by default. Set redact = false on the variable to opt out:

mise.toml
[env]
DB_PASSWORD = { age = "<base64>", redact = false }

Hardware-backed keys ​

An identity can live in hardware that never hands out the private key: the Mac's Secure Enclave, a TPM on Linux, or a YubiKey. age reaches these through plugins, programs named age-plugin-<name> that hold the key and unwrap values for mise. mise supports any age plugin, including:

HardwarePluginInstall
Secure Enclave (macOS)age-plugin-semise use -g age-plugin-se
TPM 2.0 (Linux)age-plugin-tpmmise use -g age-plugin-tpm
YubiKey (PIV)age-plugin-yubikeymise use -g age-plugin-yubikey

mise looks for the plugin on PATH, then among the tools it has installed, so a plugin installed with mise use -g works whether or not mise is activated. mise does not run a plugin through a mise shim.

A plugin's identity file holds an AGE-PLUGIN-<NAME>-1... line. That line is only a handle to the key in hardware, not the key itself. Put the file in age.identity_files or age.key_file, or set MISE_AGE_KEY to its contents.

Secure Enclave with Touch ID ​

Create a key in the Secure Enclave that needs Touch ID each time it decrypts. Use --access-control=any-biometry-or-passcode instead to allow the login password when Touch ID is unavailable:

sh
mise use -g age-plugin-se
mise exec -- age-plugin-se keygen --access-control=any-biometry -o ~/.config/mise/se.txt
# Public key: age1se1...

Tell mise where the identity is:

~/.config/mise/config.toml
[settings.age]
identity_files = ["~/.config/mise/se.txt"]

Encrypt to the public key, and to a software identity kept somewhere safe as a backup: a Secure Enclave key cannot be copied off the Mac, so values encrypted only to it are lost with the Mac.

sh
mise set --age-encrypt --prompt \
  --age-recipient age1se1... \
  --age-recipient age1... \
  DB_PASSWORD
mise.toml
[env]
DB_PASSWORD = { age = "<base64>" }

When you run a command that needs DB_PASSWORD, macOS asks for Touch ID.

When plugins run ​

  • mise starts a plugin only to decrypt a value that no software identity can decrypt. Values encrypted to an SSH key or age.txt identity this machine has never start one.
  • When an environment has several hardware-encrypted values, mise unwraps them all in one plugin session, and keeps the unwrapped keys for the rest of the command. Whether that means one Touch ID or PIN prompt for all of them depends on the plugin: age-plugin-yubikey asks for the PIN once per session, for example.
  • Encrypting to a plugin recipient (age1se1..., age1yubikey1...) runs the plugin too, but needs no hardware.
  • Messages from a plugin go to stderr. When a plugin asks for a PIN or a passphrase, mise prompts on the terminal; without one, decryption fails with an error that says what the plugin asked for. Touch ID and similar confirmations are the plugin's own dialogs.

If an identity file names a plugin that is not installed, mise says which one and how to install it when a value fails to decrypt.

Secretive and other SSH agents ​

SSH keys held in hardware, such as those Secretive keeps in the Secure Enclave, cannot be used as age SSH identities or recipients. age supports only ssh-ed25519 and ssh-rsa keys, and Secretive's keys are ECDSA P-256; age also cannot decrypt through an SSH agent. On macOS, use age-plugin-se for a key in the Secure Enclave.

Storage format ​

The stored payload is base64-encoded age ciphertext, not encoded plaintext. mise writes small values as KEY = { age = "<base64>" }. When the ciphertext is larger than 1 KiB, mise compresses it with zstd and writes KEY = { age = { value = "<base64>", format = "zstd" } }. When reading, mise also accepts the table form without format or with format = "raw", which both mean uncompressed.

Settings ​

Set these under [settings] in a config file, with mise settings set, or with a setting's environment variable where it has one. See which value wins when a setting is set in more than one place.

age.identity_files

Age identity files to try when decrypting.

  • Type: path[]
  • Default: unset
  • Environment variable: MISE_AGE_IDENTITY_FILES (separated by : (; on Windows))

Used for age-encrypted [env] values and encrypted dotfiles. See Decryption identities for the order mise tries identities in.

age.key_file

Age private key file used to decrypt and as the default recipient when encrypting.

  • Type: path
  • Default: "~/.config/mise/age.txt"
  • Environment variable: MISE_AGE_KEY_FILE

Used for age-encrypted [env] values and encrypted dotfiles. See Decryption identities.

age.ssh_identity_files

SSH private keys to try when decrypting age values.

  • Type: path[]
  • Default: unset
  • Environment variable: MISE_AGE_SSH_IDENTITY_FILES (separated by : (; on Windows))

Used for age-encrypted [env] values and encrypted dotfiles. See Decryption identities for the order mise tries identities in.

age.strict

Fail when an [env] age value cannot be decrypted, instead of skipping it.

  • Type: boolean
  • Default: true
  • Environment variable: MISE_AGE_STRICT

Decryption fails when no identity is found, none can decrypt the value, or the payload is invalid. Set to false to skip those variables and resolve the rest of the environment.

MIT LicenseCopyright © 2026jdx.dev