Skip to main content

Comet Browser (Comet-Bridge)

Comet-Bridge connects Equabot agents to Perplexity Comet for persistent browser automation. Unlike the equabot-managed browser, which runs ephemeral sessions, Comet-Bridge maintains a long-lived browser with authenticated sessions, tab group isolation, and multi-agent safety controls. Use Comet-Bridge when your agent needs:
  • Persistent login sessions (QBO, Mercury, Google, GitHub, etc.)
  • Multi-step workflows across page navigations
  • AI-powered web research via Perplexity search/research modes
  • Multi-agent tab isolation in shared browser sessions
  • Audit trails for browser actions

When to use which browser

Both can coexist. The routing rule is: prefer the equabot-managed browser for fast, ephemeral checks; use Comet-Bridge for persistent sessions and multi-step workflows.

Prerequisites

Quick start

Architecture

  • comet-mcp: MCP server that exposes 16 tools — 9 browsing (comet_connect, comet_ask, comet_poll, comet_stop, comet_screenshot, comet_mode, comet_shortcut, comet_read_page, comet_wait_for_idle), 1 tab management (comet_tab_groups), 4 lifecycle (comet_lifecycle_start, comet_lifecycle_complete, comet_lifecycle_abort, comet_lifecycle_update), and 2 task management (comet_task_status, comet_delegate).
  • comet CLI: Node wrapper (comet <command>) that routes to core scripts with startup gating and lifecycle metadata.
  • Tab Groups Extension: Chrome MV3 extension loaded in Comet that enables programmatic tab group management.

MCP-to-CLI fallback

When comet-mcp is unavailable (not built, not registered, or the MCP transport fails), agents safely degrade to the comet CLI wrapper. Both paths enforce identical safety controls: identity requirements, tab ownership, startup gating, and audit masking. The route field in lifecycle metadata indicates which path was used (mcp or cli), and fallbackUsed: true flags runs that degraded from MCP. Tab-group and multi-agent operations that require the extension bridge are hard-blocked in both channels when the extension is missing — fallback does not bypass safety gates.

MCP server setup (comet-mcp)

Published package — add to your Cursor MCP configuration (~/.cursor/mcp.json) or ~/.claude.json:
The repo-root .mcp.json is the canonical example. Local development — point to your local checkout with environment variables for the Comet binary and Command Center lifecycle endpoint:

MCP tools

CLI reference

The comet CLI is the unified wrapper for all Comet-Bridge commands.

Commands

Lifecycle flags

Browser commands (browse, auto, interact, etc.) accept lifecycle flags for run tracking: These flags propagate into the lifecycle envelope and audit artifacts.

Session management

Configuration

Comet-Bridge uses scripts/comet-config.mjs for configuration, validated at load time.

Environment overrides

Output directories

All output follows a standard contract under COMET_OUTPUT_BASE:

Multi-agent safety

When multiple agents share the same Comet browser, Comet-Bridge enforces tab ownership and isolation to prevent cross-agent interference.

Tab ownership

Each tab is marked with an agent identity via a document title prefix: [comet-agent:<id>]. Agents can only perform sensitive actions (click, fill, navigate) on tabs they own.

Identity

Multi-agent mode requires identity via CLI flags or environment:

Tab group isolation

When isolateGroups is enabled (default), each agent/task gets its own Chrome tab group. The Comet Tab Groups Bridge extension is required for this feature.

Enforcement layers

Ownership is enforced at three tiers, each catching violations at a different level: In single-agent mode (no agentId/taskThreadId set), all three tiers are effectively no-ops and impose no overhead.

Sensitive actions

The following 17 Playwright Page methods are classified as sensitive and require ownership verification in multi-agent mode: goto, click, dblclick, fill, type, press, selectOption, setInputFiles, check, uncheck, hover, dragAndDrop, evaluate, setContent, reload, goBack, goForward Non-sensitive methods (e.g. title(), url(), screenshot(), content()) pass through without ownership checks.

Ownership errors

When an agent attempts a sensitive action on a tab it does not own, Comet-Bridge throws an OwnershipError: Consumers can catch this error by checking err.code === 'OWNERSHIP_VIOLATION' or err instanceof OwnershipError.

Startup gating

The comet CLI enforces safety checks before running commands. These gates prevent unsafe multi-agent operations.

Policy summary

Bypass

Pass --skip-gate to bypass gating (not recommended for production):

Opt out of tab isolation

Pass --no-isolate-groups to use title-prefix-only ownership (no extension required):

Run lifecycle

Every browser run tracked by Comet-Bridge follows a lifecycle state machine. Both MCP and CLI paths emit identical lifecycle metadata using the shared lifecycle-metadata.mjs module.

States

Transitions

Terminal states (completed, aborted, failed) allow no further transitions. Attempting an invalid transition throws a deterministic error.

Lifecycle envelope fields

