Skip to content

feat(apps): let an app's own agent browse its approved sites unasked - #38333

Merged
iamwhatever merged 1 commit into
mainfrom
feat/app-browser-player
Nov 17, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/app-browser-player

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An app's own agent can drive Crew's browser on the pages the owner approved for that app, without an approval card per step, and the app's page can pause, play, seek and set the volume of that tab at once.

An app whose agent works a website for the owner (search it, open a result, play it) meets an approval card on every browser call, and "Always allow" is refused for Kiro Crew's own tools. One search-and-play is 8-15 calls, so the owner either clicks a dozen cards or gives up. The app page has no way to pause or change the volume of that tab without starting an agent turn.

Why it matters

Apps that need the owner's own logins and sound (first: the Mood Music app, playing YouTube and bilibili in the owner's Chrome on a Mac-local gateway) cannot use the browser in practice today. The only wider workaround, a standing grant for the browser tool, would cover every agent on every site.

Not a goal

  • A stronger sandbox for agent browsing (a separate profile, read-only modes). The owner accepted the current risk for now; that is a follow-up.
  • Recording the browser's audio and streaming it to the dashboard.
  • Letting any agent other than an app's own sessions browse unasked.
  • A drawn player component: the SDK ships a hook and the app lays out its own buttons.

What changed (motivation → approach → change)

