Credentials stay in memory
Mirage keeps each value only in the memory of the process running the workspace. Workspace configs and session records keep the pointer, never the value. A snapshot saves each credential as<REDACTED>, so loading one needs
the credential again. Reading a secret writes nothing to the logs, and an error
names the field and the source, not the secret.
env entry the first time a line uses it. A
rotated secret takes effect the next time the workspace starts.
Pointer fields
Write a pointer where the credential goes:- YAML
- HTTP
- Python
- TypeScript
workspace.yaml
api_key.
Sources
Environment
Set the variable in the environment of the process running Mirage, then point at it by name.env takes no ref.
workspace.yaml
mirage daemon restart after exporting a new variable.
dotenv file
Declare the file as a source, then point at it by that name. Python needs thedotenv extra where Mirage runs: uv tool install 'mirage-ai[dotenv]' for the
CLI, or uv add 'mirage-ai[dotenv]' in a project. The Node package includes it.
workspace.yaml
path is read from the working directory of the process running
Mirage.
Set environment variables
env sets the environment variables each session starts with. A string is a
literal value. A pointer fetches the value from a credential source, so it
never sits in the YAML:
workspace.yaml
APP_ENV is production, and API_TOKEN comes from the Mirage
process environment. Both are exported.
- A pointer defaults
keyto the variable’s name. readonly: truestops the shell from assigning or unsetting the variable.- Mirage fetches the value the first time a line uses the variable. With
fetch: eager, it fetches the value before a line runs, even a line that does not use it.
Declare a source
Name a source undersecrets to give it settings, such as a second AWS
account or 1Password service account, and use that name in from. A pointer
inside a source’s own config can read only from env or a dotenv file.