# Anchorbrowser > ## Documentation Index --- # Source: https://docs.anchorbrowser.io/integrations/1password.md > ## Documentation Index > Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt > Use this file to discover all available pages before exploring further. # 1Password > Securely inject 1Password secrets into your browser sessions ## Overview The 1Password integration **enables your AI agent to securely authenticate with services** during browser automation by injecting secrets, credentials, and other sensitive data from your 1Password vaults directly into your Anchor Browser sessions. This gives your AI agent the ability to log into websites, access APIs, and perform authenticated actions **without you needing to hardcode credentials** in your automation scripts. The actual secret values are **never exposed** to the AI agent, logs, API responses, or any other output ## Prerequisites Before you can use the 1Password integration, you need: 1. **1Password Account**: An active 1Password account with access to the secrets you want to use in a vault different than “Personal”. 2. **Anchor Browser API Key**: Your Anchor Browser API key for authentication ## Getting a 1Password Service Account Token 1. Log in to your [1Password account](https://my.1password.com/) 2. Navigate to **Developer** → **Directory** → **Service Accounts** 3. Click **Create Service Account** 4. Give your service account a descriptive name (e.g., "Anchor Browser Automation") 5. Grant the service account access to the vaults containing the secrets you need 6. Copy the service account token (starts with `ops_`) - you'll need this for the integration setup Store your service account token securely. It provides access to your 1Password secrets and should be treated like a password. ## Creating a 1Password Integration ### Using the API Create a 1Password integration using the AnchorBrowser API: ```bash theme={null} curl -X POST https://api.anchorbrowser.io/v1/integrations \ -H "anchor-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "My 1Password Integration", "type": "1PASSWORD", "credentials": { "type": "serviceAccount", "data": { "serviceAccount": "ops_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } } }' ``` **Response:** ```json theme={null} { "data": { "integration": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My 1Password Integration", "type": "1PASSWORD", "path": "integrations/team-id/550e8400-e29b-41d4-a716-446655440000", "createdAt": "2024-01-01T00:00:00.000Z" } } } ``` Save the `id` from the response - you'll need it to use the integration in browser sessions. ## Using 1Password Integration in Browser Sessions Once you've created a 1Password integration, you can use it in your browser sessions to automatically load secrets. ### Load All Secrets Load all secrets from your 1Password vaults: ```bash theme={null} curl -X POST https://api.anchorbrowser.io/v1/sessions \ -H "anchor-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "integrations": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "type": "1PASSWORD", "configuration": { "load_mode": "all" } } ] }' ``` ### Load Specific Secrets Load only specific secrets using 1Password secret references: ```bash theme={null} curl -X POST https://api.anchorbrowser.io/v1/sessions \ -H "anchor-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "integrations": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "type": "1PASSWORD", "configuration": { "load_mode": "specific", "secrets": [ "op://Production/Database/username", "op://Production/Database/password", "op://Production/API Keys/stripe_key" ] } } ] }' ``` ## 1Password Secret Reference Format 1Password uses a specific format for secret references: ``` op://[vault]/[item]/[field] ``` * **vault**: The name of your 1Password vault * **item**: The name of the item in the vault * **field**: The specific field within the item ### Examples ``` op://Production/AWS Credentials/access_key_id op://Development/GitHub/personal_access_token op://Shared/Stripe/api_key ``` ## Accessing Secrets in Your Browser Session Once loaded, secrets are available as environment variables in your browser session. The environment variable name is derived from the secret reference: * Secret reference: `op://Production/Database/username` * Environment variable: `OP_PRODUCTION_DATABASE_USERNAME` The conversion follows these rules: 1. Remove the `op://` prefix 2. Replace `/` with `_` 3. Convert to uppercase 4. Prefix with `OP_` **AI Agent Security**: When your AI agent accesses these environment variables, it can use them for authentication with external services, but the actual credential values are never visible in the agent's output, logs, or responses. The credentials are used transparently by the browser environment for authentication purposes only. ### Example: Using Secrets in Automation ```javascript node.js theme={null} (async () => { // Create a session with 1Password integration const response = await fetch('https://api.anchorbrowser.io/v1/sessions', { method: 'POST', headers: { 'anchor-api-key': process.env.ANCHOR_API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ integrations: [ { id: integrationId, type: '1PASSWORD', configuration: { load_mode: 'specific', secrets: [ 'op://Production/Database/username', 'op://Production/Database/password' ] } } ] }) }); const sessionData = await response.json(); console.log(sessionData) // Access the secrets in your automation code // The secrets are automatically available as environment variables // OP_PRODUCTION_DATABASE_USERNAME and OP_PRODUCTION_DATABASE_PASSWORD // Your AI agent can use these for authentication without exposing the actual values })(); ``` ```python python theme={null} import os import requests # Create a session with 1Password integration response = requests.post( "https://api.anchorbrowser.io/v1/sessions", headers={ "anchor-api-key": os.getenv("ANCHOR_API_KEY"), "Content-Type": "application/json" }, json={ "integrations": [ { "id": integration_id, "type": "1PASSWORD", "configuration": { "load_mode": "specific", "secrets": [ "op://Production/Database/username", "op://Production/Database/password" ] } } ] } ) session_data = response.json() print(session_data) # Access the secrets in your automation code # The secrets are automatically available as environment variables # OP_PRODUCTION_DATABASE_USERNAME and OP_PRODUCTION_DATABASE_PASSWORD # Your AI agent can use these for authentication without exposing the actual values ``` ## Managing Integrations ### List All Integrations ```bash theme={null} curl -X GET https://api.anchorbrowser.io/v1/integrations \ -H "anchor-api-key: YOUR_API_KEY" ``` **Response:** ```json theme={null} { "data": { "integrations": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My 1Password Integration", "type": "1PASSWORD", "createdAt": "2024-01-01T00:00:00.000Z" } ] } } ``` ### Delete an Integration ```bash theme={null} curl -X DELETE https://api.anchorbrowser.io/v1/integrations/550e8400-e29b-41d4-a716-446655440000 \ -H "anchor-api-key: YOUR_API_KEY" ``` **Response:** ```json theme={null} { "data": { "integration": { "id": "550e8400-e29b-41d4-a716-446655440000", "deleted": true, "path": "integrations/team-id/550e8400-e29b-41d4-a716-446655440000" } } } ``` Deleting an integration will remove the stored service account token. Any browser sessions using this integration will fail to load secrets. ## Troubleshooting ### Integration Creation Fails * **Invalid Service Account Token**: Verify your token starts with `ops_` and is valid * **Insufficient Permissions**: Ensure the service account has access to the required vaults ### Secrets Not Loading * **Invalid Secret Reference**: Check the format of your secret references (`op://vault/item/field`) * **Service Account Access**: Verify the service account has access to the specified vaults and items * **Item or Field Not Found**: Ensure the vault, item, and field names are correct and exist ### Environment Variables Not Available * **Check Secret Reference Format**: Ensure your secret references follow the correct format * **Verify Integration ID**: Make sure you're using the correct integration ID in your session configuration ## Support For additional help with 1Password integration: * [1Password Service Accounts Documentation](https://developer.1password.com/docs/service-accounts/) * Contact Anchor Browser support at [support@anchorbrowser.io](mailto:support@anchorbrowser.io) --- # Source: https://docs.anchorbrowser.io/B0-self-healing.md # Self-healing > Automatically detect and fix task failures with runtime agent intervention Self-healing enables your tasks to automatically recover from errors by triggering a runtime agent to complete the execution and generate updated code. ## How self-healing works When self-healing is enabled, B0 monitors task execution for specific error states. If a self-healing trigger is detected, the system automatically: A runtime agent takes over the current task execution to complete it successfully. The completed task is analyzed and compared against the original code to identify the root cause of the failure. A new version of the task code is generated with the necessary fixes applied. The updated code can be automatically deployed or manually reviewed before deployment. ## Enable self-healing Self-healing is configured at the task level. You can enable it when creating or updating a task. ```python theme={null} from anchor_sdk import Anchor anchor = Anchor(api_key="your_api_key") # Create a task with self-healing enabled task = anchor.tasks.create( name="form_submission", prompt="Fill out the contact form on example.com", self_healing=True, self_healing_config={ "auto_deploy": True, "trigger_on": ["timeout", "element_not_found", "navigation_error"] } ) ``` ```typescript theme={null} import { Anchor } from '@anchor-sdk/client'; const anchor = new Anchor({ apiKey: 'your_api_key' }); // Create a task with self-healing enabled const task = await anchor.tasks.create({ name: 'form_submission', prompt: 'Fill out the contact form on example.com', selfHealing: true, selfHealingConfig: { autoDeploy: true, triggerOn: ['timeout', 'element_not_found', 'navigation_error'] } }); ``` ## Configure self-healing triggers You can specify which error states should trigger self-healing. By default, common failure scenarios are monitored. ```python theme={null} # Configure specific error triggers task = anchor.tasks.update( task_id="task_123", self_healing_config={ "trigger_on": [ "timeout", "element_not_found", "navigation_error", "authentication_failure", "captcha_detected" ], "max_attempts": 3, "auto_deploy": False } ) ``` ```typescript theme={null} // Configure specific error triggers const task = await anchor.tasks.update({ taskId: 'task_123', selfHealingConfig: { triggerOn: [ 'timeout', 'element_not_found', 'navigation_error', 'authentication_failure', 'captcha_detected' ], maxAttempts: 3, autoDeploy: false } }); ``` ## Auto-deploy fixes When `auto_deploy` is enabled, the system automatically deploys the updated code after successful validation. This ensures your tasks continue running without manual intervention. ```python theme={null} # Enable auto-deploy for immediate fixes task = anchor.tasks.create( name="data_extraction", prompt="Extract product prices from the catalog", self_healing=True, self_healing_config={ "auto_deploy": True, "validation_required": True } ) ``` ```typescript theme={null} // Enable auto-deploy for immediate fixes const task = await anchor.tasks.create({ name: 'data_extraction', prompt: 'Extract product prices from the catalog', selfHealing: true, selfHealingConfig: { autoDeploy: true, validationRequired: true } }); ``` ## Monitor self-healing events Track when self-healing is triggered and review the changes made to your tasks. ```python theme={null} # Get self-healing history for a task healing_events = anchor.tasks.get_healing_events(task_id="task_123") for event in healing_events: print(f"Triggered at: {event.timestamp}") print(f"Error type: {event.error_type}") print(f"Status: {event.status}") print(f"Code version: {event.new_version}") ``` ```typescript theme={null} // Get self-healing history for a task const healingEvents = await anchor.tasks.getHealingEvents({ taskId: 'task_123' }); healingEvents.forEach(event => { console.log(`Triggered at: ${event.timestamp}`); console.log(`Error type: ${event.errorType}`); console.log(`Status: ${event.status}`); console.log(`Code version: ${event.newVersion}`); }); ``` ## Disable self-healing You can disable self-healing at any time for a specific task. ```python theme={null} # Disable self-healing task = anchor.tasks.update( task_id="task_123", self_healing=False ) ``` ```typescript theme={null} // Disable self-healing const task = await anchor.tasks.update({ taskId: 'task_123', selfHealing: false }); ``` Self-healing uses runtime agents to fix errors, which incurs additional costs. Configure triggers carefully to balance reliability and cost efficiency. --- # Source: https://docs.anchorbrowser.io/B0.md > ## Documentation Index > Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt > Use this file to discover all available pages before exploring further. # b0.dev - Deterministic Browser Tasks > B0 makes browser automation easy. Just describe what you want to do, and B0 does it for you. No coding required. B0 is the easiest way to automate anything on the web. Just tell B0 what you want to do in plain English, and it handles the rest.