Repository navigation
feat(browser): connected browser executor, relay connection and local controls - #23
Merged
Merged
Conversation
Let Dewee agents the person allows drive tabs in this Chrome through the Gateway relay (self-hosted, opt-in, off by default). - Relay transport on /ws with the personal API key, heartbeat, backoff and no replay; device enroll/attach/rename/revoke and grants. - Every command is validated and re-checked locally (grant, agent, capability, exact origin, restricted pages, owned tabs, host permission, Pause/Stop) before ack and execution. - Bundled executor for tabs/open/navigate/snapshot/click/type/press/ scroll/wait/close; snapshots redact password, hidden, payment and one-time-code values; risky actions wait for approval in the panel. - Side panel drawer for status, device, grants, approvals and Pause/Resume/Stop; Settings toggle; en and vi strings. - Unit tests, Playwright e2e against a loopback relay and page server, threat model and docs. No new install-time permission. Refs #17 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Ask before pressing Enter, naming the focused element, and re-describe the target after any approval; a changed element fails with stale_ref. - Show a clipped preview of the text that type-with-submit would send. - Redact and refuse typing into revealed passwords, PIN, OTP and verification-code fields, whatever role the page gives them. - Use only grants created in this browser, for this device, over exact origins; require host permission for the exact host. - Re-check the grant and Pause while waiting for text, refuse about:blank, cap command time locally, close tabs created after a cancel, and inject only once storage.local is locked. - Update the threat model and the API contract notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #17 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Gateway answers FAILED_PRECONDITION to every relay method while the workspace has not turned connected browsing on. Registering showed a generic error and an enrolled browser reconnected silently. The panel now says the feature is off and who can turn it on; the reconnect backoff keeps retrying, so the device attaches once it is enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A live spec runs the real build against a local Dewee Gateway and the stub model, which calls the browser tool with target connected: the feature flag off and on, registering, grants per agent and site, open, snapshot, click and type with the password redacted, a site outside the grant, an approval denial, revoke and Stop. With the CLI it also checks the device and grant lists and that browser trace spans carry no typed text. The docs gain the feature flag step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync the contract from the Gateway. A revoked grant now reports grant_revoked, both for a command it cancels and for one that arrives after it. Page results and screenshots carry the page url. After every attach the extension re-sends its control state, active included, so a Resume made offline or a Gateway restart cannot leave the device paused. Grant creation explains a device removed elsewhere (forgotten locally) and an agent the person may not allow. Device names with control or format characters or over 100 bytes, and origins with a trailing dot or an over-long or non-punycode host, are refused before anything is sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ult agent in the live run The Gateway now refuses grants for agents another person owns. The live setup makes the Super Agent the workspace default, as in a real workspace, and the spec checks that the side panel refuses the shared E2E Helper. Trace spans are polled because they are written after the turn ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pause, Stop and Resume are now kept per profile and device in storage.local and re-sent after attach. Without a stored choice nothing is sent, so a pause held by the Gateway is never lifted; a stored choice that cannot be read leaves the browser paused locally. Grant requests and enrollment wait until attach has completed on the socket, so a refusal from a socket still attaching cannot wipe the device. A created grant whose sites, agents or capabilities differ from what the person approved is refused and withdrawn. A refresh that drops a grant cancels its running commands, approvals included, with grant_revoked. A page result that cannot be reported after an interaction is outcome_unknown, since the action may have run. Device names with line or paragraph separators are refused, and an UNAUTHORIZED grant request now explains both causes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y rules A revoked grant reports grant_revoked also for a command in flight, and screenshot is refused when the run's workspace is shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the opt-in connected browser: a Dewee agent can read and act in tabs of the person's own Chrome, only as far as the person allows in the side panel. The extension is an executor, never an agent. It runs a fixed set of bundled actions (
tabs,open,navigate,snapshot,click,type,press,scroll,wait,close) sent by the Gateway relay over/ws. It never runs code, CDP methods or selectors from the wire.Closes #17. Gateway side: nextlevelbuilder/dewee#1221, nextlevelbuilder/dewee#1223 (PR to
devlinked below).What the person controls
<all_urls>). A grant is trusted only if this device created it, it matches what the person approved (origins, agents, capabilities), and the exact host permission is present.t1,t2) and never sees raw tab ids.typewith submit, andpress Enter. Denying or closing returnsapproval_denied.activeonly if the person's last choice was Resume.sensitive_field). Page content is never stored.Notable behaviour
outcome_unknown, never a re-send. This includes an interact result whose page URL cannot be reported.grant_revoked; an expired grant givesgrant_expired.browser.device.attachhas completed, so a not-yet-attached socket can never make the extension forget its device.docs/connected-browser-relay-contract.mdis synced with the Gateway copy.Docs
docs/browser-control-threat-model.md.docs/architecture.md,docs/api-contract.md,docs/development.md,README.md, and the side-panel exception inAGENTS.md.Verification
pnpm lint,pnpm typecheck,pnpm test(688/688) andpnpm buildpass.browser-controlspec (fake relay) andsmokepass 15/15.tests/e2e/live-connected-browser.spec.tspasses 1/1. It runs these scenarios:grant_revoked.selfhostedandcredentialsspecs pass. Four live tests (E1 and three resilience tests) also fail onmainagainst a currentdevGateway because of the extension API read rate limit, tracked in fix(chat): reopening the panel fails to load history when the Gateway read limit refuses a burst #21.🤖 Generated with Claude Code