Credential fill is in public preview and is enabled for teams on request. Please contact us at info@hyperbrowser.ai or on our support chat to enable it for your team. A restricted API key needs
secrets.manage to create secrets and vaults, secrets.use to attach them to a session, and secrets.use with browser.sessions.update to fill them. It’s available in the Node SDK from 1.3.0, the Python SDK from 1.13.0, and the CLI.Store a login
A login is a few ordinary secrets, one per input, each with the allowed origins it may be typed into. A secret can’t be filled until it has at least one. To fill a one-time code, store the authenticator seed as a secret of typetotp: each fill types the code that’s current at that moment.
Group the secrets in a vault so you can attach and fill them by one name. The vault’s entry names, such as USERNAME and PASSWORD, are the field names you fill by.
scheme://host[:port], with no path. https://*.example.com matches any subdomain of example.com but not example.com itself, and http:// is accepted only for localhost, 127.0.0.1 and [::1]. A secret takes 1–20 origins. Allowed origins only limit fills: the same secret can still be passed to a sandbox, where a process that names it, or a vault holding it, receives the value, or a totp secret’s current code.
A TOTP value is the authenticator’s base32 seed, or an otpauth://totp/... URI when the site uses a non-default algorithm, digit count or period. Spaces, hyphens and lowercase letters in a seed are fine. The SDKs and CLI check the value before uploading it, because the API can’t see it: an invalid seed only fails when it’s used.
To change a secret’s origins later, see Manage logins.
Fill a login form
Attach the vault, or single secrets, when you create the session; a session can only fill what it was created with. Then navigate to the login page and fill it. These examples use Playwright: installplaywright-core (Node.js) or playwright (Python).
credential with the secret’s name or ID and give each field only a selector:
credentials list takes up to 20 items: a secret’s name, { secret: name }, or { vault: name }. A vault attaches the secrets its entries point at when the session is created. Attaching anything forces a Firecracker browser and turns off Chrome’s password manager. 1Password vaults can’t be attached to browser sessions.
One-time codes
Logins with two-step verification usually ask for the code on the next screen. Submit the first screen, then fill thetotp entry there:
expiresAt says when the typed code stops being current. If you’re about to submit after that, fill it again.
Results
The response reports an outcome per field, in request order, and never contains values:
Each field also reports the
secretId and version typed, and expiresAt for a TOTP code. A single-secret fill also has a top-level version. Only inputs a person could see count toward a selector, so a hidden copy of a form, such as a mobile layout or a honeypot field, is skipped. A fill takes 1–16 fields, each selector at most once. It never submits the form and is safe to retry. For logins split over several screens, fill the fields on the current screen, submit, and fill the rest on the next one.
Choose the page and frame
Without a page ID, the fill picks a tab in steps. It keeps the tabs whose URL starts withpageUrl, if you pass one. If a single tab is left, it’s used, even if it isn’t on an allowed origin, in which case the fill fails with CREDENTIAL_ORIGIN_NOT_ALLOWED. Otherwise it prefers the tabs on an allowed origin of every secret being filled, when there are any, and then the one visible tab among them. When several tabs could still be the target, the fill fails with CREDENTIAL_PAGE_AMBIGUOUS, and the error’s details list each candidate’s pageId, url and title. Pass pageId (page_id in Python), the tab’s CDP target ID, or a longer pageUrl (page_url) to choose one. You can’t pass both.
Under Playwright every tab reports as visible, so pass a page when more than one open tab is on an allowed origin:
frameUrl (frame_url in Python; frame: { "url": … } in the API) with the start of the iframe’s URL, such as https://accounts.example.com/login. The iframe’s own origin must be allowed.
Use with an LLM
Both SDKs include afill_credential tool definition for OpenAI, Anthropic and Gemini, and a runner that executes the model’s call in the session you bind. The model chooses a secret (credential) or a vault, the field and selector for each input, and optionally page_id, page_url or frame_url; it never sees the values. The runner returns JSON text for the model: the fill result, or {"error": {"code", "message", "retryable", "details"}} so the model can react, for example by retrying with a page_id from details.pages.
Give the model your other browser tools as well, since it has to submit the form itself.
openai_tool_definition, anthropic_tool_definition and gemini_tool_definition in Python, and openaiToolDefinition, anthropicToolDefinition and geminiToolDefinition in Node.js. Python also has CredentialFillTool.async_runnable for AsyncHyperbrowser.
Manage logins
Login secrets are ordinary secrets, so you manage them with the secrets methods; see Secrets to rotate values and Vaults to change entries. Each method takes a name or ID.{"metadata": {"browser": null}} clears the origins, after which the secret can’t be filled.
How credentials are protected
- Encrypted before upload. Values are encrypted on your machine and decrypted only by the host running the session that fills them. No endpoint returns a value, and fill results contain outcomes only.
- Typed only on allowed origins. Before anything is typed, the origin the browser reports for the target page or frame is checked against the allowed origins of every secret being filled. On any other origin the fill fails with
CREDENTIAL_ORIGIN_NOT_ALLOWEDand nothing is typed. Allowed origins don’t apply to sandboxes, which receive any secret a process names; keep a login’s secrets out of vaults used with sandboxes if only browsers should have them. - Attached up front. A session can only fill secrets attached when it was created. Attaching forces a Firecracker browser and turns off Chrome’s password manager.
- Never submitted for you. Fill only types. Your code or model decides whether to submit.
- Kept out of replays. Inputs a fill writes to are excluded from session replays.
- Tracked through snapshots. A session that received a credential, and its snapshots, are marked as containing secrets. Restoring such a snapshot needs the same access as using credentials.
- Recorded. Every fill and every refused attempt is written to the session’s event log as
credential_filledorcredential_fill_refused, with the secret IDs and versions, never values. A refusal’smetadata.reasonis the error code.
cURL
Errors
Errors have acode, a message, and sometimes retryable and details.
A fill can take up to about 18 seconds, so give your HTTP client a timeout of at least 30 seconds. The SDKs do this for you.