Environment variables are workspace-wide. Every session your workspace runs, including agent runs and interactive terminal sessions, receives them in its sandbox environment.
Prerequisites
- You have access to your Tembo workspace settings.
- You know the keys and values your project needs at runtime.
Add a variable
- Open Settings.
- Go to Sandbox.
- Under Environment Variables, click Create Secret.
- Add variables one of two ways:
- Single Variable: enter a Key (for example
CLIENT_KEY) and its Value. - Bulk Import: paste
.env-style contents, oneKEY=valueper line.
- Single Variable: enter a Key (for example
- Click Create Secret.
KEY=value format. Blank lines and lines without a value are skipped:
How variables are used
Once saved, a variable is available in the sandbox for the whole session. You can use it from:- Agent commands: the agent can read the variable when it runs builds, tests, or scripts.
- Hooks:
postCloneandprePushcommands run with the variables set. - Snapshot setup scripts: variables are available while a snapshot is built and are baked into anything the setup script writes to disk.
- MCP servers and integrations: reference a variable so a server or integration can authenticate.
globalMcpServers definition instead of hardcoding the value:
Security
- Encrypted at rest. Values are encrypted before they’re stored.
- Write-only in the dashboard. After you save a variable, the value is hidden. The list shows only the key and when it was created, and there is no way to reveal a stored value.
- Scoped to your workspace. Variables are only injected into sessions that belong to the workspace where you created them.
Constraints
- Keys are unique within a workspace.
- To rotate or change a value, delete the variable and create it again. Values can’t be edited in place because they’re hidden after saving.
- Tembo injects its own reserved variables into every session, including
TEMBO_-prefixed variables and, for triggered agents,TRIGGER_PAYLOAD. Avoid using these names for your own variables, as Tembo’s values take precedence. - Keep secrets out of
tembo.nixand out of your repository. Store them here instead.
Remove a variable
- Open Settings > Sandbox.
- Find the variable in the Environment Variables table.
- Open the row menu and select Delete.