Goal → the narrowest grant that removes the per-step card for one app only → three pieces.

  1. Declaration and approval. permissions.browserSites lists exact https:// origins plus a path pattern each (https://www.youtube.com/watch, https://www.bilibili.com/video/*; * matches any run of characters by a linear search with no backtracking; the query is not compared). Entries are validated like ui.frameSources origins plus a strict path (apps/browser_sites.py). The family is staged, explicit-only, and in _OWNER_APPROVED_FAMILIES, so an install never approves it: the owner approves it on the app's page, which says what it allows. app_browser_sites(app) reads it fresh per call and is empty unless the declaration validates, the entries are approved, the app is enabled and trusted.

  2. Two enforcement points. A new grant row in the tool gate, app-browser-sites (a thin facade row, hooks._tier_app_browser_sites, whose conditions in apps/browser_sites.gate_grants are imported only when a call reaches it, so nothing is added to an MCP listing's imports and the listing ceilings stay at main's values; after every deny row and governance), approves a call only when the caller is the app's own dashboard slot (facts.app on a dashboard: session key, the kind the op route resolves; a subagent or channel session the app started keeps its card), the call is @kirocrew-core/browser by verified identity, the app holds sites, and a URL the call names (navigate, tabs new) is one of them. confirm_tools still asks; classifier_only skips it. The op route (browser_ops.session_sites) holds every op of such a session to the pages whoever approved it: a request off them answers site_not_allowed before the browser is touched, and the op context's page gate is narrowed so a redirect, link or history landing off them is moved to about:blank (redirect_refused) by the existing landing checks. A slot the gate approved a call for stays held once its sites are gone (it then opens no page), so a call approved before a revoke or a manifest edit never runs unconfined. I picked refusal over falling back to a card for off-list pages: the gate cannot see where a click lands, the route can, and a refusal fails closed.

  3. Media buttons. POST /api/browser/media (handlers/browser_media.py) runs a new walker method, media, in the isolated world on the session's own tab: play, pause, seek, volume, state of the main <video>/<audio>. It refuses the internal secret (403 internal_secret_required), non-owners and app tokens (owner_only), asks capabilities.browse, and acts only for a slot an app with approved sites owns (not_app_browser). It never starts the browser (no_tab), and leaves a tab the person has taken over alone (user_in_control), under the same takeover fence the agent's ops take. A play the browser refuses gets one click on the element to unlock autoplay, after the page is judged again (per request, so a tab that moved to another site unlocks again). A state read writes no audit row, since a player polls it. The SDK's useBrowserMedia hook reaches it (APP_SDK_LEVEL 10, joining the batch level 10 opened on main).

  4. Continuous play (owner's scope addition). The state read (GET /api/browser/media?session_key=: paused, ended, currentTime, duration, ...) is the signal; useBrowserMedia(sessionKey, { pollMs, onEnded }) calls onEnded once per ending, derived in the page from the state it already polls. That is the smallest fit with the existing app-kit pattern (page polls an owner route through the scoped client): no new route, event or SSE stream, and nothing the agent can reach. The page can then send the app's own agent a message, or post to the app's own backend. With the page closed nothing reads the tab, so no ending is seen (details in a PR comment).

Risk the owner accepted. The app's agent types and clicks unasked in a browser that may hold the owner's logins, on the approved pages only. A stronger sandbox is a follow-up. Residual: the route finds the session from the key the browser tool's shim resolves; a call whose shim cannot name the app's slot is not confined there, while the gate approved it for that slot.

Docs: app-kit-platform §44, manifest and API reference, browser.md (security rows), the gate table in memory-skills-hooks.md.

Backwards compatibility

Compatible: the field is new and optional, the route and hook are new, and a session no app with approved sites owns browses exactly as before.

Removes nothing: no route, key, row or behaviour is hidden, deleted or tightened for any existing caller.

Tests

  • test/test_app_browser_sites.py (new): entry validation and URL matching (dot segments, escaped separators, port, user info, look-alike hosts refused); install approves nothing and the owner's approval does; disable, withdrawn trust, a dropped site and an invalid live edit end the grant at once; the gate row approves only the app's own browser call on its pages and leaks to no other app, caller, tool, server, unverified identity or off-list URL; confirm_tools and classifier_only still ask; the op route refuses an off-list request before the browser and blanks an off-list landing, and a person's session is unchanged; a subagent, cron or channel session of the app keeps its card; a pathological landing path against a many-star pattern stays linear; the media route refuses the internal secret and an app token, leaves a taken-over tab alone, refuses a session no app with sites owns, validates action and value, never starts the browser; a refused play clicks once and a play that starts clicks nothing, also after the tab moves to another site; a state poll writes no audit row; media on an off-list page is blanked.
  • Mutation checks: 25 guards broken one at a time (each gate condition including the dashboard-slot key, the route's off-site refusal and narrowed page gate, the media route's owner gate and app check, enabled/trust/validation in the reader, the owner-approved family, the path escape check, the linear matcher's missing-piece check, the takeover check, the click only while play stays paused, no audit row for a state read); every mutant fails the new tests.
  • test/test_gate_tiers.py: the golden order and one scenario for the new row. test/test_browser_live_routes.py, test/test_browser_browse_governance.py: the media route joins the owner-only and governed route lists. test/test_hooks_composition_contract.py: the row is listed as a facade definition (gate_tiers is at its line cap, and an owner module would add to every listing's import count). test/test_mcp_listing_import_budget.py: unchanged. The media state read is a GET, so a player's poll writes no audit row. AppDetailPageCoverage.test.tsx: the staged sites row and its consent; AppSdkBrowserMedia.test.tsx: the hook.

Proof: not provable -- other: new feature; every guard is covered by the mutation checks above instead.

Manual verification

  • Screenshot harness website/scripts/capture-38306-browser-sites-approval.mjs on the built SPA: the staged row, the consent it sends, the approved state, light and dark.
  • Still required on a Mac-local gateway: Mood Music's agent opens a bilibili or YouTube page in the owner's Chrome with no approval card, the page buttons pause and resume with sound, and an off-list link lands on about:blank. That needs the app PR that declares the sites.

Screenshots / video

Staged browsing sites on the app's page (light, dark):

After approval

Related Issues

Closes #38306

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of f4fc4570bba7344465e3d0931a3719a2c9b583f7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The grant is narrow and approved by the owner, both enforcement points read one fresh source and fail closed, and rendered evidence is attached.

Notes

  • The confinement depends on the gate's facts.session_key and the shim's _resolve_session_key() naming the same slot. _granted is a 4096-entry, in-process memo. A test that runs one call end to end, from the shim's key to the route's session_sites, would pin the residual the description admits ("a call whose shim cannot name the app's slot is not confined"), so it is a test failure rather than a silent bypass.
  • When sites are present, the gate approves every op that names no URL (click, type, tabs switch) and relies on the route's landing check to stay on the approved pages. Keep that coupling in one named contract (the browser_call_url reading on both sides), so adding a browser op that names a URL also has to update the matcher.

[DESIGN-REVIEWED] f4fc457

Description read

[DESCRIPTION-READ] 637e5592d78787dd4f0aedebdecb532f24c6854143bbb5751892d5097d10b3c9

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of f4fc4570bba7344465e3d0931a3719a2c9b583f7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The one new UI element, the "Browsing sites" row in the existing approval box, follows the pattern of the rows beside it. The blind reader read it correctly, and shots 1→3 show it before and after approval.

Notes

  • grants_reconsent_browser_sites: the blind reader asked whether "the app's own agent" is "the AI assistant I chat with or something separate". Say it outright, e.g. "Mood Music's agent (not your chat assistant) can open…".
  • Once the green bar is dismissed, the approved sites appear nowhere. The "Permissions" card still lists only "API ACCESS /api/browser/media", so the reader "can't find a lasting list of what I approved". Add a "Browsing sites" row to that card from browserSitesGrant.approved.
  • Because this grant lets the agent type and click while signed in as the user, the line "After you approve, you can stop Mood Music using them by disabling it." should not be dimmed. In dark mode (shot-02) the reader found it "dimmer… easier to miss". Give it the same text weight as the row above it.

[UX-REVIEWED] f4fc457

Description read

[DESCRIPTION-READ] 28d20e230809c8b8809e820f0c4c5b0ef55a66dbb012aebc1f92ee19fd789fe7

That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f4fc4570bba7344465e3d0931a3719a2c9b583f7 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The grant is opt-in and nothing gets it by default: the owner has to approve it, and it is confined to one app's own dashboard slot and its approved pages. The closest existing mechanism, workerAutoApprove, approves every tool with no site limit, so this is not a duplicate.

What this change ships

Inventory (10 items) — 9 justified

Intent: an app's own agent works the owner's approved websites without an approval card on every step, and the app page controls that tab's playback right away. ADDITION.

  1. App manifests can declare permissions.browserSites (exact https origins plus path patterns) — justified
  2. The app's detail page offers the declared sites for owner approval, and install approves none of them — justified
  3. browser calls from the app's own dashboard slot on approved pages skip the approval card (new app-browser-sites gate row) — justified
  4. That slot's browser ops are refused (site_not_allowed) or blanked when off the approved pages — justified
  5. After a revoke or a manifest edit, a slot the gate already approved stays held, so it opens no page — justified
  6. New owner-only POST/GET /api/browser/media for play, pause, seek, volume and state — justified
  7. A play the browser refuses gets one click on the media element to unlock autoplay — justified
  8. SDK useBrowserMedia hook with polling and onEnded, APP_SDK_LEVEL 10 — justified
  9. The redirect_refused message now also covers an app's off-list pages — justified
  10. website/scripts/capture-38306-browser-sites-approval.mjs screenshot script — undeclared

[FIRST-PRINCIPLES-REVIEWED] f4fc457

Description read

[DESCRIPTION-READ] 5c11763f351f3277c3caf21a43390b645fe2498e96d8a42400dd1f78c75081cf

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does f4fc4570bba7344465e3d0931a3719a2c9b583f7 newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: adjudicated, zero confirmed regressions.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • ubuntu-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • windows-latest (platform windows): 5 classified, 0 newly refused, 5 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: This change adds nothing to the three shell deny tiers. It adds one grant row (app-browser-sites) and narrows the browser op route's page gate, and only for sessions owned by an app that holds approved browserSites. None of my 15 shell candidates got a script-confirmed regression. The real tightening is in the op route and the media route, which the classifier cannot judge, so I name it below under UNADJUDICATED. That includes one narrowing I can argue but not confirm: a slot that was granted and then revoked keeps refusing every page.

TIGHTENING: the browser op route's committed-URL gate (browser_ops.build_context / session_sites) -- it refuses an app-owned agent session's navigation, or landing, off the owner-approved pages: url_allowed=committed_url_allowed if not sites else _site_gate(sites), with return committed_url_allowed(url) and url_matches(sites, url), and the request-side check off_site = _off_site_url(op, args, sites) if sites else None → site_not_allowed.

ADJUDICATED: 15 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE: I wrote candidates in posix and windows spellings. The diff's only platform-shaped assumptions are about URLs: _URL_SEP = "/", and url_matches refuses a \ in the path and refuses %2e/%2f/%5c. Those assumptions sit in the URL matcher, not in the shell tiers. So the shell rows probe what those tiers might see around this feature on each platform:

  • posix and windows runs of the new test suites and the capture script, with / versus \ paths;
  • curl versus curl.exe reads and POSTs against the local /api/browser/media;
  • manifest reads with ~ versus %USERPROFILE%;
  • HEAD checks of watch and video pages.

No candidate could probe the URL-matcher assumptions. Those are covered under UNADJUDICATED.

UNADJUDICATED:

  • Guard: the op route's site gate. Call path: the @kirocrew-core/browser MCP call goes through the mcp_core shim to POST /api/browser/op (api_browser_op). There, session_sites(request, key, session_key) resolves the slot's _app and then app_browser_sites. Next, _off_site_url answers site_not_allowed, then build_context(..., sites=sites) applies _site_gate on each landing (_refuse_committed_url blanks the page and answers redirect_refused). Legitimate inputs I would have submitted, all for an app session holding https://www.youtube.com/watch:
    • a watch page that redirects through a consent or sign-in host (consent.youtube.com, accounts.google.com) before coming back;
    • https://youtube.com/watch?v=… (bare host, no www.);
    • https://m.youtube.com/watch?v=…;
    • https://www.youtube.com/watch/ (trailing slash);
    • a host written with a trailing dot (the matcher strips it; the entry validator decides whether the entry may contain it);
    • a path with percent-encoded non-ASCII characters, which passes url_matches but which no entry can spell, because entries forbid %;
    • tabs new with url: " about:blank" (leading space): the route strips the URL before matching, but the gate's browser_call_url does not.
  • Narrowing I can argue but not confirm: NO_PAGES stays for the life of the process. Once the gate has approved a call for a slot (note_granted_session), and the app's sites are later revoked or dropped, session_sites returns NO_PAGES for that slot until the gateway restarts. After that, even a browse the owner approves through the normal per-step card is refused on every page. The same holds while the sites are live: the owner card-approves a navigate off the list for that session, and it is still refused (site_not_allowed, "whoever approved the call"). The spec states this as intended. It is still an operation lost for the owner, with no reset short of a restart.
  • Guard: POST/GET /api/browser/media admission (_owner_gate, then browse_refusal, then _owned_session_key, then session_sites, which must be non-empty and not NO_PAGES or the route answers not_app_browser). This is a new route, so nothing it refuses was allowed before.
  • Guard: manifest validation of permissions.browserSites (AppManifest.validate → browser_site_errors). The key is new, so no existing manifest is newly refused, except one that already carried a stray non-list browserSites key. That manifest now fails validation with "must be an array of strings". I did not get a verdict on that input.

[SCOPE-REVIEWED] f4fc457

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed f4fc4570bba7344465e3d0931a3719a2c9b583f7 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f4fc457

Verdict parsed from the review's SHA-scoped output markers for commit f4fc4570bba7344465e3d0931a3719a2c9b583f7.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f4fc4570bba7344465e3d0931a3719a2c9b583f7 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f4fc4570bba7344465e3d0931a3719a2c9b583f7 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f4fc457

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f4fc4570bba7344465e3d0931a3719a2c9b583f7 false-positive: <reason, 20 to 500 characters>

@iamwhatever
iamwhatever force-pushed the feat/app-browser-player branch from bc66573 to 81b46e8 Compare November 17, 2026 09:18
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 81b46e8
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites (hook_runtime/app_browser_grant.py), placed after every deny row and governance, between app-own-server and operator-grants. hooks.py only imports it and adds the owner to compose.
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (64+ cases: no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask). test/test_gate_tiers.py golden order plus a scenario for the row. 19 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py, test_browser_harness_ops.py: all pass on this head.
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_flake_pattern_ratchet.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

@iamwhatever
iamwhatever force-pushed the feat/app-browser-player branch from 81b46e8 to e2e8959 Compare November 17, 2026 09:54
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: e2e8959
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites (hook_runtime/app_browser_grant.py), placed after every deny row and governance, between app-own-server and operator-grants. hooks.py only imports it and adds the owner to compose.
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (64+ cases: no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask). test/test_gate_tiers.py golden order plus a scenario for the row. 20 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py, test_browser_harness_ops.py: all pass on this head.
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_flake_pattern_ratchet.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 17, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 17, 2026
@iamwhatever
iamwhatever force-pushed the feat/app-browser-player branch from e2e8959 to cd1e9b9 Compare November 17, 2026 11:36
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: cd1e9b9
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites (hook_runtime/app_browser_grant.py), placed after every deny row and governance, between app-own-server and operator-grants. hooks.py only imports it and adds the owner to compose.
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (64+ cases: no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask). test/test_gate_tiers.py golden order plus a scenario for the row. 20 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py, test_browser_harness_ops.py: all pass on this head.
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_flake_pattern_ratchet.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 17, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: e15422c
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites (hook_runtime/app_browser_grant.py), placed after every deny row and governance, between app-own-server and operator-grants. hooks.py only imports it and adds the owner to compose.
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (64+ cases: no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask). test/test_gate_tiers.py golden order plus a scenario for the row. 20 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py, test_browser_harness_ops.py: all pass on this head.
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_flake_pattern_ratchet.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

@iamwhatever
iamwhatever force-pushed the feat/app-browser-player branch from cd1e9b9 to e15422c Compare November 17, 2026 12:35
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: b6c8adb
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites (hook_runtime/app_browser_grant.py), placed after every deny row and governance, between app-own-server and operator-grants. hooks.py only imports it and adds the owner to compose.
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (64+ cases: no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask). test/test_gate_tiers.py golden order plus a scenario for the row. 20 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py, test_browser_harness_ops.py: all pass on this head.
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_flake_pattern_ratchet.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

@iamwhatever
iamwhatever force-pushed the feat/app-browser-player branch from e15422c to b6c8adb Compare November 17, 2026 13:09
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 17, 2026
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 17, 2026
@iamwhatever
iamwhatever force-pushed the feat/app-browser-player branch from bc9f739 to 39a922a Compare November 17, 2026 16:52
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 39a922a
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites, placed after every deny row and governance, between app-own-server and operator-grants. The row is a thin facade function, hooks._tier_app_browser_sites; its conditions live in apps/browser_sites.gate_grants, imported only when a call reaches the row, so no module is added to an MCP listing's path (the import ceilings stay at main's values).
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages, and keeps holding a granted slot (no page at all) if its sites vanish before the call reaches it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask; a vanished grant stays held). test/test_gate_tiers.py golden order plus a scenario for the row. 25 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows on earlier heads.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_mcp_listing_import_budget.py (ceilings unchanged from main), test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py: pass on this head (the four aiohttp listing checks fail on bare main on this host too).
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_json_object_body_guard.py, test_app_sdk_level_mirror.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

1 similar comment
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 39a922a
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites, placed after every deny row and governance, between app-own-server and operator-grants. The row is a thin facade function, hooks._tier_app_browser_sites; its conditions live in apps/browser_sites.gate_grants, imported only when a call reaches the row, so no module is added to an MCP listing's path (the import ceilings stay at main's values).
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages, and keeps holding a granted slot (no page at all) if its sites vanish before the call reaches it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask; a vanished grant stays held). test/test_gate_tiers.py golden order plus a scenario for the row. 25 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows on earlier heads.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_mcp_listing_import_budget.py (ceilings unchanged from main), test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py: pass on this head (the four aiohttp listing checks fail on bare main on this host too).
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_json_object_body_guard.py, test_app_sdk_level_mirror.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

An app whose agent works a website for the owner met an approval card
on every browser call, and Always allow is refused for Crew's own
tools, so search-and-play took a dozen clicks.

permissions.browserSites names exact https origins plus a path pattern
each. Install never approves them: the owner approves them on the
app's page (an owner-approved, explicit-only staged family). While the
app is enabled, trusted and approved, the tool gate's new
app-browser-sites row approves the app's OWN sessions' browser calls,
and only a navigate or new tab onto those pages. The op route holds
such a session to the pages whoever approved the call: a request off
them is site_not_allowed, and a landing off them is moved to
about:blank by the existing landing checks.

POST /api/browser/media is the owner's play, pause, seek and volume on
that session's tab, through a walker method run in the isolated world.
It refuses the internal secret, non-owners and app tokens, and any
session no app with approved sites owns. The SDK's useBrowserMedia
hook reaches it; APP_SDK_LEVEL is 10.

The owner accepted the risk of the agent typing and clicking in a
logged-in browser on the approved sites; a stronger sandbox is a
follow-up.

Closes #38306
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: f4fc457
  • What rule changed: one new grant row in hooks.GATE_TIERS, app-browser-sites, placed after every deny row and governance, between app-own-server and operator-grants. The row is a thin facade function, hooks._tier_app_browser_sites; its conditions live in apps/browser_sites.gate_grants, imported only when a call reaches the row, so no module is added to an MCP listing's path (the import ceilings stay at main's values).
  • Before -> after (what was allowed/blocked, now): before, every @kirocrew-core/browser call from an app's agent fell through to an approval card. After, it is auto-approved only when all hold: facts.app is set and the session key is a dashboard: slot key; the identity is verified kirocrew-core/browser; the app is enabled, trusted and holds owner-approved permissions.browserSites (read fresh); a URL the call names is on that list; no confirm_tools pattern names it; not classifier_only. Every other call is judged exactly as before. Nothing new is denied by the gate; the op route additionally holds such a session to its pages, and keeps holding a granted slot (no page at all) if its sites vanish before the call reaches it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the app's agent clicks or types without a card on a page outside its approved list. The op route's narrowed page gate refuses and blanks such a page, and the grant reaches no other agent, app, subagent or tool. It cannot deny or break any other tool call, since the row only approves or steps aside.
  • Evidence checked (which sandbox result proves it): test/test_app_browser_sites.py (no leak to another app, an empty app, a subagent/cron/channel key, an unverified identity, another tool or server, a shell title, missing params, an off-list URL; confirm_tools and classifier_only still ask; a vanished grant stays held). test/test_gate_tiers.py golden order plus a scenario for the row. 25 mutants (each guard broken once) all fail the tests. Security Scope Review: 0 newly refused on macOS, Ubuntu, Windows on earlier heads.
  • No regression:
    • Tools still work (which tools/commands were run, result): test_gate_tiers.py (every deny under every grant), test_hooks_composition_contract.py, test_mcp_listing_import_budget.py (ceilings unchanged from main), test_browser_ops_route.py, test_browser_live_routes.py, test_browser_browse_governance.py: pass on this head (the four aiohttp listing checks fail on bare main on this host too).
    • Backward compatible (old config / old data / old callers still work, how checked): no app declares browserSites yet, and an install never approves it, so the row is inert until an owner approves sites on an app page; existing app sessions and person sessions browse as before (test_a_persons_session_browses_as_before).
    • Existing tests (which suites passed on this head): the suites above plus test_app_frame_sources.py, test_json_object_body_guard.py, test_app_sdk_level_mirror.py, and the frontend AppDetailPageCoverage, AppSdkBrowserMedia, chatProtocolBoundary tests.
  • How to undo: revert this commit; or, per app, disable the app or withdraw its trust, which ends the grant at the next call.

