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:

PriorityLocationScope
1 (lowest)~/.agent-browser/config.jsonUser-level defaults
2./agent-browser.jsonProject-level overrides
3AGENT_BROWSER_* env varsOverride config values
4 (highest)CLI flagsOverride 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.com

Example 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 KeyCLI FlagType
headed--headedboolean
json--jsonboolean
debug--debugboolean
session--sessionstring
restore--restorestring
restoreSave--restore-savestring
restoreCheckUrl--restore-check-urlstring
restoreCheckText--restore-check-textstring
restoreCheckFn--restore-check-fnstring
namespace--namespacestring
sessionName--session-namestring, legacy restore key
executablePath--executable-pathstring
extensions--extensionstring[]
initScripts--init-scriptstring[]
enable--enablestring[]
profile--profilestring
state--statestring
proxy--proxystring
proxyBypass--proxy-bypassstring
args--argsstring
userAgent--user-agentstring
provider-p, --providerstring
device--devicestring
hideScrollbars--hide-scrollbarsboolean
webgpu--webgpuboolean
ignoreHttpsErrors--ignore-https-errorsboolean
caCert--ca-certstring
clearCaCert--no-ca-certboolean
allowFileAccess--allow-file-accessboolean
cdp--cdpstring
autoConnect--auto-connectboolean
pinTab--pin-tabboolean
annotate--annotateboolean
colorScheme--color-schemestring (dark, light, no-preference)
downloadPath--download-pathstring
contentBoundaries--content-boundariesboolean
maxOutput--max-outputnumber
allowedDomains--allowed-domainsstring[]; also disables WebRTC in supported Chromium sessions and requires a fresh controllable browser context without profile/session startup args, restore/state replay, or direct-page provider plugins
actionPolicy--action-policystring
confirmActions--confirm-actionsstring
confirmInteractive--confirm-interactiveboolean
engine--enginestring (chrome, lightpanda)
screenshotDir--screenshot-dirstring
screenshotQuality--screenshot-qualitynumber (0-100)
screenshotFormat--screenshot-formatstring (png, jpeg)
idleTimeout--idle-timeoutstring (10s, 3m, 1h, or raw ms); defaults to 1h, while 0 disables idle shutdown
noAutoDialog--no-auto-dialogboolean
model--modelstring
headers--headersstring (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",
  "caCert": "/etc/ssl/certs/proxy-ca.crt"
}

caCert imports the supplied CA certificate or PEM bundle into an isolated NSS database for locally launched Chromium on Linux. Hostname, validity period, and unrelated CA verification remain enabled. The CA remains active when later commands omit it. Setting different certificate content or clearCaCert: true relaunches Chromium without restarting the daemon. agent-browser install --with-deps installs the required certutil; otherwise install libnss3-tools on Debian/Ubuntu or nss-tools on RPM Linux. This initial implementation does not support Chrome profiles, CDP attach, providers, Lightpanda, macOS, or Windows.

Without the CA certificate on hand, fall back to ignoring every certificate error, which is less secure:

{
  "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.com

A bare flag is equivalent to passing true:

agent-browser --headed open example.com       # same as --headed true
agent-browser --headed true open example.com  # explicit

This 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:

VariableDescriptionDefault
AGENT_BROWSER_CONFIGPath to an explicit config file.(default discovery)
AGENT_BROWSER_SESSIONIsolated browser session name.default
AGENT_BROWSER_AUTO_CONNECTAuto-discover and connect to a running Chrome instance.(disabled)
AGENT_BROWSER_ALLOW_FILE_ACCESSAllow file:// URLs to access local files.(disabled)
AGENT_BROWSER_EXECUTABLE_PATHCustom browser executable path.(auto-discover)
AGENT_BROWSER_PROFILEChrome profile name or persistent profile directory.(none)
AGENT_BROWSER_STATEStorage state file to load at launch.(none)
AGENT_BROWSER_PROXYProxy URL. Takes precedence over standard proxy variables.(none)
AGENT_BROWSER_PROXY_BYPASSProxy bypass host list.(none)
AGENT_BROWSER_PROXY_USERNAMEProxy username when credentials are supplied separately.(none)
AGENT_BROWSER_PROXY_PASSWORDProxy password when credentials are supplied separately.(none)
HTTP_PROXY / HTTPS_PROXY / ALL_PROXYStandard proxy fallback variables.(none)
NO_PROXYStandard proxy bypass fallback.(none)
AGENT_BROWSER_ARGSComma or newline separated browser launch arguments.(none)
AGENT_BROWSER_USER_AGENTCustom User-Agent string.(browser default)
AGENT_BROWSER_PROVIDERBrowser provider such as ios, browserbase, kernel, browseruse, browserless, agentcore, or a configured browser.provider plugin name.(local browser)
AGENT_BROWSER_HIDE_SCROLLBARSHide native scrollbars in headless Chromium screenshots.true
AGENT_BROWSER_COLOR_SCHEMEColor scheme preference (dark, light, no-preference).(none)
AGENT_BROWSER_DOWNLOAD_PATHDefault directory for browser downloads.(temp directory)
AGENT_BROWSER_DEFAULT_TIMEOUTDefault timeout in ms. Keep below 30000 to avoid IPC timeouts.25000
AGENT_BROWSER_NAMESPACENamespace for daemon sockets and restore-state directories.(none)
AGENT_BROWSER_RESTOREAuto-save/load state persistence key.(none)
AGENT_BROWSER_RESTORE_SAVERestore save policy: auto, always, or never.auto
AGENT_BROWSER_AUTOSAVE_INTERVAL_MSMinimum ms between periodic session autosaves while the browser is open. 0 saves only on close.30000
AGENT_BROWSER_RESTORE_CHECK_URLURL pattern restored state must match.(none)
AGENT_BROWSER_RESTORE_CHECK_TEXTPage text restored state must contain.(none)
AGENT_BROWSER_RESTORE_CHECK_FNJavaScript expression restored state must satisfy.(none)
AGENT_BROWSER_SESSION_NAMELegacy auto-save/load state persistence name.(none)
AGENT_BROWSER_STATE_EXPIRE_DAYSAuto-delete saved session states older than N days.30
AGENT_BROWSER_ENCRYPTION_KEY64-char hex key for AES-256-GCM session encryption.(none)
AGENT_BROWSER_EXTENSIONSComma-separated browser extension paths. Extensions work in both headed and headless mode.(none)
AGENT_BROWSER_INIT_SCRIPTSComma-separated paths to page init scripts.(none)
AGENT_BROWSER_ENABLEComma-separated built-in init script features such as react-devtools.(none)
AGENT_BROWSER_HEADEDShow browser window instead of running headless (1 to enable).(disabled)
AGENT_BROWSER_WEBGPUEnable WebGPU; SwiftShader software Vulkan on Linux, no GPU required (1 to enable).(disabled)
AGENT_BROWSER_NO_XVFBDisable automatic Xvfb virtual display for headed mode on displayless Linux hosts (1 to disable).(auto-Xvfb enabled)
AGENT_BROWSER_CLEAR_CA_CERTClear CA trust retained by the running browser session.(disabled)
AGENT_BROWSER_JSONUse JSON output by default.(disabled)
AGENT_BROWSER_ANNOTATEEnable annotated screenshots by default.(disabled)
AGENT_BROWSER_CDPConnect the daemon to a CDP port or WebSocket URL.(none)
AGENT_BROWSER_STREAM_PORTOverride 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_STREAM_QUALITYJPEG quality for streamed frames, 0 to 100. Lower values cut bandwidth: quality 20 costs about half the bytes of the default on a busy page.80
AGENT_BROWSER_STREAM_MAX_WIDTHCap the encoded frame width in pixels. Caps the frame only and leaves the page size alone, so pointer coordinates are unaffected.the viewport
AGENT_BROWSER_STREAM_MAX_HEIGHTCap the encoded frame height in pixels.the viewport
AGENT_BROWSER_IDLE_TIMEOUT_MSAuto-shutdown the daemon after N ms without commands or dashboard input. Set 0 to disable. Headed browsers, Safari and iOS WebDriver sessions, and user-attached browsers are exempt from the default. Provider-owned cloud browsers are eligible for cleanup, and an explicit value applies to every browser.3600000 (1 hour)
AGENT_BROWSER_IOS_DEVICEDefault iOS device name for the ios provider.(none)
AGENT_BROWSER_IOS_UDIDDefault iOS device UDID for the ios provider.(none)
AGENT_BROWSER_DEBUGEnable debug output (1 to enable).(disabled)
AGENT_BROWSER_CONTENT_BOUNDARIESWrap page output in boundary markers for LLM safety.(disabled)
AGENT_BROWSER_MAX_OUTPUTMax characters for page output (truncates beyond limit).(unlimited)
AGENT_BROWSER_ALLOWED_DOMAINSComma-separated allowed domain patterns (e.g., example.com,*.example.com). Requires a fresh controllable browser context without profile/session startup args, restore/state replay, or direct-page provider plugins.(unrestricted)
AGENT_BROWSER_ACTION_POLICYPath to action policy JSON file.(none)
AGENT_BROWSER_CONFIRM_ACTIONSComma-separated action categories requiring confirmation.(none)
AGENT_BROWSER_CONFIRM_INTERACTIVEEnable interactive confirmation prompts (auto-denies if stdin is not a TTY).(disabled)
AGENT_BROWSER_ENGINEBrowser engine to use: chrome (default), lightpanda.chrome
AGENT_BROWSER_NO_AUTO_DIALOGDisable automatic dismissal of alert/beforeunload dialogs.(disabled)
AGENT_BROWSER_PLUGINSJSON plugin registry override.(config discovery)
AGENT_BROWSER_SCREENSHOT_DIRDefault screenshot output directory.(temp directory)
AGENT_BROWSER_SCREENSHOT_QUALITYJPEG screenshot quality from 0 to 100.(format default)
AGENT_BROWSER_SCREENSHOT_FORMATScreenshot format: png or jpeg.png
AGENT_BROWSER_SOCKET_DIRAdvanced override for daemon socket files.runtime dir or ~/.agent-browser
AGENT_BROWSER_SKILLS_DIROverride the directory used by agent-browser skills.bundled skills
AGENT_BROWSER_COLOREnable colored CLI output when truthy.(disabled)
NO_COLORDisable colored output when present.(not set)
AI_GATEWAY_URLVercel AI Gateway base URL.https://ai-gateway.vercel.sh
AI_GATEWAY_API_KEYAPI key for the Vercel AI Gateway. Required to enable AI chat.(none)
AI_GATEWAY_MODELDefault 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.json contains environment-specific values (paths, proxies), consider adding it to .gitignore.