Configuration#
Create an agent-browser.json file to set persistent defaults instead of repeating flags on every command.
Config File Locations#
agent-browser checks two locations, merged in priority order:
| Priority | Location | Scope |
|---|---|---|
| 1 (lowest) | ~/.agent-browser/config.json | User-level defaults |
| 2 | ./agent-browser.json | Project-level overrides |
| 3 | AGENT_BROWSER_* env vars | Override config values |
| 4 (highest) | CLI flags | Override everything |
Project-level values override user-level values. Environment variables override both. CLI flags always win.
Use --config <path> or the AGENT_BROWSER_CONFIG environment variable to load a specific config file instead of the default locations:
agent-browser --config ./ci-config.json open example.com
AGENT_BROWSER_CONFIG=./ci-config.json agent-browser open example.comExample Config#
{
"headed": true,
"proxy": "http://localhost:8080",
"profile": "./browser-data",
"userAgent": "my-agent/1.0",
"hideScrollbars": false,
"ignoreHttpsErrors": true
}A JSON Schema is available for IDE autocomplete and validation. Add a $schema key to your config file to enable it:
{
"$schema": "https://agent-browser.dev/schema.json",
"headed": true
}All Options#
Global launch, output, provider, and chat options can be set in the config file using their camelCase equivalent. Command-scoped flags such as screenshot --full remain command arguments.
| Config Key | CLI Flag | Type |
|---|---|---|
headed | --headed | boolean |
json | --json | boolean |
debug | --debug | boolean |
session | --session | string |
sessionName | --session-name | string |
executablePath | --executable-path | string |
extensions | --extension | string[] |
initScripts | --init-script | string[] |
enable | --enable | string[] |
profile | --profile | string |
state | --state | string |
proxy | --proxy | string |
proxyBypass | --proxy-bypass | string |
args | --args | string |
userAgent | --user-agent | string |
provider | -p, --provider | string |
device | --device | string |
hideScrollbars | --hide-scrollbars | boolean |
ignoreHttpsErrors | --ignore-https-errors | boolean |
allowFileAccess | --allow-file-access | boolean |
cdp | --cdp | string |
autoConnect | --auto-connect | boolean |
annotate | --annotate | boolean |
colorScheme | --color-scheme | string (dark, light, no-preference) |
downloadPath | --download-path | string |
contentBoundaries | --content-boundaries | boolean |
maxOutput | --max-output | number |
allowedDomains | --allowed-domains | string[] |
actionPolicy | --action-policy | string |
confirmActions | --confirm-actions | string |
confirmInteractive | --confirm-interactive | boolean |
engine | --engine | string (chrome, lightpanda) |
screenshotDir | --screenshot-dir | string |
screenshotQuality | --screenshot-quality | number (0-100) |
screenshotFormat | --screenshot-format | string (png, jpeg) |
idleTimeout | --idle-timeout | string (10s, 3m, 1h, or raw ms) |
noAutoDialog | --no-auto-dialog | boolean |
model | --model | string |
headers | --headers | string (JSON) |
plugins | (config only) | plugin config[] |
Common Configurations#
Local Development#
{
"headed": true,
"profile": "./browser-data"
}Behind a Proxy#
{
"proxy": "http://proxy.corp.example.com:8080",
"proxyBypass": "localhost,*.internal.com",
"ignoreHttpsErrors": true
}CI / Devcontainer#
{
"args": "--no-sandbox,--disable-gpu",
"ignoreHttpsErrors": true
}iOS Testing#
{
"provider": "ios",
"device": "iPhone 16 Pro"
}AI Agent Security#
{
"contentBoundaries": true,
"maxOutput": 50000,
"allowedDomains": ["your-app.com", "*.your-app.com"],
"actionPolicy": "./policy.json"
}Overriding Boolean Options#
Boolean flags accept an optional true/false value to override config settings:
agent-browser --headed false open example.comA bare flag is equivalent to passing true:
agent-browser --headed open example.com # same as --headed true
agent-browser --headed true open example.com # explicitThis applies to boolean flags such as --headed, --debug, --json, --ignore-https-errors, --allow-file-access, --hide-scrollbars, --auto-connect, --annotate, --content-boundaries, --confirm-interactive, and --no-auto-dialog.
Extensions Merging#
Extensions from user-level and project-level configs are concatenated, not replaced. For example, if ~/.agent-browser/config.json specifies ["/ext1"] and ./agent-browser.json specifies ["/ext2"], the result is ["/ext1", "/ext2"].
The AGENT_BROWSER_EXTENSIONS environment variable and CLI --extension flags follow the standard priority rules (env replaces config, CLI appends).
Plugins#
Configure external plugins with the plugins array:
See Plugins for the plugin author protocol and implementation examples.
Use agent-browser plugin add <ref> to create this config automatically.
{
"plugins": [
{
"name": "vault",
"command": "agent-browser-plugin-vault",
"args": [],
"capabilities": ["credential.read"]
},
{
"name": "cloud-browser",
"command": "agent-browser-plugin-cloud-browser",
"capabilities": ["browser.provider"]
},
{
"name": "stealth",
"command": "agent-browser-plugin-stealth",
"capabilities": ["launch.mutate"]
},
{
"name": "captcha",
"command": "agent-browser-plugin-captcha",
"capabilities": ["command.run", "captcha.solve"]
}
]
}Project-level plugin entries are appended after user-level entries. If two entries use the same name, agent-browser resolves the later entry, so a project can override a user default. AGENT_BROWSER_PLUGINS can replace config discovery with a JSON array using the same shape.
Do not put vault tokens or passwords in plugin command args. Use the vault vendor's own login/session mechanism or environment outside agent-browser config.
agent-browser plugin list
agent-browser auth login my-app --credential-provider vault --item "My App"
agent-browser --provider cloud-browser open https://example.com
agent-browser plugin run captcha captcha.solve --payload '{"siteKey":"...","url":"https://example.com"}'plugin run is for command.run and custom capabilities. Core capabilities and protocol request types use their dedicated command paths.
Environment Variables#
These environment variables configure additional daemon and runtime behavior:
| Variable | Description | Default |
|---|---|---|
AGENT_BROWSER_CONFIG | Path to an explicit config file. | (default discovery) |
AGENT_BROWSER_SESSION | Isolated browser session name. | default |
AGENT_BROWSER_AUTO_CONNECT | Auto-discover and connect to a running Chrome instance. | (disabled) |
AGENT_BROWSER_ALLOW_FILE_ACCESS | Allow file:// URLs to access local files. | (disabled) |
AGENT_BROWSER_EXECUTABLE_PATH | Custom browser executable path. | (auto-discover) |
AGENT_BROWSER_PROFILE | Chrome profile name or persistent profile directory. | (none) |
AGENT_BROWSER_STATE | Storage state file to load at launch. | (none) |
AGENT_BROWSER_PROXY | Proxy URL. Takes precedence over standard proxy variables. | (none) |
AGENT_BROWSER_PROXY_BYPASS | Proxy bypass host list. | (none) |
AGENT_BROWSER_PROXY_USERNAME | Proxy username when credentials are supplied separately. | (none) |
AGENT_BROWSER_PROXY_PASSWORD | Proxy password when credentials are supplied separately. | (none) |
HTTP_PROXY / HTTPS_PROXY / ALL_PROXY | Standard proxy fallback variables. | (none) |
NO_PROXY | Standard proxy bypass fallback. | (none) |
AGENT_BROWSER_ARGS | Comma or newline separated browser launch arguments. | (none) |
AGENT_BROWSER_USER_AGENT | Custom User-Agent string. | (browser default) |
AGENT_BROWSER_PROVIDER | Browser provider such as ios, browserbase, kernel, browseruse, browserless, agentcore, or a configured browser.provider plugin name. | (local browser) |
AGENT_BROWSER_HIDE_SCROLLBARS | Hide native scrollbars in headless Chromium screenshots. | true |
AGENT_BROWSER_COLOR_SCHEME | Color scheme preference (dark, light, no-preference). | (none) |
AGENT_BROWSER_DOWNLOAD_PATH | Default directory for browser downloads. | (temp directory) |
AGENT_BROWSER_DEFAULT_TIMEOUT | Default timeout in ms. Keep below 30000 to avoid IPC timeouts. | 25000 |
AGENT_BROWSER_SESSION_NAME | Auto-save/load state persistence name. | (none) |
AGENT_BROWSER_STATE_EXPIRE_DAYS | Auto-delete saved session states older than N days. | 30 |
AGENT_BROWSER_ENCRYPTION_KEY | 64-char hex key for AES-256-GCM session encryption. | (none) |
AGENT_BROWSER_EXTENSIONS | Comma-separated browser extension paths. Extensions work in both headed and headless mode. | (none) |
AGENT_BROWSER_INIT_SCRIPTS | Comma-separated paths to page init scripts. | (none) |
AGENT_BROWSER_ENABLE | Comma-separated built-in init script features such as react-devtools. | (none) |
AGENT_BROWSER_HEADED | Show browser window instead of running headless (1 to enable). | (disabled) |
AGENT_BROWSER_JSON | Use JSON output by default. | (disabled) |
AGENT_BROWSER_ANNOTATE | Enable annotated screenshots by default. | (disabled) |
AGENT_BROWSER_CDP | Connect the daemon to a CDP port or WebSocket URL. | (none) |
AGENT_BROWSER_STREAM_PORT | Override the WebSocket streaming port. By default, an OS-assigned port is used. Set this to bind to a specific port (e.g., 9223). | OS-assigned |
AGENT_BROWSER_IDLE_TIMEOUT_MS | Auto-shutdown the daemon after N ms of inactivity (no commands received). Useful for ephemeral environments. | (disabled) |
AGENT_BROWSER_IOS_DEVICE | Default iOS device name for the ios provider. | (none) |
AGENT_BROWSER_IOS_UDID | Default iOS device UDID for the ios provider. | (none) |
AGENT_BROWSER_DEBUG | Enable debug output (1 to enable). | (disabled) |
AGENT_BROWSER_CONTENT_BOUNDARIES | Wrap page output in boundary markers for LLM safety. | (disabled) |
AGENT_BROWSER_MAX_OUTPUT | Max characters for page output (truncates beyond limit). | (unlimited) |
AGENT_BROWSER_ALLOWED_DOMAINS | Comma-separated allowed domain patterns (e.g., example.com,*.example.com). | (unrestricted) |
AGENT_BROWSER_ACTION_POLICY | Path to action policy JSON file. | (none) |
AGENT_BROWSER_CONFIRM_ACTIONS | Comma-separated action categories requiring confirmation. | (none) |
AGENT_BROWSER_CONFIRM_INTERACTIVE | Enable interactive confirmation prompts (auto-denies if stdin is not a TTY). | (disabled) |
AGENT_BROWSER_ENGINE | Browser engine to use: chrome (default), lightpanda. | chrome |
AGENT_BROWSER_NO_AUTO_DIALOG | Disable automatic dismissal of alert/beforeunload dialogs. | (disabled) |
AGENT_BROWSER_PLUGINS | JSON plugin registry override. | (config discovery) |
AGENT_BROWSER_SCREENSHOT_DIR | Default screenshot output directory. | (temp directory) |
AGENT_BROWSER_SCREENSHOT_QUALITY | JPEG screenshot quality from 0 to 100. | (format default) |
AGENT_BROWSER_SCREENSHOT_FORMAT | Screenshot format: png or jpeg. | png |
AGENT_BROWSER_SOCKET_DIR | Advanced override for daemon socket files. | runtime dir or ~/.agent-browser |
AGENT_BROWSER_SKILLS_DIR | Override the directory used by agent-browser skills. | bundled skills |
AGENT_BROWSER_COLOR | Enable colored CLI output when truthy. | (disabled) |
NO_COLOR | Disable colored output when present. | (not set) |
AI_GATEWAY_URL | Vercel AI Gateway base URL. | https://ai-gateway.vercel.sh |
AI_GATEWAY_API_KEY | API key for the Vercel AI Gateway. Required to enable AI chat. | (none) |
AI_GATEWAY_MODEL | Default AI model for dashboard chat. | anthropic/claude-sonnet-4.6 |
Error Handling#
- Auto-discovered config files (
~/.agent-browser/config.json,./agent-browser.json) that are missing are silently ignored. --config <path>with a missing or malformed file exits with an error.- Malformed JSON in auto-discovered files prints a warning to stderr and continues without that file.
- Unknown keys are silently ignored for forward compatibility.
Tip: If your project-level
agent-browser.jsoncontains environment-specific values (paths, proxies), consider adding it to.gitignore.