@iamwhatever
iamwhatever force-pushed the feat/app-browser-player branch from 39a922a to f4fc457 Compare November 17, 2026 17:47
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 17, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Continuous play: can an app's backend learn a song ended and wake its agent with the page closed?

No, not today. Checked on this head:

  • Messaging its own agent: available. An app's backend can already send a turn into a chat it owns through ctx.chat_slots (apps/chat_slot_sdk.py, send; needs permissions.chatSlots, keys under the app's own prefix). So the wake half exists.
  • Learning the song ended: missing. Nothing reads the tab unless a request comes in:
    • /api/browser/media is owner-only. It refuses app tokens (owner_only) and the internal secret, so the backend cannot poll it.
    • The gateway has no watcher for media events on a tab. The relay forwards CDP events to the daemon, but nothing subscribes to an element's ended. The walker's media method runs only when called.
    • EventBus only goes from an app out to dashboard websockets, never from the gateway into an app backend.

With the page open, the page's useBrowserMedia({ onEnded }) sees the ending and can send the agent a message itself, or post to the app's own backend route.

Smallest missing piece, not built here: a gateway-side watcher for a held app session's tab. It would read the media state on an interval (or through a relay-owned CDP binding), only while that tab exists and the app holds approved sites. On an ending it would call one declared app backend route, for example a browserMedia.onEnded manifest hook. The backend then wakes its agent through ctx.chat_slots. Open questions for that change: whether a gateway-initiated read under the owner's identity is acceptable with nobody watching, and the cost of unattended agent turns. It should be opt-in per app.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here.

This PR adds a grant that lets an app's own agent run browser calls with no approval card per step. A design that lets an agent skip a person's approval is decided by a maintainer and the security reviewer, so this review does not approve it. The open RFC #38322 covers app access to Crew's browser through a different permission (permissions.browser with an act verb, behind a preview flag). The decision should say whether browserSites stands alone or folds into that design. Each PR should also link to the other.

Review result on f4fc457: no blocking defect found. The review traced the app-browser-sites gate row and its conditions in apps/browser_sites.gate_grants. The call must come from the app's dashboard slot with the verified browser identity, it must not match confirm_tools, the sites are read fresh, and any URL the call names must match a site. The review also confirmed three more points. browserSites is an explicit-only family that only the owner can approve, so an install never approves it. The op route narrows the one url_allowed gate that every landing check already uses. A reviewer ran test/test_app_browser_sites.py and test/test_gate_tiers.py at this head, and all 211 tests passed. PR Readiness is green. Done well: every condition fails closed, and stand-ins that would fail if the browser were reached pin each refused branch.

For the security review:

  • dashboard/handlers/browser_ask.py:135: an ask op in an app session binds to frames using the public gate, not the site list. A cross-origin iframe that is not on the list can receive the owner's answer. The card still names the origin.
  • apps/browser_sites.py:193: once the gate approves a slot, it is held to no pages for the life of the process after its sites are dropped. This applies even to calls the owner approves by hand. The hold lasts much longer than the single in-flight call it covers. A deadline per entry would bound it, or the refusal text could say that browsing stops until the gateway restarts.
  • dashboard/handlers/browser_media.py:96: when capabilities.browse is denied, a media POST is refused but writes no audit row. browse_refusal(audit=request.method != "GET") would match the sibling card routes.
  • The body names a residual risk: if the shim resolves a session key other than the slot the gate approved, the call runs with no card and the route does not confine it.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 30% chance that this change introduces a defect, above the 12% limit for approving on its own.

