Kortix in Chrome
A user installs the Kortix Chrome extension and signs in. From then on, any
of their sessions can drive that browser, with its logins, from the cloud
sandbox. The agent runs kortix chrome use, then plain `agent-browser --cdp
9333 …` commands. The browser is a separate product from the agent tunnel
("Your computer"). It shares no code path, credential or UI with it.
The wire contract is references/protocol.md. Read it
before you change any part. A wire change edits that file in the same commit.
Where the code lives
| Part | Path |
|---|---|
| Extension (MV3) | apps/chrome-extension |
| API: control socket, REST, attach | apps/api/src/chrome/ |
| Tables | chrome_connections, chrome_grants, chrome_attachments |
| Sandbox bridge + CDP endpoint | apps/kortix-sandbox-agent-server/src/**/chrome* |
| CLI | apps/cli/src/commands/chrome.ts |
| Agent skill (served to sessions) | packages/starter/templates/managed/skills/kortix-chrome/SKILL.md |
| SDK hooks | packages/sdk/src/**/chrome* (useChromeConnections, useUpdateChromeConnection, useDeleteChromeConnection) |
| Web | apps/web/src/features/chrome/, packages/ui/src/internal/chrome/ (connect steps, Add to Chrome), Apps and extensions card, promo slide project-chrome-nav.tsx, settings tab chrome (/settings/chrome) |
How one action travels
- The agent runs
kortix chrome use. The CLI calls kortixd
POST /kortix/chrome/attach.
- kortixd mints a ticket and calls
POST /v1/chrome/attachwith the session
credential.
- The API picks the owner's browser, applies the access mode, and sends an
attach frame down the extension's control socket. Another replica holds
the socket? Then the frame goes through pg_notify('kortix_chrome_cmd').
- The extension asks for consent if needed. It opens a tab group
Kortix · <session title> and dials the bridge through the existing preview
proxy /v1/p/<sandbox>/8000/kortix/chrome/bridge.
- kortixd serves the bridge as a CDP endpoint on
127.0.0.1:9333. The
extension's shim maps Target.* to chrome.tabs and forwards every page
command to chrome.debugger.
The preview proxy is the rendezvous. It already pipes a long-lived WebSocket
from any API replica into the sandbox, so no replica owns the CDP stream.
Build and load the extension
cd apps/chrome-extension
bun run build # → dist/, ID gefbbnjgoiljpbnalgafbhbfdhikgjek (manifest key)
bun test # shim + auth unit tests
bun run scripts/smoke.ts # headless Chromium + real agent-browser through the shim
- Branded Google Chrome 137+ ignores
--load-extension. Use Chrome for Testing
or Chromium (~/Library/Caches/ms-playwright/chromium-*/…).
- Never run it headed on a shared Mac.
--headless=newruns extensions. - To load it by hand:
chrome://extensions→ Developer mode → Load unpacked →
apps/chrome-extension/dist.
- Point it at another server: the welcome page → "Change" → API URL
(http://localhost:<api port> for a worktree, https://dev-api.kortix.com for dev).
Verify end to end
- Start the worktree stack (
pnpm worktree start <slug>), with the tunnel on,
so cloud sandboxes reach the local API.
- Load the built extension in a headless Chromium. Sign in through the real
OAuth consent page on the local web app.
- Start a real session. In the sandbox, run
kortix chrome useand
agent-browser --cdp 9333 open https://example.com then snapshot -i.
- Assert:
- the API row is online;
- the attachment is
connected; - the tab group exists with the session title;
- the overlay host element is in the page;
- Stop returns
chrome_deniedon the nextuse.
A sandbox runs the new kortixd and CLI only after the API serves them
(/v1/runtime-assets). They converge on boot and at turn end.
Publish to the Chrome Web Store
The item is public: https://chromewebstore.google.com/detail/gefbbnjgoiljpbnalgafbhbfdhikgjek,
publisher "Kortix" (non-trader). Version 1.0.1 went live on 2026-11-21, and the web, the API and
the CLI offer Kortix in Chrome to every project from the same date. Every field of the dashboard
(listing text, permission justifications, data disclosures, test instructions, assets) is in
An approved version goes live at once unless deferred publishing is on. Every upload goes
through review again.
- Raise
versioninsrc/manifest.json. The store accepts only a version higher than the last upload. bun run package→release/kortix-chrome-<version>.zip: the store build (kortix.com only)
without the manifest key, which the store rejects.
- Dashboard → Package → Upload new package, then Submit for review.
- Claude in Chrome cannot read or click the dashboard: Chrome blocks every extension on Web Store
pages ("The extensions gallery cannot be scripted"). A person clicks; the agent prepares the fields.
- The store fetches the Homepage and Support URLs before it allows a submit. A 404 blocks it
("Support URL is not reachable"). The listing uses https://kortix.com/support.
- Reviewers sign in at kortix.com, so prod must serve
/v1/chrome/connections(401, not 404).
deploy-prod.yml sets KORTIX_CHROME_ENABLED=true.
Give the reviewer the prod reviewer account in the Test instructions tab
(references/store-listing.md).
- A brand-new item needs
key.pemat the zip root on its first upload only:
dotenvx get BROWSER_EXTENSION_KEY_PEM_B64 -f apps/api/.env | base64 -d > key.pem.
Availability: one deployment switch, no feature flag
chrome graduated from the feature flags on 2026-11-24. No project can turn Kortix in Chrome
off. KORTIX_CHROME_ENABLED on the API is the only switch: dev, staging and prod set it, a
self-hosted server does not (/v1/chrome/* answers 404 there).
- The API still lists
chromein the box'sKORTIX_FEATURE_FLAGSwhere the switch is on
(apps/api/src/projects/lib/feature-flag-env.ts). kortixd withholds the kortix-chrome skill
(kortix-feature-flag: chrome) and the CLI hides kortix chrome without it.
- The project row sends
experimental.chrome= the switch, for older web, SDK and CLI builds.
Outside a box, the CLI reads it there.
- Each person still decides per browser: they add the extension, set Access
(always / ask / off), and press Stop or Alt+Shift+K.
- A stored
experimental.chromeoverride from the flag era is inert.
Extension surfaces
- Toolbar icon: opens the side panel (web app, session chips with "Add this tab" and Stop). Without
chrome.sidePanelit opens the settings page. Badge: blue count while agents work, grey!when offline. - Settings page (
options.html, "Kortix in Chrome settings"): browser name and status, Access, Tabs, shortcuts, Sign out, Disconnect this browser. - Shortcuts:
Alt+Kopens the panel,Alt+Shift+Kstops every agent. - Overlay bar: docks bottom-right, moves top-right when a page control sits under it.
bun run buildis the store build (kortix.com only).bun run build:devadds "Another server…" to the welcome page.- No
_localesyet: extension strings are English only.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| chrome_offline | Chrome closed, or the worker lost its socket | Open Chrome; the extension reconnects in 1–30 s |
| chrome_denied after Stop | Stop writes a deny grant for that session | The agent asks the user, then kortix chrome use --ask |
| 1011 No browser attached on 9333 | No bridge for this sandbox | Run kortix chrome use first |
| chrome_dial_failed | The extension could not open the bridge (token, proxy, sandbox stopped) | Check the extension worker console and the API preview-proxy logs |
| Commands hang on a background tab screenshot | The tab is not painted | The shim activates the tab before Page.captureScreenshot; an occluded or minimized window can still stall |