Skip to main content

Overview

When your agent needs to log into websites or authenticate with services during task execution, you can provide credentials using the secrets parameter. Secrets are matched to websites by domain pattern, so the agent uses the right credentials for each site it visits.
Secrets are never stored in a database or persisted anywhere. They are only loaded and attached to the active session, then immediately discarded once the session is destroyed.
This approach eliminates the need for guardrail-based credential handling, where the agent pauses and waits for you to provide login details mid-task. With secrets, the agent can authenticate automatically without interruption.

Schema


Request Example


How Matching Works

The match field determines which websites the credentials apply to: When multiple secrets match a domain, the more specific pattern takes priority over all.

Custom Fields

The fields object supports arbitrary key-value pairs. Use field names that correspond to the login form fields on the target website:

Security

Secrets are transmitted securely and are never included in task output or webhook payloads. They are only used by the agent during browser automation to fill in authentication forms.
Key security properties:
  • No persistence: Secrets are never stored in a database or written to disk. They exist only in the session’s memory.
  • Session-scoped: Secrets are attached to the session at creation and immediately discarded when the session is destroyed.
  • Not in output: Secrets never appear in task results, webhook payloads, or logs.
  • Encrypted in transit: All API communication uses HTTPS/TLS.

Secrets vs Guardrails

Use secrets when you know which sites the agent will authenticate with. Use guardrails when you need to provide credentials interactively or handle unexpected login prompts.

Best Practices

Use Environment Variables

Never hardcode secrets in your source code:

Use Specific Patterns

Prefer specific domain patterns over all to limit credential exposure:

Combine with terminateOnCompletion

For single-use authenticated tasks, terminate the session immediately after completion to ensure secrets are discarded as soon as possible: