Secrets and environments
Where your app's secrets live in Syndai, which environment a value belongs to, and exactly who can read a value: you in the portal, you in the CLI, Syndai's runs, and coding agents.
Your app's secrets (API tokens, database URLs, keys) live in Syndai, not in your repository. Open Connections in the portal and choose the Environment tab, or use syndai secrets in a terminal.
Environments and scope
A workspace has environments, such as development, test and production. Each value belongs to one environment, and is either:
- shared: every project in the workspace gets it;
- for one project: only that project gets it, and it wins over a shared value with the same name.
Who can read a value
Seeing a secret's name and reading its value are different things. Names are never secret. Values are only shown or handed out in the cases below, and every read is in the environment's Activity.
| who | names | development and test values | production values |
|---|---|---|---|
| You in the portal (owner or admin) | yes | one at a time, when you tap to reveal | one at a time, when you tap to reveal |
You in the CLI, after a browser-approved syndai login | yes | yes, with syndai secrets get, download and run | only after you allow this computer in the browser, for 10 minutes at a time |
| A Syndai run (the coding agent in its sandbox) | yes | its own environment's values, put into the sandbox | never |
A coding agent you connect with syndai mcp install | no | no | no |
| A key you paste or make on the API keys page (CI, scripts) | with coding:secrets:read | never | never |
What each row means in practice:
- The portal shows names and who changed what. A value appears only when an owner or admin taps to reveal it, and each tap is in Activity under that person.
- The CLI reads values only with the
coding:secrets:revealscope, and only asyndai loginthat a person approves in the browser grants it. A pasted key (syndai login --with-token), a key made in the portal and the MCP key never hold it. Production needs one more step for every command. The browser page says Allow production values for this command and names the key. The approval is for that command only. An agent with the same key never reads production. Each value the CLI reads is in Activity as read by The CLI. - Runs get the values of the environment they run in (development or test). The coding agent and your app share that sandbox, so treat those values as readable by the agent. Use test accounts and test keys there. No run is ever given a production value.
- Coding agents on your computer that you connect through MCP get a key without any secrets scope. They cannot list or read your secrets. An agent that types commands in your signed-in terminal can do what you can there. That is why production values need a person in the browser, again every 10 minutes.
Keep values out of files
syndai run <command> puts the values in that one command's environment and writes nothing to disk. If you need a file, syndai secrets download -o .env.local writes it so only you can read it (mode 0600) and warns you when git would commit it.
When a value leaks, change it at its source, then set the new value in Syndai. The next run and the next syndai run use it.