Repository navigation
Conversation
…gin, and egress gate
Owner
Author
|
방향 전환: 내장 브라우저 전용 URL 정책 대신 봇별 범용 도구·명령·MCP 가드레일(+ 위임 안내 강제)로 새 PR에서 설계·구현합니다. |
Merged
4 of 5 tasks
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 harness-enforced per-bot browser host access control (
bot.browserPolicy) so a bot without permission for specific external sites (e.g., Bitbucket PRs) is structurally blocked from reading or reaching them through the built-in browser and directed to the designated delegate bot.browserPolicy):packages/phone-protocol/src/browser-policy.ts,shared/browser-policy.ts,packages/phone-protocol/src/wire.ts,src/state/store.tsx: definesBrowserPolicy({ rules?: Array<{ hosts: string[]; reason?: string; delegateTo?: string }>; allowHosts?: string[] }) with fail-closed URL/scheme parsing, subdomain & IPv6 canonical host matching, wildcard rejection,browserPolicyWidensdiffing, andbrowserPolicyPromptgeneration.server/store.ts,server/routes/bots-create.ts,server/routes/bot-patch.ts,server/admin-activity.ts: validates, persists, and auditsbrowserPolicy; blocks unauthenticated loopback policy widening while any bot is busy (409), mirroringtoolScope.shared/team-backup.ts,server/team-backup.ts: preservesbrowserPolicyacross team backup export/import so policies do not fail open on restore.fill_login+ system prompt:server/browser/engines.ts(RuntimeRouter.agentRpc),server/browser/bot-policy.ts,server/index.ts— blocks denied URLs and non-http(s)/about:blankschemes (javascript:,data:,file:,chrome:,view-source:) before dispatch (including onMy Chrome), discards legacyagent-browserresults whose output references a blocked host, and injectsbrowserPolicyPrompt(bot.browserPolicy)intobrowserPromptFor.omb-cdpCDP dispatch & service):server/browser/dispatch.ts,server/browser/service.ts— enforces default-deny on already-open blocked tabs (e.g., shared browser profiles or tabs left by a person/another bot) with explicit escape actions (open/navigate/readto an allowed URL,tabs(close/list/new),close,restart_browser, redactedstatus), redacts blocked tab URLs/titles/dialogs/auth prompts/downloads fromstatus/tabs/reopenedNote/recoveredResult, blocks and closes popups to denied hosts, and discards post-action tool output (snapshot,read,screenshot,eval,wait,observeChange) if an action lands on a denied host.server/browser/egress/policy.ts,server/browser/egress/registry.ts,server/host/browser.ts,server/turn-resources.ts— blocks TCP/DNS egress to denied hosts (Refusal = "bot-policy") before resolution or upstream tunneling, mapsomb-cdpgateKeyto browsersession, resolves the active bot accurately in both 1:1 and room turns viaTurnOwner.botId(and retainslastBotBySessionbetween turns), bypasses bot policy while a person holds browser control (heldBy(session) !== null), and appends the policy refusal/delegation message intotakeNotice.fill_logingate:server/login-fill.ts,server/host/fill-login-turn.ts— refusesfill_loginon blocked hosts before DOM inspection or credential lookup, and blocks post-submit redirects onto denied hosts.Why
Prompt/SOUL instructions are soft rules that models can violate (for example, a dev bot directly opening a Bitbucket PR in the built-in browser instead of delegating to
PR Reviewer). EnforcingbrowserPolicyat tool ingress, tab/CDP dispatch,fill_login, and the SOCKS5 egress gate closes direct navigation, redirects, link clicks, in-pagefetch(), popups,eval, and shared-profile already-open tab leaks.Before / After
BotRecordhad no per-bot host restriction (browser: falsewas all-or-nothing).fetch(), or inspect already-open tabs on unauthorized hosts (e.g.,bitbucket.org) despite SOUL rules.BrowserEgressSOCKS5 gate, local HTTP servers,Store,createTeamBackup, andPOST /api/bots/PATCH /api/bots/:id):http://blocked.localhost:<port>/secret-pr) -> refused before Chrome starts (isError: true, includesdelegateTo: "PR Reviewer"),0HTTP hits.302redirect (allowed.localhost -> blocked.localhost), in-pagefetch(), link click, andwindow.open()popup -> killed at SOCKS5 egress gate / popup blocker with0HTTP hits and delegation notice.blocked.localhostopen -> Bot A'sopen({}),snapshot,read,screenshot,eval,wait,navigate(reload), andtabs(switch)are all refused without leaking page content;statusandtabs(list)redact URL/title toblocked://blocked.localhost/[blocked by browser policy];open({ url: allowed })escapes cleanly.fillLoginon a blocked page -> refused beforecandidates()is called (0lookups).POST /api/botsrejects wildcard*.bitbucket.org(400),PATCH /api/bots/:idblocks loopback widening while busy (409), allows narrowing while busy (200), and clears vianullwhen idle (200).store.botByThread(roomThreadId) === null) resolve Bot A's policy viaTurnOwner.botIdon shared profiles and keep it active after release vialastBotBySessionuntil Bot B claims the browser.Verification
pnpm typecheck— passed (tsc -b,tsconfig.server.json,packages/phone-protocol/tsconfig.json).pnpm lint(oxlint --deny-warnings .) — passed with 0 warnings/errors.pnpm i18n:check— passed (16 languages, 11,387 strings).pnpm build— passed (tsc+vite build).pnpm vitest runacross 14 related test files (egress/{registry,policy,gate},engines,service,tools,browser-runtime,host/browser,host/fill-login-turn,login-fill,routes/bot-patch,routes/bots-create,team-backup,turn-resources) — all passed (454 passed, 1 skipped).src/locales/vocabulary.test.ts,scripts/testing/file-size-ratchet.test.ts) — passed./tmp):OMB_DATA_DIR=<tmp> OMB_CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" node --experimental-strip-types /tmp/verify-bot-browser-policy.ts->ALL 10 REAL-RUNTIME CHECKS PASSED!OMB_DATA_DIR=<tmp> node --experimental-strip-types /tmp/verify-api-and-host.ts->PASS [api-routes]andPASS [host-room-shared-egress].Notes / Follow-ups
src/components/bot-settings/AccessSection.tsx) is intentionally deferred to a separate PR to keep this core harness PR focused.My Chrome(external user Chrome without OpenMyBot's SOCKS5 gate), Layer 1 pre-dispatch URL/scheme checks,fill_loginchecks, and legacy post-call URL filtering apply, while network-level egress blocking applies to OpenMyBot-managed browsers (omb-cdpandagent-browser).