This PR adds an owner-approved permissions.browserSites grant: a new app-browser-sites gate row that auto-approves @kirocrew-core/browser calls (identity verified) only from an app's own dashboard: slot. It also holds that slot's browser ops to the approved pages, refusing off-list requests (site_not_allowed) and blanking off-list pages it lands on, and adds an owner-only media route plus an SDK hook. I checked the following against the code:

  • The grant can't be self-approved: it is explicit-only, in _OWNER_APPROVED_FAMILIES, and read fresh on every call, re-checking validation, enabled state and the trust ceiling.
  • tabs switch reaches only tabs the agent opened, and reflex and every landing go through ctx.url_allowed.
  • The URL matcher refuses ports, user info, dot segments and encoded separators, and it runs in linear time.
  • The media route refuses the internal secret, app tokens and non-owners, honours the takeover fence, and never starts the browser.
  • The scoped client is a same-origin cookie fetch, so the owner gate passes for in-dashboard app pages.
  • Nothing changes for sessions that no app with approved sites owns.

The one real weakness is the residua

Tier: 2, held for a person: security-sensitive path.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit f4fc4570bb · 2301 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of f4fc457.

Not approving: the code-change-approver says a person should decide, and the Captain asks for a maintainer design sign-off, including whether browserSites stands alone or folds into RFC #38322 (permissions.browser with an act verb). That call is a maintainer's, not mine. No blocking code defect found on this head.

What I checked, against the four questions that matter for this grant:

  1. Who approves the sites. browserSites is registered explicit-only (apps/point_grants.py) and is in _OWNER_APPROVED_FAMILIES (apps/manager_records.py:1145), so an install approves none. I also traced the legacy paths: a missing set approves nothing (_read_approved_grants, manager_records.py:1000), and an "approve what is declared" set freezes explicit-only families to [] (manager_records.py:1050). So the app cannot approve its own sites; only the owner's approval writes them.
  2. Browsing outside the list. I probed url_matches and entry_refusal directly. Refused: other subdomains (m.youtube.com), look-alike hosts (www.youtube.com.evil.com), any port (:443 too), user info, http, dot segments, %2e/%2f escapes, \@evil.com. Entries that are IP literals (127.0.0.1, 10.0.0.1, 169.254.169.254), localhost, [::1], and *. wildcards are refused. Every landing is also ANDed with the existing public-URL gate (browser_ops._site_gate), so redirects and links off the list are blanked by the same landing checks.
  3. What "unasked" skips. Only the gate's app-browser-sites row, after every deny row and governance; confirm_tools still asks, classifier_only skips the row, and the row needs a dashboard: slot, verified @kirocrew-core/browser identity, and an on-list URL for navigate/tabs new. A subagent, cron or channel session of the app keeps its card.
  4. Reuse by another app or chat. The gate row keys on facts.app from the slot's _app, so another app's slot or a person's chat gets no grant.

