Skip to main content
Secret values allow you to securely pass credentials, API keys, and other sensitive data to AI agents during task execution. These values are automatically handled at type-time, never logged, and never exposed to the AI model. Secret values work with all agent types: browser-use, openai-cua, anthropic-cua, and gemini-computer-use.

Basic Usage

Pass credentials as key-value pairs in secretValues. The agent will securely use these values when logging into websites or filling forms.
Secret values are the recommended way to handle any sensitive data in AI agent tasks. Never include credentials directly in prompts.

Domain-Scoped Secrets

For enhanced security, you can scope secrets to specific domains. Secrets will only be available when the browser is on a matching domain - preventing credential exposure on the wrong site.

Domain Pattern Examples

Domain-scoped secrets are only available when the browser URL matches the pattern. If the agent navigates to a different domain, those secrets won’t be accessible.

Best Practices

Use Environment Variables

Never hardcode secrets in your code. Always load from environment variables or a secrets manager.

Scope to Domains

Use domain-scoped secrets for multi-site tasks to prevent credential leakage.

Meaningful Key Names

Use clear, descriptive key names like LINKEDIN_PASSWORD instead of PASS1.

Minimal Exposure

Only include secrets that the task actually needs.

Security Guarantees