Secret inputs
[bootstrap.secrets] names the secret values your bootstrap needs, such as tokens and passwords, without storing them in mise configuration. mise reads each value from an environment variable at run time, so you can set it however you like: with fnox, a CI secret, or your shell.
This is separate from [env] secrets, which load values into your shell environment.
Example
Declare each input, then use it in a template with secret():
[bootstrap.secrets]
cache_token = "MISE_CACHE_TOKEN"
[bootstrap.secrets.database_password]
env = "PRODUCTION_DATABASE_PASSWORD"
description = "Production database password"
[bootstrap.files."/etc/example/service.env"]
content = '''
CACHE_TOKEN={{ secret(name="cache_token") }}
DATABASE_PASSWORD={{ secret(name="database_password") }}
'''
template = true
owner = "root"
group = "root"
mode = "0600"Then supply the values when you apply.
Declare inputs
The short form maps a name to an environment variable, as in cache_token = "MISE_CACHE_TOKEN". The table form takes these keys:
| Key | Default | Meaning |
|---|---|---|
env | Required | Environment variable that holds the value |
description | None | Text mise shows when it prompts for the value |
allow_empty | false | Accept an empty value, which mise otherwise rejects |
Names use ASCII letters, digits, ., _, and -. The environment variable name must be a valid shell variable name.
Use them in templates
These templates can call {{ secret(name="...") }}:
[bootstrap.files]content withtemplate = true[dotfiles]entries withmode = "template"[dotfiles]merge = "missing"entries withtemplate = "tera"
Block, line, and enforced merge = true edits in [dotfiles] cannot. A [dotfiles] template uses a secret the same way; for example, dotfiles/credentials.tmpl might contain token = {{ secret(name="cache_token") }} for this entry:
[dotfiles."~/.config/example/credentials"]
source = "dotfiles/credentials.tmpl"
mode = "template"mise resolves only the inputs that the templates selected for a run use, so an unused declaration does not block anything. Before a full mise bootstrap changes anything, mise resolves those inputs and renders every template, so a missing value stops the run before it writes a partial file or runs earlier steps. A merge = "missing" template is the exception: it needs a secret only for a key the target lacks, which is known when apply reaches that entry, so an unavailable secret stops the run there and earlier changes stay.
secret() inserts the value as it is. It does not quote or escape it for a shell, JSON, TOML, or any other format, so the .env example above works only for values that fit on one line without quoting. Encode the value for the format the service reads, especially when it can contain quotes or newlines.
Supply values
mise does not care where a value comes from. fnox can inject values from a secret provider into the bootstrap process:
fnox exec -- mise bootstrap --yes
fnox exec -- mise bootstrap planA machine whose environment already has the variables does not need fnox, and a value from a CI secret, a systemd credential, or your shell works the same way.
For an attended run, --prompt-secrets asks for each missing value without echoing it. Prompted values stay in memory for that run and are not exported:
mise bootstrap --prompt-secrets --yes
mise bootstrap files apply --prompt-secrets
mise dot apply --prompt-secrets
mise bootstrap plan --prompt-secretsCheck what is available
mise bootstrap secrets statuscache_token MISE_CACHE_TOKEN available
database_password PRODUCTION_DATABASE_PASSWORD missingEach input is available, missing, empty, or invalid_unicode. Status never prints values. Add --json for machine-readable output, or --missing to exit 1 when any input is unavailable.
How configs combine
When several config files declare the same name, the most local declaration wins. mise bootstrap status includes the same secrets list as mise bootstrap secrets status.
Remote hosts
mise bootstrap remote does not copy your local environment to the host, so values set on this machine are not available there unless you forward them. Without forwarding, make the values available on the host, or use --prompt-secrets for an attended run on the host.
Forward a secret from this machine
[bootstrap.remote.forward] lists inputs that mise bootstrap remote resolves on the machine you run it from and hands to each host's bootstrap. This suits a value only your machine can produce, such as a short-lived GitHub Actions runner registration token from your logged-in gh:
[bootstrap.secrets]
runner_token = "ACTIONS_RUNNER_INPUT_TOKEN"
cache_token = "MISE_CACHE_TOKEN"
[bootstrap.remote.forward]
# forward the value this machine's environment has (or --prompt-secrets asks for)
cache_token = true
[bootstrap.remote.forward.runner_token]
command = "gh api -X POST repos/acme/app/actions/runners/registration-token --jq .token"
[tasks.bootstrap]
run = "./register-runner.sh"Each entry names a [bootstrap.secrets] input and takes one of:
| Value | Meaning |
|---|---|
true | Forward the value of the input's variable on this machine, or prompt with --prompt-secrets |
{ command = "..." } | Same, but when the variable is unset, run the command here and use its standard output |
false | Do not forward, overriding a less local config file |
On the host, the value is in the input's environment variable for the whole mise bootstrap run, so hooks, the bootstrap task, and secret() templates can all use it. In the example, register-runner.sh can run the runner's config.sh, which reads ACTIONS_RUNNER_INPUT_TOKEN itself, so the token never needs a --token argument.
The command runs with mise's default inline shell (sh -c on Unix) once per host, just before that host's bootstrap, with MISE_BOOTSTRAP_REMOTE_HOST set to the host's name. Its standard error and input stay attached to your terminal, so a command can ask you to log in; trailing newlines are removed from its output. A value from the environment or a prompt is read once and reused for every host. A value can be at most 64 KiB, and it cannot go in a variable that changes how the host runs mise, such as PATH, IFS, HOME, MISE_ENV, MISE_NO_CONFIG, or an LD_ or DYLD_ variable. When a command exits non-zero or prints nothing, mise stops that host's bootstrap and names the secret. A forwarded input with no command, unset on this machine, stops the run before mise connects to any host.
How the value travels:
- It goes over the host's existing SSH connection on standard input into a file only the SSH user can read in the private staging directory. A wrapper reads that file into the environment and deletes it before mise starts.
- It is never on a command line, here or on the host, and never in the archive of the project mise sends.
- mise redacts it from its own output on this machine. On the host,
mise bootstrapredacts every declared input it finds in its environment from the start of the run, so a hook command line that templates the value in is redacted too. Output that a hook or task prints is its own, so do not echo the value. - The host's mise must be a version that supports forwarding. mise checks it before resolving the value, and stops that host's bootstrap with an error if the host has an older one, which would not redact the value.
--dry-runneither runs the command nor sends a value. The host's plan shows templates that need the secret as not inspected.
As with any environment variable, other processes running as the SSH user, and root, can read the value while the bootstrap runs.
What mise never prints
mise redacts resolved values from its output. Plans, dry runs, status output, and the output of its privileged helper contain no rendered file content, and no command reveals a bootstrap secret.
See also
- System files and directories for the files these templates write.
- Bootstrap for which bootstrap values are templates.