Notes for the person deciding (non-blocking):

  • src/kiro_crew/dashboard/handlers/browser_media.py:104 and :114: the media route checks that the slot belongs to an app with approved sites, not to the app whose page is calling. The scoped client is a same-origin owner-cookie fetch, so any app page that declares /api/browser/media can play, pause, seek or read the state of another app's tab if it knows that slot key. Impact is small (media controls only, no browsing), but it is a cross-app reach. Comparing the slot's _app with the calling page's host-bound session would close it.
  • src/kiro_crew/apps/browser_sites.py:83: entries use the frameSources host rules, which do not resolve DNS. https://foo.local/x or an internal hostname is accepted as an entry, and the public-URL gate does not catch it either. The owner still approves it on the app page, so this is a consent-text question rather than a hole.
  • src/kiro_crew/apps/browser_sites.py:198 / dashboard/handlers/browser_ops.py:397: once a slot was granted, it is held to NO_PAGES for the life of the process after its sites go, even for calls the owner approves by hand. Fails closed, but the Captain's point about bounding it or saying so in the refusal text stands.
  • src/kiro_crew/dashboard/handlers/browser_media.py:92: a media POST refused by capabilities.browse writes no audit row; audit=request.method != "GET" would match the sibling routes (also raised by the Captain).
  • The residual named in the body (the shim resolves a key other than the slot the gate approved, so the route does not confine the call) is real; it is accepted in the spec, and the decision should say whether that is acceptable.

Bot findings on this head: GPT 6.1 and Opus 5.5 no findings; Design, UX, First Principles and Security Scope PASS. I agree with the Captain's four security notes; none is a defect in the shipped paths.

Tests: ran test/test_app_browser_sites.py, test_gate_tiers.py, test_browser_live_routes.py, test_browser_browse_governance.py, test_hooks_composition_contract.py, test_json_object_body_guard.py and test_mcp_listing_import_budget.py on this head: 439 passed.

AI-assisted, sent by Bolin Review bot

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 17, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Maintainer decision, @iamwhatever: this PR is on hold until the browser RFC #38322 (app SDK browser: a permission-gated view, read and annotate surface) is decided. Both give apps a way into the browser, so we want that design settled first and then fit this change into it, rather than land two separate grants. No code changes are asked for now; the review findings above still apply when it resumes.

AI-assisted, sent by Bolin Review bot

@kyleseaman
kyleseaman enabled auto-merge (squash) November 17, 2026 22:14
@iamwhatever
iamwhatever disabled auto-merge November 17, 2026 22:24
@iamwhatever
iamwhatever merged commit a72d85d into main Nov 17, 2026
113 of 122 checks passed
@iamwhatever
iamwhatever deleted the feat/app-browser-player branch November 17, 2026 22:24
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 17, 2026
iamwhatever pushed a commit that referenced this pull request Nov 18, 2026
Follow-up to #38333 from the review on it (5947126093).

A media POST refused by capabilities.browse now writes its audit row,
like the sibling routes; the state poll (GET) still does not.

A slot held to NO_PAGES after its app's sites were withdrawn now says so
in its refusal, and how the hold ends: enable the app and approve its
sites again. Behaviour is unchanged.

The spec now says the media route cannot tell one app's page from
another's: a page module runs with the owner's cookie, so that needs an
app-scoped credential, which is out of scope here.
KiroCrewCaptain pushed a commit that referenced this pull request Nov 18, 2026
…38866)

Follow-up to #38333 from the review on it (5947126093).

A media POST refused by capabilities.browse now writes its audit row,
like the sibling routes; the state poll (GET) still does not.

A slot held to NO_PAGES after its app's sites were withdrawn now says so
in its refusal, and how the hold ends: enable the app and approve its
sites again. Behaviour is unchanged.

The spec now says the media route cannot tell one app's page from
another's: a page module runs with the owner's cookie, so that needs an
app-scoped credential, which is out of scope here.

Co-authored-by: zejiangg <zejiangg@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(apps): let an app's own agent browse its approved sites without per-step approval

4 participants