Inspiration

Most browser agents lock you into one vendor's account and route your tabs through their servers. I wanted an assistant that lives in the browser side panel, talks directly to whatever model I already pay for or run locally (Anthropic, OpenAI, Groq, Ollama, OpenRouter, or a self-hosted proxy), and needs no backend server. I also got tired of repeating manual QA clicks before every release, so I built the agent to run checks against the live DOM and export reports I can attach to a pull request or CI run.

What it does

Otter is an open-source side-panel extension for Chrome, Edge, Brave, and Firefox. It reads the active tab and carries out tasks across forms, multi-step flows, cross-origin iframes, data extraction, and file uploads or downloads.

In normal chat, Otter uses 24 browser tools covering clicks, hovers, drag-and-drop, sliders, typing, dropdowns, keyboard shortcuts, scrolling, screenshots, Shadow DOM, embedded iframes, and native browser dialogs. While a run is active, /btw lets you ask a side question without interrupting the current task, and /queue lines up follow-up prompts.

Typing /qa (or /qa checkout totals) starts a structured QA run. Otter plans happy-path, validation, and edge-case checks, drives the page, and evaluates deterministic verify assertions in the DOM with polling timeouts. It also records console errors, uncaught exceptions, and failed 4xx or 5xx network requests, then exports the results as HTML, Markdown, JUnit XML, JSON, or a short summary.

Any finished run can be saved locally as a recipe. Recipes store durable locators (data-testid, ARIA role and name, id, or CSS selectors) along with {{param}} placeholders, so replays run without calling an LLM. If a page changes and a locator breaks, Otter asks the model to complete that step and offers to update the saved recipe. Recipes also export to standalone @playwright/test files, including frameLocator calls for cross-origin iframes.

Frankenstein architecture

For Kiroween 2026 (Frankenstein), Otter combines several mismatched browser and model runtimes into one Manifest V3 extension written in plain JavaScript ES modules with no bundler, no framework, and zero runtime dependencies.

The side panel runs the agent loop, recipe recorder, and QA report view. A content script reads the DOM, performs actions, and evaluates verify assertions. The background service worker manages tab-group isolation and proxies streaming requests for cross-origin custom endpoints.

Input dispatch adapts to each browser and frame. On Chromium, Otter drives trusted input through the chrome.debugger DevTools Protocol API; on Firefox, protected pages, and ambiguous frames, it switches to simulated DOM events before dispatch. On the model side, providers with native tool calling use structured tool schemas, while models without tool support fall back to a text-based [ACTION] protocol.

Cross-origin iframe control uses on-demand chrome.scripting.executeScript injection while keeping "all_frames": false in manifest.json. Child controls receive frame-scoped references (ref_f<frameId>_<N>), coordinates translate into top-viewport space for chrome.debugger, and each iframe origin passes its own host permission check before Otter reads or interacts with it.

Built and hardened with Kiro CLI

I used Kiro CLI (v3.7.1) to specify and verify the cross-origin iframe and security work. The repository commits the full .kiro/ workspace:

  • Architecture, stack, layout, and security steering docs under .kiro/steering/
  • Two validated custom workspace agents in .kiro/agents/: otter-architect for implementation and architecture reviews, and otter-qa for test design and property-based verification
  • Two workspace hooks in .kiro/hooks/ guarding syntax/test runs and manifest.json/package.json version parity
  • Feature specs in .kiro/specs/cross-origin-iframes/ and .kiro/specs/security-and-iframe-pbt/

Running otter-qa produced a 47-property deterministic property-based test suite in tests/pbt.test.js (300 seeded cases per property), bringing the Node test suite to 198 passing tests (npm test) alongside a live headless Chrome E2E suite (npm run test:e2e). Formalizing those properties exposed two security bugs before release: cleanTarget in lib/recipe.js accepted percent-encoded hosts such as a%22b.com that could break out of exported Playwright frameLocator strings, and check in lib/permissions.js evaluated saved rules in list order so an earlier allow could shadow a later deny. Both are fixed and covered by regression tests.

Safety and privacy

API keys stay in chrome.storage.local and are never synced. Every page interaction requires a per-host, per-action grant (read, click, type, navigate, upload, or download), and saved deny rules always win over allow rules. Otter redacts passwords, payment cards, and one-time codes before page data leaves the tab, and pauses with a handoff card for sign-ins, 2FA prompts, and payment checkouts. Attached files stay in the side panel so the model only sees file names, types, and sizes.

Challenges

Making QA checks trustworthy meant refusing to accept a model saying a page looks fine. Assertions had to run as deterministic DOM checks with polling timeouts.

Keeping recipes working after UI changes required recording durable locators instead of temporary element references, then falling back to the model only when a locator breaks.

Supporting cross-origin iframes safely meant enforcing host permissions per frame, translating child coordinates into top-viewport coordinates for Chromium's debugger API, and suppressing overlays inside nested frames.

Supporting Chrome and Firefox from one codebase meant working around API gaps: Firefox has no chrome.debugger API or tab groups, and self-hosted model endpoints bring CORS restrictions and varied tool-calling support.

What I learned

Deterministic DOM assertions, strict permission boundaries, and durable locators matter much more for reliable browser automation than clever prompting. Writing formal properties with Kiro CLI's custom QA agent also caught edge cases in URL escaping and rule precedence that standard unit tests missed.

What's next

Submitting Otter to the Chrome Web Store and Firefox Add-ons, expanding Firefox test coverage, and adding UI localization.

Built With

Share this project:

Updates

Submission history