Skip to main content

Vault and secrets

Store a secret once in Vault and give it to a sandbox without it passing through a prompt, log or your code.

S
Written by Sanjay Senthilkumar

Vault keeps your secrets out of prompts, repositories and logs. A run references a secret, and Vault injects it at run time. Vault comes with every plan, Free included.

How secrets reach a run

You store a secret once. A sandbox, workspace or build host lease references it, and Vault injects the value when the run starts, in memory, for as long as the run lasts. Values are never placed in prompts or logs. sandscale mcp never offers a Vault value to a model.

Store a secret

sandscale vault kv put --mount secret app/db password=-

password=- reads the value from standard input without echoing it. FIELD=@FILE reads it from a file.

Give it to a sandbox

const box = await sandscale.sandboxes.create({
  template: 'builtin:python',
  vaultEnv: [{ name: 'DB_PASSWORD', path: 'secret/data/app/db', field: 'password' }],
});

The sandbox gets DB_PASSWORD in its environment. The path is the mount, data, then the secret's path.

What happens to the value

  • Sandscale reads it as you, with your Vault permissions. If you may not read it, the start is refused with vault_env_refused and nothing starts.

  • It goes to the sandbox only: never in the API's answer, a log, the run's record or the audit log. The audit entry names the variables, not the values.

  • A start can name up to 50 values.

  • Secrets issued for a build host lease end with the lease.

Did this answer your question?