Overview
When your agent needs to log into websites or authenticate with services during task execution, you can provide credentials using thesecrets 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.
Schema
Request Example
How Matching Works
Thematch field determines which websites the credentials apply to:
When multiple secrets match a domain, the more specific pattern takes priority over
all.
Custom Fields
Thefields object supports arbitrary key-value pairs. Use field names that correspond to the login form fields on the target website:
Security
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 overall to limit credential exposure: