Skip to main content

Security Overview

agent-browser includes comprehensive security features designed for safe AI agent deployments. All features are opt-in, ensuring existing workflows remain unaffected until you explicitly enable them.

Security Features

Authentication Vault

Store credentials locally with AES-256-GCM encryption. The LLM never sees passwords - only profile names.
Learn more about Auth Vault

Domain Allowlist

Restrict browser navigation and network requests to trusted domains, preventing data exfiltration.
Blocks:
  • Navigation to non-allowed domains
  • Sub-resource requests (scripts, images, fetch)
  • WebSocket and EventSource connections
  • navigator.sendBeacon calls
Learn more about Domain Allowlist

Action Policies

Gate destructive or sensitive actions with a static policy file.
Learn more about Action Policies

Action Confirmation

Require explicit approval for sensitive action categories.
Learn more about Action Policies

Content Boundaries

Wrap page output in delimiters so LLMs can distinguish tool output from untrusted content:
Output:
This prevents prompt injection attacks where malicious page content tricks the LLM into executing unintended commands.

Output Length Limits

Prevent context flooding by truncating page output:

Environment Variables

All security features can be configured via environment variables:
VariableDescription
AGENT_BROWSER_ENCRYPTION_KEY64-char hex key for AES-256-GCM encryption (generate with openssl rand -hex 32)
AGENT_BROWSER_ALLOWED_DOMAINSComma-separated allowed domain patterns
AGENT_BROWSER_ACTION_POLICYPath to action policy JSON file
AGENT_BROWSER_CONFIRM_ACTIONSAction categories requiring confirmation (comma-separated)
AGENT_BROWSER_CONFIRM_INTERACTIVEEnable interactive confirmation prompts (auto-denies if stdin is not a TTY)
AGENT_BROWSER_CONTENT_BOUNDARIESWrap page output in boundary markers
AGENT_BROWSER_MAX_OUTPUTMax characters for page output

Configuration File

Security settings can also be configured in agent-browser.json:

Best Practices

For AI Agent Deployments

  1. Always use domain allowlist - Prevents agents from navigating to unexpected sites or exfiltrating data
  2. Enable content boundaries - Protects against prompt injection attacks
  3. Use action policies - Restrict agent capabilities to minimum required actions
  4. Encrypt credentials - Store auth profiles with encryption enabled
  5. Limit output size - Prevent context flooding attacks

Example Secure Configuration

For Development

During development, you may want less restrictive settings:

Security Considerations

Encryption Key Management

  • Auto-generated keys: Stored at ~/.agent-browser/.encryption-key with 0600 permissions
  • Manual keys: Set AGENT_BROWSER_ENCRYPTION_KEY environment variable
  • Backup: Keep a secure backup of your encryption key - encrypted data cannot be recovered without it

Domain Allowlist Limitations

  • Include CDN domains your target pages depend on (e.g., *.cdn.example.com)
  • Wildcard patterns like *.example.com also match the bare domain example.com
  • Data URI and blob URLs are allowed for sub-resources but blocked for navigation

Action Policy Evaluation

If eval action category is denied by policy, page scripts cannot restore original WebSocket/EventSource implementations. For maximum security, always deny eval when using domain allowlist.

See Also