Secrets are in public preview and are enabled for teams on request. Please contact us at info@hyperbrowser.ai or on our support chat to enable them for your team. A restricted API key needs
secrets.manage to create and change secrets and vaults, secrets.read to read their metadata, and secrets.use to pass them to sandboxes. Secrets are available in the Node SDK from 1.2.1 and the Python SDK from 1.12.0; secret types, allowed origins and vaults need Node SDK 1.3.0 and Python SDK 1.13.0. In the dashboard, only team owners and admins can manage them.Create a secret
Secret types
A secret’s type is set when you create it and can’t change.
The seed of a
totp secret never reaches a process or a page, only its codes. Spaces, hyphens and lowercase letters in a base32 seed are fine. A URI may set algorithm (SHA1, SHA256 or SHA512), digits (6 or 8) and period (1–300 seconds); the defaults are SHA1, 6 digits and 30 seconds. An op_token is only used to read a 1Password vault’s values, and can’t be an environment variable, a vault entry or a browser credential.
Allowed origins only limit where a secret is typed in a browser. They don’t limit sandboxes: any process that names a secret, or a vault holding it, receives its value, or for a totp secret its current code. Keep a secret meant only for browser fills out of vaults you use with sandboxes.
Pass secrets to a command
Pass secrets by name, keyed by the environment variable to set. A plain name uses the latest version.sandbox.processes.start. The process handle reports which version each variable received:
{ name, version } instead of a name, or --secret-version API_KEY=2 in the CLI.
Pass a vault
A vault names a set of variables, so you can pass them all at once. Passvault with or without secrets:
secrets is merged over them, so secrets wins when both set a variable. Together they can set at most 32 variables. A variable from either can’t also be set with env.
The response lists every variable with its source ({"type": "vault", "name": "app-env"} or {"type": "secrets"}) and, when it replaced one, overrides:
totp variable also has "secretType": "totp". A variable from a 1Password vault has reference (its op:// path) and tokenSecret instead of name, secretId and version.
Pass secrets to an image’s startup command
When you create a sandbox from an image with a startup command, you can pass secrets, a vault, or both to that command:startupSecrets lists what the command received, in the same form as above. Startup secrets work for image launches on Firecracker sandboxes only. Otherwise the create fails with SECRET_STARTUP_UNSUPPORTED: create the sandbox without secrets, and pass them to exec or processes.start.
Rotate and delete
Storing a new value adds a version, and commands use the latest version unless you pin one. Each method takes a secret’s name or ID.How secrets are protected
- Encrypted before upload. Values are encrypted on your machine and decrypted only by the host running the sandbox that uses them. No endpoint returns a value.
- One process at a time. A secret is set only in the environment of the process you pass it to; other processes don’t inherit it.
- Tracked through snapshots. A sandbox that received a secret, and every snapshot taken of it, is marked as containing secrets. Restoring such a snapshot needs the same access as passing secrets.
Limits
- 100 secrets per team, 10 versions per secret, and 32 variables per process or sandbox.
- Values are 1 byte to 32 KiB of UTF-8 without NUL bytes.
- Names are 1–128 letters, digits,
_or-, starting with a letter or digit.
Errors
1Password vaults have their own errors.