Each run produces a lifecycle envelope with these fields:

MCP/CLI parity

Both execution paths produce identical 13-field envelopes:
  • MCP path: comet-mcp tools use lifecycle-mcp-adapter.mjs which calls createLifecycleEnvelope({ route: 'mcp' }).
  • CLI path: cursor-comet.mjs calls createLifecycleEnvelope({ route: 'cli' }) for browser commands.
The shared lifecycle-metadata.mjs module ensures field names, types, and transition rules are the same regardless of invocation channel. When MCP is unavailable and the agent falls back to CLI, the envelope carries route: 'cli' and fallbackUsed: true.

Audit artifacts

Lifecycle events are persisted as JSON files under {COMET_OUTPUT_BASE}/audit/:
Each file contains the full lifecycle envelope plus the event type and timestamp. Audit sessions (browser-audit.mjs) also write lifecycle events to lifecycle.jsonl within the session directory.

Dual-Stream Audit Architecture

Comet-Bridge persists lifecycle events via two parallel audit streams that are always written together. They complement each other and serve different use cases. The runId field is present in both streams and serves as the cross-correlation key. Given a runId, you can locate the corresponding session directory and run JSONL to reconstruct a complete audit picture of the run.

Bootstrap and readiness

Run readiness checks to verify all dependencies before using Comet-Bridge:
Checks performed:
  1. Comet app binary exists and is executable
  2. CDP connection is reachable
  3. comet-mcp server is built
  4. Tab Groups Bridge extension is loaded
  5. Configuration is valid
  6. Output directories are writable

Exit codes

Readiness tiers

The comet readiness command assesses readiness at two tiers:
The tier assessment uses assessReadinessTier() internally: Pilot requires core + CDP + config + output; Broad additionally requires MCP build and extension bridge.

Telemetry

The readiness report includes an operational telemetry section aggregated by collectTelemetrySummary() from events persisted to {COMET_OUTPUT_BASE}/audit/telemetry-events.jsonl. Four event types are recorded:

Tab Groups Bridge extension

The extension enables programmatic tab group management via the Chrome tabGroups API (not available through CDP alone).

Setup

  1. Open comet://extensions in Comet browser
  2. Enable “Developer mode” (top-right toggle)
  3. Click “Load unpacked” and select the comet-mcp/extension/ directory in the Comet-Bridge repo
  4. Verify the “Comet Tab Groups Bridge” extension appears with an active service worker

Tab group operations

Available via comet_tab_groups MCP tool or programmatically: Group colors: grey, blue, red, yellow, green, pink, purple, cyan, orange.

Cookbook

Authenticated session keepalive

Structured data extraction

Multi-step workflow

Lifecycle-tracked workflow

Lifecycle flags attach run metadata to the output JSON and audit artifacts. See Run lifecycle for details.

Multi-viewport visual QA

Perplexity research workflow

Use the MCP tools to run a deep research query and extract results:
  1. comet_connect — attach to browser
  2. comet_mode with mode research — switch to research mode
  3. comet_ask with your research query — send the prompt
  4. comet_read_page — extract the full response

Network capture

Relationship to equabot browser

Comet-Bridge and the equabot-managed browser are complementary:
  • The equabot browser is built into the Gateway, uses Playwright, and is controlled via the browser agent tool. It launches isolated Chromium profiles for each run.
  • Comet-Bridge is an external connection to the Perplexity Comet browser. It maintains persistent sessions with authenticated sites and provides AI-powered search via Perplexity.
They share no state, use different CDP ports (equabot: 18800+, Comet: 9222), and can run simultaneously.

Troubleshooting

CDP not reachable

Extension not detected

Multi-agent command blocked

If you see [comet-gating] BLOCKED, check the error message for the specific issue:
  • Missing identity: set COMET_AGENT_ID or COMET_TASK_GROUP
  • CDP unreachable: start Comet with comet session start
  • Extension missing: load the Tab Groups Bridge extension

Security

  • Comet-Bridge controls a real browser with real sessions. Treat CDP access as sensitive.
  • Keep CDP bound to loopback (127.0.0.1). Never expose port 9222 to the network.
  • Tab ownership prevents cross-agent interference but is not a security boundary; it is a safety mechanism for shared sessions.

Audit masking

Sensitive fields in audit logs and lifecycle events are masked automatically before persistence. Masking operates in four layers: Additionally, startRun() in audit-logger.mjs filters argv arrays for 8 CLI flag-name patterns (--password, --token, --secret, --key, --credential, --auth, --api-key, --private-key), replacing the following value with [REDACTED]. Masking covers audit action logs, lifecycle event payloads, and metadata envelopes. Step data and results in verbose output are masked via maskSensitiveData(). Conversation logs apply the same masking before persistence. OwnershipError sanitizes pageUrl by stripping query parameters and hash fragments before storing, preventing accidental credential exposure in error messages.