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.Domain Allowlist
Restrict browser navigation and network requests to trusted domains, preventing data exfiltration.- Navigation to non-allowed domains
- Sub-resource requests (scripts, images, fetch)
- WebSocket and EventSource connections
- navigator.sendBeacon calls
Action Policies
Gate destructive or sensitive actions with a static policy file.Action Confirmation
Require explicit approval for sensitive action categories.Content Boundaries
Wrap page output in delimiters so LLMs can distinguish tool output from untrusted content:Output Length Limits
Prevent context flooding by truncating page output:Environment Variables
All security features can be configured via environment variables:| Variable | Description |
|---|---|
AGENT_BROWSER_ENCRYPTION_KEY | 64-char hex key for AES-256-GCM encryption (generate with openssl rand -hex 32) |
AGENT_BROWSER_ALLOWED_DOMAINS | Comma-separated allowed domain patterns |
AGENT_BROWSER_ACTION_POLICY | Path to action policy JSON file |
AGENT_BROWSER_CONFIRM_ACTIONS | Action categories requiring confirmation (comma-separated) |
AGENT_BROWSER_CONFIRM_INTERACTIVE | Enable interactive confirmation prompts (auto-denies if stdin is not a TTY) |
AGENT_BROWSER_CONTENT_BOUNDARIES | Wrap page output in boundary markers |
AGENT_BROWSER_MAX_OUTPUT | Max characters for page output |
Configuration File
Security settings can also be configured inagent-browser.json:
Best Practices
For AI Agent Deployments
- Always use domain allowlist - Prevents agents from navigating to unexpected sites or exfiltrating data
- Enable content boundaries - Protects against prompt injection attacks
- Use action policies - Restrict agent capabilities to minimum required actions
- Encrypt credentials - Store auth profiles with encryption enabled
- 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-keywith 0600 permissions - Manual keys: Set
AGENT_BROWSER_ENCRYPTION_KEYenvironment 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.comalso match the bare domainexample.com - Data URI and blob URLs are allowed for sub-resources but blocked for navigation
Action Policy Evaluation
Ifeval 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
- Auth Vault - Credential storage and encryption
- Domain Allowlist - Network restriction
- Action Policies - Action gating and confirmation