Securely pass credentials and sensitive data to AI agents
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.
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.
Copy
Ask AI
import Anchorbrowser from 'anchorbrowser';const anchorClient = new Anchorbrowser({ apiKey: process.env.ANCHORBROWSER_API_KEY});const response = await anchorClient.agent.task( 'Login to LinkedIn, then login to Gmail and check my inbox', { taskOptions: { url: 'https://linkedin.com', agent: 'anthropic-cua', secretValues: { // Only available on linkedin.com '*.linkedin.com': { LINKEDIN_EMAIL: process.env.LINKEDIN_EMAIL, LINKEDIN_PASSWORD: process.env.LINKEDIN_PASSWORD }, // Only available on google.com '*.google.com': { GOOGLE_EMAIL: process.env.GOOGLE_EMAIL, GOOGLE_PASSWORD: process.env.GOOGLE_PASSWORD } } } });console.log(response);
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.