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
| Field | Type | Required | Description |
|---|---|---|---|
secrets | array | No | Array of secret entries to provide credentials for websites |
secrets[].match | string | Yes | Domain pattern to match (e.g. *.salesforce.com) or all to match every site |
secrets[].fields | object | Yes | Key-value pairs of credential fields (e.g. email, password, apiKey) |
Request Example
How Matching Works
Thematch field determines which websites the credentials apply to:
| Pattern | Matches |
|---|---|
*.salesforce.com | Any subdomain of salesforce.com (e.g. login.salesforce.com, myorg.salesforce.com) |
github.com | Exactly github.com |
all | Any website the agent visits — used as a fallback |
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
| Aspect | Secrets | Guardrails |
|---|---|---|
| When credentials are provided | Upfront, at session creation | On-demand, when the agent asks |
| Task interruption | None — agent authenticates seamlessly | Task pauses until you respond |
| Automation | Fully automated | Requires a handler or human response |
| Best for | Known login targets, automated pipelines | Dynamic or unpredictable auth flows |
Best Practices
Use Environment Variables
Never hardcode secrets in your source code:Use Specific Patterns
Prefer specific domain patterns overall 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:Related Guides
Related Guides