> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mythex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables and secrets

> Store project env vars securely in Mythex and inject them into sandboxes and deploys.

# Environment variables and secrets

Projects can store environment variables for the sandbox and published deployments.

## Why use project env vars

* Keep API keys out of source control
* Give the agent and runtime the same configuration
* Rotate values without rewriting code

## Typical workflow

1. Open **project settings**
2. Add keys such as `STRIPE_SECRET_KEY`, `OPENAI_API_KEY`, or your own service credentials
3. Ask the agent to read from `process.env` / framework env conventions
4. Republish if a deployed app must pick up new values

## Security tips

* Never commit secrets into the repo
* Prefer server-only keys for privileged operations
* If a secret leaks in chat history, rotate it at the provider and update project settings

## Related

* [Database](/features/database)
* [Publish](/publish/how-to-publish)
