Skip to main content
If you keep credentials in 1Password, you can pass fields from it to a sandbox process as environment variables, or fill them into a login form in a browser session. You name the fields with each request, and the sandbox’s or session’s host reads them from 1Password when the process starts or the fill runs. The values are never stored by Hyperbrowser or returned by the API. Hyperbrowser signs in with a 1Password service account token that you store as a secret of type op_token. The token is only used to read the fields you name, and never reaches a process or page.
1Password fields are part of Secrets, which are enabled for teams on request, and need the same access as passing secrets: a restricted API key needs the secrets.use scope. They work for sandbox processes, image startup commands and credential fill in browser sessions.

Store the token

Create a service account in 1Password with read access to the vaults you need, then store its token as an op_token secret. An op_token secret takes no allowed origins: a browser fill names them in the request.
Each request uses the token’s latest version. To rotate the token, add a new version to the secret.

Pass fields to a command

Pass onePassword when you run a command: the token secret’s name, the 1Password vault’s name or ID, and fields, which maps each environment variable to an item, an optional section, and a field.
For long-running processes, pass the same onePassword to sandbox.processes.start:
In the CLI, --1password-field is repeatable and takes ENV=item/[section/]field.

Pass fields to an image’s startup command

When you create a sandbox from an image with a startup command, pass onePassword to give that command the fields:
Like startup secrets, this works for image launches on Firecracker sandboxes only. Otherwise the create fails with SECRET_STARTUP_UNSUPPORTED: create the sandbox without onePassword, and pass it to exec or processes.start.

References

Each field becomes a secret reference, op://<vault>/<item>/[<section>/]<field>. For example, this field:
reads op://Dev Vault for Testing/scrapingcourse login/Security/one-time password?attribute=otp, the current one-time password of that TOTP field rather than its seed.
  • The vault, item, section and field are names or IDs of 1–256 characters, without / or ?, and not . or ... Use the ID for a name that contains / or ?.
  • A field may end with one query, such as ?attribute=otp or ?ssh-format=openssh. Keys are lowercase letters and -; join several with &.
  • A whole reference is at most 512 bytes.
  • fields names 1–32 variables, keyed by environment variable names: letters, digits and _, not starting with a digit.
  • A request uses one token and one 1Password vault.
The API checks these rules before anything starts. Whether an item or field exists is only checked when the process starts or the fill runs.

How values are delivered

The sandbox’s host signs in to 1Password and reads the fields when the process starts. Each value is set only in that process’s environment, like a stored secret, and isn’t refreshed: a later change in 1Password, or a one-time password that expires, doesn’t reach a running process. Hyperbrowser never stores the values, and no endpoint returns them. You can pass onePassword together with vault and secrets, as long as no variable comes from two of them: a variable from 1Password can’t also be set by vault, secrets or env, or the request fails with SECRET_SOURCES_INVALID. Together they can set at most 32 variables. The response lists each 1Password variable with its reference and the tokenSecret it signed in with, in secrets for a process or startupSecrets for a sandbox create:
Unlike stored secrets, these variables have no name, secretId or version, and never overrides.

Browser sessions

A browser session can type 1Password fields into a login form. Attach the token when you create the session with credentials: [{ onePassword: "op-token" }], then fill with onePassword, the fields’ refs and the allowedOrigins the values may be typed on. See Fill from 1Password. An op_token can’t be attached as a plain credential or be a vault entry.

Errors

When the token or a field can’t be used, nothing starts and you get one of these. A browser fill returns these 1Password codes with its own details; see Fill from 1Password. A field that breaks the reference rules is rejected with a 400 before anything starts. See Secrets for the errors any secret can return.