---
title: "Configuration"
description: "Browser automation CLI for AI agents"
canonical_url: "https://agent-browser.dev/configuration"
---

# Configuration

Create `./agent-browser.json` to set persistent project defaults instead of repeating flags on every command.

## Config File Locations

agent-browser checks two locations, merged in priority order:

<table>
  <thead>
    <tr><th>Priority</th><th>Location</th><th>Scope</th></tr>
  </thead>
  <tbody>
    <tr><td>1 (lowest)</td><td><code>~/.agent-browser/config.json</code></td><td>User-level defaults</td></tr>
    <tr><td>2</td><td><code>./agent-browser.json</code></td><td>Allowlisted project defaults</td></tr>
    <tr><td>3</td><td><code>AGENT_BROWSER_*</code> env vars</td><td>Override config values</td></tr>
    <tr><td>4 (highest)</td><td>CLI flags</td><td>Override everything</td></tr>
  </tbody>
</table>

Allowed project-level values override user-level values. Environment variables override both. CLI flags always win. The auto-discovered `./agent-browser.json` accepts only `headed`, `json`, `debug`, `userAgent`, `hideScrollbars`, `annotate`, `colorScheme`, `maxOutput`, `screenshotQuality`, `screenshotFormat`, and `idleTimeout`. Other runtime keys, including `extensions`, `initScripts`, state, trust, policy, session, connection, and path settings, are ignored with a warning. The `$schema` metadata key is ignored silently. Put advanced settings in `~/.agent-browser/config.json` or load a trusted file with `--config` or `AGENT_BROWSER_CONFIG`.

Use `--config <path>` or the `AGENT_BROWSER_CONFIG` environment variable to load only a specific trusted config file, replacing default discovery. Environment variables and CLI flags still override its values:

```bash
agent-browser --config ./ci-config.json open example.com
AGENT_BROWSER_CONFIG=./ci-config.json agent-browser open example.com
```

## Example Config

```json
{
  "headed": true,
  "userAgent": "my-agent/1.0",
  "hideScrollbars": false,
  "colorScheme": "dark",
  "maxOutput": 50000,
  "screenshotQuality": 80,
  "screenshotFormat": "png",
  "idleTimeout": "30m"
}
```

