> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.ada.cx/2026-08-27-code-tool-sensitive-variables/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ada.cx/_mcp/server. # Code Tools: read a stored secret from an environment variable A Code Tool environment variable can now read a secret that Ada already stores. Choose the **Sensitive Variable** source, then pick a sensitive variable your AI Agent captured, or one of your saved tokens. The snippet reads the value with `os.getenv("NAME")`, the same as any other environment variable. Use this source for a credential that an API tool also uses, such as a client ID or a client secret. The tool reads the stored copy, so rotating that credential updates every tool at once. A secret you type into the tool is a separate copy that you must update by hand. Each source now reads from one place. Ada refuses a sensitive variable or a token that you select under another source when you save the tool, and names the source to use instead. On the Tools API, `code.environment[].source` accepts `secret` for any of these. `secret` previously took a sensitive variable only. A mismatched scope returns `422`. To learn more, see [Inputs, outputs, and environment](/docs/automation/tools/code-tools/inputs-outputs-and-environment).