Skip to main content
This page shows an end-to-end example of using a Secret in a sandbox: create the Secret, create a sandbox that references it, run code inside the sandbox that authenticates to an external service, and kill the sandbox when done. The sandbox only ever sees an opaque placeholder β€” the outbound proxy substitutes the real value for requests to hosts on the Secret’s allow list.

Prerequisites

Set the upstream credential before running:
CLI

End-to-end example

The example creates a Secret, launches a sandbox with secret_envs, runs a command inside the sandbox that calls the upstream API using the placeholder, and finally kills the sandbox.
The code inside the sandbox only ever reads the placeholder (for example novita_secret_<random_hex>). The real key is substituted at the proxy layer and is never present in the sandbox’s environment variables, filesystem, or process arguments.

How each step works

secret_envs differs from regular envs: envs injects the given value directly, while secret_envs interprets the value as a Secret name and injects its placeholder. The same env var name cannot appear in both. Substitution only happens in HTTPS request header values for hosts on the allow list β€” request bodies, URL query parameters, plain HTTP, and WebSocket content are forwarded as-is.
Last modified on August 6, 2026