A [JSON Schema](https://agent-browser.dev/schema.json) is available for IDE autocomplete and validation. Add a `$schema` key to your config file to enable it:

```json
{
  "$schema": "https://agent-browser.dev/schema.json",
  "headed": true
}
```

## All Options

Global options can be set in a trusted config file using their camelCase equivalent. Command-scoped flags such as `screenshot --full` remain command arguments. The auto-discovered project config accepts only the keys listed above.

<table>
  <thead>
    <tr><th>Config Key</th><th>CLI Flag</th><th>Type</th></tr>
  </thead>
  <tbody>
    <tr><td><code>headed</code></td><td><code>--headed</code></td><td>boolean</td></tr>
    <tr><td><code>json</code></td><td><code>--json</code></td><td>boolean</td></tr>
    <tr><td><code>debug</code></td><td><code>--debug</code></td><td>boolean</td></tr>
    <tr><td><code>session</code></td><td><code>--session</code></td><td>string</td></tr>
    <tr><td><code>restore</code></td><td><code>--restore</code></td><td>string</td></tr>
    <tr><td><code>restoreSave</code></td><td><code>--restore-save</code></td><td>string</td></tr>
    <tr><td><code>restoreCheckUrl</code></td><td><code>--restore-check-url</code></td><td>string</td></tr>
    <tr><td><code>restoreCheckText</code></td><td><code>--restore-check-text</code></td><td>string</td></tr>
    <tr><td><code>restoreCheckFn</code></td><td><code>--restore-check-fn</code></td><td>string</td></tr>
    <tr><td><code>namespace</code></td><td><code>--namespace</code></td><td>string</td></tr>
    <tr><td><code>sessionName</code></td><td><code>--session-name</code></td><td>string, legacy restore key</td></tr>
    <tr><td><code>executablePath</code></td><td><code>--executable-path</code></td><td>string</td></tr>
    <tr><td><code>extensions</code></td><td><code>--extension</code></td><td>string[]</td></tr>
    <tr><td><code>initScripts</code></td><td><code>--init-script</code></td><td>string[]</td></tr>
    <tr><td><code>enable</code></td><td><code>--enable</code></td><td>string[]</td></tr>
    <tr><td><code>profile</code></td><td><code>--profile</code></td><td>string</td></tr>
    <tr><td><code>state</code></td><td><code>--state</code></td><td>string</td></tr>
    <tr><td><code>proxy</code></td><td><code>--proxy</code></td><td>string</td></tr>
    <tr><td><code>proxyBypass</code></td><td><code>--proxy-bypass</code></td><td>string</td></tr>
    <tr><td><code>args</code></td><td><code>--args</code></td><td>string</td></tr>
    <tr><td><code>userAgent</code></td><td><code>--user-agent</code></td><td>string</td></tr>
    <tr><td><code>provider</code></td><td><code>-p, --provider</code></td><td>string</td></tr>
    <tr><td><code>device</code></td><td><code>--device</code></td><td>string</td></tr>
    <tr><td><code>hideScrollbars</code></td><td><code>--hide-scrollbars</code></td><td>boolean</td></tr>
    <tr><td><code>webgpu</code></td><td><code>--webgpu</code></td><td>boolean</td></tr>
    <tr><td><code>noWebmcp</code></td><td><code>--no-webmcp</code> or <code>AGENT_BROWSER_NO_WEBMCP</code></td><td>boolean</td></tr>
    <tr><td><code>ignoreHttpsErrors</code></td><td><code>--ignore-https-errors</code></td><td>boolean</td></tr>
    <tr><td><code>caCert</code></td><td><code>--ca-cert</code></td><td>string</td></tr>
    <tr><td><code>clearCaCert</code></td><td><code>--no-ca-cert</code></td><td>boolean</td></tr>
    <tr><td><code>useSystemCa</code></td><td><code>--use-system-ca</code></td><td>boolean</td></tr>
    <tr><td><code>allowFileAccess</code></td><td><code>--allow-file-access</code></td><td>boolean</td></tr>
    <tr><td><code>cdp</code></td><td><code>--cdp</code></td><td>string</td></tr>
    <tr><td><code>autoConnect</code></td><td><code>--auto-connect</code></td><td>boolean</td></tr>
    <tr><td><code>pinTab</code></td><td><code>--pin-tab</code></td><td>boolean</td></tr>
    <tr><td><code>annotate</code></td><td><code>--annotate</code></td><td>boolean</td></tr>
    <tr><td><code>colorScheme</code></td><td><code>--color-scheme</code></td><td>string (<code>dark</code>, <code>light</code>, <code>no-preference</code>)</td></tr>
    <tr><td><code>downloadPath</code></td><td><code>--download-path</code></td><td>string</td></tr>
    <tr><td><code>contentBoundaries</code></td><td><code>--content-boundaries</code></td><td>boolean</td></tr>
    <tr><td><code>maxOutput</code></td><td><code>--max-output</code></td><td>number</td></tr>
    <tr><td><code>allowedDomains</code></td><td><code>--allowed-domains</code></td><td>string[]; must list at least one domain (an empty array is rejected); 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</td></tr>
    <tr><td><code>capture</code></td><td><code>--capture</code></td><td>string[]; only <code>flow</code> is supported. A launch setting: passing it to a running session without it relaunches the browser with capture on. Ignored in project config</td></tr>
    <tr><td><code>actionPolicy</code></td><td><code>--action-policy</code></td><td>string</td></tr>
    <tr><td><code>confirmActions</code></td><td><code>--confirm-actions</code></td><td>string</td></tr>
    <tr><td><code>confirmInteractive</code></td><td><code>--confirm-interactive</code></td><td>boolean</td></tr>
    <tr><td><code>engine</code></td><td><code>--engine</code></td><td>string (<code>chrome</code>, <code>lightpanda</code>, <code>firefox</code>, <code>obscura</code>)</td></tr>
    <tr><td><code>screenshotDir</code></td><td><code>--screenshot-dir</code></td><td>string</td></tr>
    <tr><td><code>screenshotQuality</code></td><td><code>--screenshot-quality</code></td><td>number (0-100)</td></tr>
    <tr><td><code>screenshotFormat</code></td><td><code>--screenshot-format</code></td><td>string (<code>png</code>, <code>jpeg</code>)</td></tr>
    <tr><td><code>idleTimeout</code></td><td><code>--idle-timeout</code></td><td>string (<code>10s</code>, <code>3m</code>, <code>1h</code>, or raw ms); defaults to <code>1h</code>, while <code>0</code> disables idle shutdown</td></tr>
    <tr><td><code>noAutoDialog</code></td><td><code>--no-auto-dialog</code></td><td>boolean</td></tr>
    <tr><td><code>model</code></td><td><code>--model</code></td><td>string</td></tr>
    <tr><td><code>headers</code></td><td><code>--headers</code></td><td>string (JSON)</td></tr>
    <tr><td><code>plugins</code></td><td>(config only)</td><td>plugin config[]</td></tr>
  </tbody>
</table>

Values too large to convert to milliseconds produce a warning and are ignored.

## Common Configurations

The examples below use settings outside the project config allowlist. Save them in `~/.agent-browser/config.json` or load the file explicitly with `--config`.

### Local Development

```json
{
  "headed": true,
  "profile": "./browser-data"
}
```

### Behind a Proxy

```json
{
  "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. Browser trust does not support Chrome profiles, CDP attach, providers, Lightpanda, macOS, or Windows.

`caCert` and `useSystemCa` also apply to the CLI's own HTTPS requests on every platform. `read`, `install`, `upgrade`, and `doctor` make their own HTTPS requests and trust the built-in Mozilla roots by default. On every platform, `--ca-cert` adds the CA to those requests, and `--use-system-ca` switches them to the operating system trust store, which already holds a CA deployed by MDM or an enterprise image. `SSL_CERT_FILE` is used as a fallback CA file and is ignored with a warning when unusable. Neither option disables certificate or hostname verification. For `read`, a selection given on the command line stays in effect for the session until `close`, including across daemon restarts; `--no-ca-cert` or `--use-system-ca false` turns it off. `read` never launches or relaunches a browser because of these options. They do not yet change how agent-browser connects to a remote browser over `--cdp`, `--auto-connect`, or a provider.

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

```json
{
  "proxy": "http://proxy.corp.example.com:8080",
  "proxyBypass": "localhost,*.internal.com",
  "ignoreHttpsErrors": true
}
```

### CI / Devcontainer

```json
{
  "args": "--no-sandbox,--disable-gpu",
  "ignoreHttpsErrors": true
}
```

Set these in `~/.agent-browser/config.json` or a file loaded with `--config`; the auto-discovered `./agent-browser.json` ignores `args` with a warning.

### iOS Testing

```json
{
  "provider": "ios",
  "device": "iPhone 16 Pro"
}
```

### AI Agent Security

```json
{
  "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:

```bash
agent-browser --headed false open example.com
```

A bare flag is equivalent to passing `true`:

```bash
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

The auto-discovered project config ignores `extensions` with a warning. Put extension paths in user config or an explicitly loaded config, or set `AGENT_BROWSER_EXTENSIONS` or pass `--extension`.

## Plugins

Configure external plugins with the `plugins` array in user config or a file loaded with `--config`:

See [Plugins](/plugins) for the plugin author protocol and implementation examples. Use `agent-browser plugin add <ref>` to create this config automatically; it writes `~/.agent-browser/config.json` by default, and `--project` writes `./agent-browser.json` (only used with `--config`).

```json
{
  "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"]
    }
  ]
}
```

The auto-discovered `./agent-browser.json` ignores `plugins` with a warning. To use a project file's plugin entries, load it with `--config`; that file replaces default discovery. `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.

```bash
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

A connection target set in the config file (`cdp`, `provider`, `autoConnect`) or in the environment (`AGENT_BROWSER_CDP`, `AGENT_BROWSER_PROVIDER`, `AGENT_BROWSER_AUTO_CONNECT`) is a session default. It applies only to a session that has no target yet. The same target as a command-line flag is explicit and replaces the session target.

These environment variables configure additional daemon and runtime behavior:

<table>
  <thead>
    <tr><th>Variable</th><th>Description</th><th>Default</th></tr>
  </thead>
  <tbody>
    <tr><td><code>AGENT_BROWSER_CONFIG</code></td><td>Path to an explicit config file.</td><td>(default discovery)</td></tr>
    <tr><td><code>AGENT_BROWSER_SESSION</code></td><td>Isolated browser session name.</td><td><code>default</code></td></tr>
    <tr><td><code>AGENT_BROWSER_AUTO_CONNECT</code></td><td>Auto-discover and connect to a running Chrome instance. <code>0</code>, <code>false</code>, <code>no</code> or an empty value leave it off.</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_ALLOW_FILE_ACCESS</code></td><td>Allow <code>file://</code> URLs to access local files.</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_EXECUTABLE_PATH</code></td><td>Custom browser executable path.</td><td>(auto-discover)</td></tr>
    <tr><td><code>AGENT_BROWSER_PROFILE</code></td><td>Chrome profile name or persistent profile directory.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_STATE</code></td><td>Storage state file to load at launch.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_PROXY</code></td><td>Proxy URL. Takes precedence over standard proxy variables.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_PROXY_BYPASS</code></td><td>Proxy bypass host list.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_PROXY_USERNAME</code></td><td>Proxy username when credentials are supplied separately.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_PROXY_PASSWORD</code></td><td>Proxy password when credentials are supplied separately.</td><td>(none)</td></tr>
    <tr><td><code>HTTP_PROXY</code> / <code>HTTPS_PROXY</code> / <code>ALL_PROXY</code></td><td>Standard proxy fallback variables.</td><td>(none)</td></tr>
    <tr><td><code>NO_PROXY</code></td><td>Standard proxy bypass fallback.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_ARGS</code></td><td>Browser launch arguments, separated by newlines or by commas before another flag. Commas inside a value are kept.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_USER_AGENT</code></td><td>Custom User-Agent string.</td><td>(browser default)</td></tr>
    <tr><td><code>AGENT_BROWSER_PROVIDER</code></td><td>Browser provider such as <code>ios</code>, <code>browserbase</code>, <code>kernel</code>, <code>browseruse</code>, <code>browserless</code>, <code>agentcore</code>, or a configured <code>browser.provider</code> plugin name.</td><td>(local browser)</td></tr>
    <tr><td><code>AGENT_BROWSER_HIDE_SCROLLBARS</code></td><td>Hide native scrollbars in headless Chromium screenshots.</td><td><code>true</code></td></tr>
    <tr><td><code>AGENT_BROWSER_COLOR_SCHEME</code></td><td>Color scheme preference (<code>dark</code>, <code>light</code>, <code>no-preference</code>).</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_DOWNLOAD_PATH</code></td><td>Default directory for browser downloads.</td><td>(temp directory)</td></tr>
    <tr><td><code>AGENT_BROWSER_DEFAULT_TIMEOUT</code></td><td>Default timeout in ms. Keep below 30000 to avoid IPC timeouts.</td><td><code>25000</code></td></tr>
    <tr><td><code>AGENT_BROWSER_NAMESPACE</code></td><td>Namespace for daemon sockets and restore-state directories.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_RESTORE</code></td><td>Auto-save/load state persistence key.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_RESTORE_SAVE</code></td><td>Restore save policy: <code>auto</code>, <code>always</code>, or <code>never</code>.</td><td><code>auto</code></td></tr>
    <tr><td><code>AGENT_BROWSER_AUTOSAVE_INTERVAL_MS</code></td><td>Minimum ms between periodic session autosaves while the browser is open. <code>0</code> saves only on close.</td><td><code>30000</code></td></tr>
    <tr><td><code>AGENT_BROWSER_RESTORE_CHECK_URL</code></td><td>URL pattern restored state must match.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_RESTORE_CHECK_TEXT</code></td><td>Page text restored state must contain.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_RESTORE_CHECK_FN</code></td><td>JavaScript expression restored state must satisfy.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_SESSION_NAME</code></td><td>Legacy auto-save/load state persistence name.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_STATE_EXPIRE_DAYS</code></td><td>Auto-delete saved session states older than N days.</td><td><code>30</code></td></tr>
    <tr><td><code>AGENT_BROWSER_ENCRYPTION_KEY</code></td><td>64-char hex key for AES-256-GCM session encryption.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_EXTENSIONS</code></td><td>Comma-separated browser extension paths. Extensions work in both headed and headless mode.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_INIT_SCRIPTS</code></td><td>Comma-separated paths to page init scripts.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_ENABLE</code></td><td>Comma-separated built-in init script features such as <code>react-devtools</code>.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_HEADED</code></td><td>Show browser window instead of running headless (<code>1</code> to enable).</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_WEBGPU</code></td><td>Enable WebGPU; SwiftShader software Vulkan on Linux, no GPU required (<code>1</code> to enable).</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_NO_XVFB</code></td><td>Disable automatic Xvfb virtual display for headed mode on displayless Linux hosts (<code>1</code> to disable).</td><td>(auto-Xvfb enabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_NO_VERSION_CHECK</code></td><td>Skip the outdated Chrome check, which fetches the Chrome Releases blog once per browser version in each session (<code>1</code> to disable).</td><td>(check enabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_CLEAR_CA_CERT</code></td><td>Clear CA trust retained by the running browser session.</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_USE_SYSTEM_CA</code></td><td>Use the operating system trust store for the CLI's own HTTPS requests (<code>1</code> to enable).</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_JSON</code></td><td>Use JSON output by default.</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_ANNOTATE</code></td><td>Enable annotated screenshots by default.</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_CDP</code></td><td>Connect the daemon to a CDP port or WebSocket URL.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_CDP_HEADERS</code></td><td>JSON object of headers sent on CDP discovery and the WebSocket handshake, such as <code>Authorization</code>.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_STREAM_PORT</code></td><td>Override the WebSocket streaming port. By default, an OS-assigned port is used. Set this to bind to a specific port (e.g., <code>9223</code>).</td><td>OS-assigned</td></tr>
    <tr><td><code>AGENT_BROWSER_DASHBOARD_ALLOWED_ORIGINS</code></td><td>Comma-separated exact HTTPS origins allowed for a reverse-proxied dashboard. Every entry must be valid or dashboard startup fails. Without this setting, only loopback origins are accepted. Loopback access does not require the external dashboard token.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_STREAM_QUALITY</code></td><td>JPEG 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.</td><td><code>80</code></td></tr>
    <tr><td><code>AGENT_BROWSER_STREAM_MAX_WIDTH</code></td><td>Cap the encoded frame width in pixels. Caps the frame only and leaves the page size alone, so pointer coordinates are unaffected.</td><td>the viewport</td></tr>
    <tr><td><code>AGENT_BROWSER_STREAM_MAX_HEIGHT</code></td><td>Cap the encoded frame height in pixels.</td><td>the viewport</td></tr>
    <tr><td><code>AGENT_BROWSER_IDLE_TIMEOUT_MS</code></td><td>Auto-shutdown the daemon after N ms without commands or dashboard input. Set <code>0</code> 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.</td><td><code>3600000</code> (1 hour)</td></tr>
    <tr><td><code>AGENT_BROWSER_IOS_DEVICE</code></td><td>Default iOS device name for the <code>ios</code> provider.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_IOS_UDID</code></td><td>Default iOS device UDID for the <code>ios</code> provider.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_DEBUG</code></td><td>Enable debug output (<code>1</code> to enable).</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_CONTENT_BOUNDARIES</code></td><td>Wrap page output in boundary markers for LLM safety.</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_MAX_OUTPUT</code></td><td>Max characters for page output (truncates beyond limit).</td><td>(unlimited)</td></tr>
    <tr><td><code>AGENT_BROWSER_ALLOWED_DOMAINS</code></td><td>Comma-separated allowed domain patterns (e.g., <code>example.com,*.example.com</code>). An empty value is rejected; unset the variable to run unrestricted. Requires a fresh controllable browser context without profile/session startup args, restore/state replay, or direct-page provider plugins.</td><td>(unrestricted)</td></tr>
    <tr><td><code>AGENT_BROWSER_ACTION_POLICY</code></td><td>Path to action policy JSON file.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_CONFIRM_ACTIONS</code></td><td>Comma-separated action categories requiring confirmation.</td><td>(none)</td></tr>
    <tr><td><code>AGENT_BROWSER_CONFIRM_INTERACTIVE</code></td><td>Enable interactive confirmation prompts (auto-denies if stdin is not a TTY).</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_ENGINE</code></td><td>Browser engine to use: <code>chrome</code> (default), <code>lightpanda</code>, <code>firefox</code>, <code>obscura</code> (experimental).</td><td><code>chrome</code></td></tr>
    <tr><td><code>AGENT_BROWSER_NO_AUTO_DIALOG</code></td><td>Disable automatic dismissal of <code>alert</code>/<code>beforeunload</code> dialogs.</td><td>(disabled)</td></tr>
    <tr><td><code>AGENT_BROWSER_PLUGINS</code></td><td>JSON plugin registry override.</td><td>(config discovery)</td></tr>
    <tr><td><code>AGENT_BROWSER_SCREENSHOT_DIR</code></td><td>Default screenshot output directory.</td><td>(temp directory)</td></tr>
    <tr><td><code>AGENT_BROWSER_SCREENSHOT_QUALITY</code></td><td>JPEG screenshot quality from 0 to 100.</td><td>(format default)</td></tr>
    <tr><td><code>AGENT_BROWSER_SCREENSHOT_FORMAT</code></td><td>Screenshot format: <code>png</code> or <code>jpeg</code>.</td><td><code>png</code></td></tr>
    <tr><td><code>AGENT_BROWSER_SOCKET_DIR</code></td><td>Advanced override for daemon socket files.</td><td>runtime dir or <code>~/.agent-browser</code></td></tr>
    <tr><td><code>AGENT_BROWSER_SKILLS_DIR</code></td><td>Override the directory used by <code>agent-browser skills</code>.</td><td>bundled skills</td></tr>
    <tr><td><code>AGENT_BROWSER_COLOR</code></td><td>Enable colored CLI output when truthy.</td><td>(disabled)</td></tr>
    <tr><td><code>NO_COLOR</code></td><td>Disable colored output when present.</td><td>(not set)</td></tr>
    <tr><td><code>AI_GATEWAY_URL</code></td><td>Vercel AI Gateway base URL.</td><td><code>https://ai-gateway.vercel.sh</code></td></tr>
    <tr><td><code>AI_GATEWAY_API_KEY</code></td><td>API key for the Vercel AI Gateway. Required to enable AI chat.</td><td>(none)</td></tr>
    <tr><td><code>AI_GATEWAY_MODEL</code></td><td>Default AI model for dashboard chat.</td><td><code>openai/gpt-6-luna-fast</code></td></tr>
  </tbody>
</table>

Invalid `--max-output` and `AGENT_BROWSER_MAX_OUTPUT` values emit a warning and leave the existing output limit unchanged.

## 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.
- **Unsupported keys** in auto-discovered project config are ignored with a warning.
- **Unknown keys** in user or explicitly loaded config are silently ignored for forward compatibility.

Existing project configs that use advanced keys must move those settings to user config or be loaded explicitly with `--config`.
