Skip to content

Epic: the four core Pi web tools run in a trusted host executor behind a constrained bridge #2765

Closed
4 of 4 issues completed

Description

@schlessera

Outcome

Ordinary governed and strict Pi workers use web_search, fetch_content, get_search_content and source_check through a constrained, recorded bridge to a host-owned executor that runs the pinned upstream extension in a trusted Pi session, including subscription/current-model search. Provider configuration and credentials never reach the worker.

Why now

Part of the epic #1863 (ordinary Pi web tools execute on the host with isolated, resumable results). The epic carries every maintainer ruling of 2026-10-15; this task delivers the executor, the bridge and the four core tools. Read the executor comparison, especially "Full-extension authority map" and "Common bridge and governance design" items 1-7, and the binding direction in docs/decisions/governed-writable-workers.md:4644-4667.

Today an ordinary Pi worker gets the host's auth.json, models.json and settings.json (or only settings.json on the host inference relay) copied into private state (packages/ui-backend-pi/src/worker-launch.ts:99-102; initialize, packages/ui-backend-pi/src/worker-entry.ts:100-107), with PI_CODING_AGENT_DIR pointed at that state (packages/ui-backend-pi/src/worker-launch.ts:187). The host's web-search.json is resolved from PI_CODING_AGENT_DIR, XDG or HOME (resolveWebSearchConfigPath, packages/ui-sdk/src/server/web-search.ts:188-192), so the worker and the host select different web-search configuration, and putting provider credentials in the worker is ruled out. The worker RPC schema has a bounded, grant-checked bridge but no search method (piWorkerMessage, packages/ui-backend-pi/src/worker-protocol.ts:71-87).

Rulings this task implements (all 2026-10-15, recorded on #1863): architecture C, host-owned execution and credentials; executor A, the full upstream extension in an actual trusted Pi session; workflow A, only web_search, fetch_content, get_search_content and source_check; credential exclusion A, no browser-cookie/profile/keyring acquisition and no credential commands; subscription/current-model search is required.

Shared context

Rulings (all 2026-10-15, recorded on #1863): architecture C, host-owned execution and credentials; executor A, the full upstream extension in an actual trusted Pi session; workflow A, only the four core tools; credential exclusion A, no browser-cookie/profile/keyring acquisition and no credential commands; subscription/current-model search is required. Design: docs/plans/host-owned-web-search.md, "Full-extension authority map" and "Common bridge and governance design" items 1-7.

Constraints and non-goals

Breakdown

Split on 2026-11-08 at the maintainer's request. Order: #3685, then #3686, then #3687 and #3688 in parallel.

Original acceptance criterion Now in
Four tools execute in the host executor, real keyless worker test #3686
Subscription/current-model search through real host-owned auth #3688
Credential sentinels unreadable; no repository code in the credentialed process; parent bytes unchanged #3686
Deferred workflows/excluded credential modes return unsupported and are reported unavailable #3685 (bridge result), #3686 (settings, catalog, brief)
Bridge tests: forged identities, unknown fields, out-of-subset providers, replayed handles, cancellation, deadline, executor death #3685 (death/restart of the real executor also in #3686)
Egress, redirect, data-routing, taint, attribution and budget controls; unknown cost stays unknown #3687
Restricted autonomous turns get no web tool; other behaviour unchanged #3685
Named forwarding, authority and cancellation mutations Each child, for its own guards

Definition of done

All four children are closed and the original criteria above are met. docs/decisions/governed-writable-workers.md is amended with the executor, workflow and credential rulings (#3686). The Pi README describes host-owned web tools instead of the extension refusal for web. #2766 and #2767 can start.

2026-11-08: converted from a task to an epic and split into #3685-#3688 at the maintainer's request. The original scope and criteria are preserved in the table above. Earlier body revisions are in this issue's edit history.

2026-11-10 triage at main 3aadc8df5: repaired the binding-direction and initialize citations. Breakdown, rulings and readiness unchanged.

Activity

  1. added
    type: feat
    area: ui-sdk
    area: ui-server
    area: backends
    priority: p2
    agent-ready
    security
    on Oct 24, 2026
  2. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Readiness review, 2026-11-08: I re-verified the citations at 1619741f2 and corrected them in the body. Worker state copying now lives in worker-launch.ts:99-102, with PI_CODING_AGENT_DIR set at :187. piWorkerMessage is at worker-protocol.ts:71-87. The host-owned direction section is at governed-writable-workers.md:4646-4670. I also added one consequence of #3600 that the source settles: the forwarding tools must be curated worker tools whose results pass the input-safety collector, because managed workers now refuse every loaded extension. No scope or ruling changed. #1863 now sits under the new parent epic #3669, beside #3658 (readiness gate, PR #3673), #3667 (MCP) and #3668 (subagents).

  3. added
    epic
    and removed
    agent-ready
    on Nov 8, 2026
  4. 3 remaining items

  5. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    State, 2026-11-09: #3685 is done. The bridge, the four forwarding tools and the internal executor boundary merged in #3775 (297f6a7d1). Next: #3686, the trusted executor that runs the pinned extension in a host Pi session and wires the broker in production. Its only blocker is now closed. #3687 and #3688 follow #3686.

  6. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    2026-11-10 triage at main 3aadc8df5: repaired the binding-direction citation (governed-writable-workers.md:4644-4667) and the initialize range (worker-entry.ts:100-107). The breakdown is unchanged since the 2026-11-09 state note.

  7. added this to the 0.45.0 milestone on Nov 13, 2026
  8. schlessera commented on Nov 13, 2026

    @schlessera
    OwnerAuthor

    All four children are done: #3685 (bridge), #3686 (trusted host executor, #3968), #3687 (mandatory egress route #3990 and per-call admission #3991) and #3688 (host-owned Pi auth, #3992). Main is green on each squash. Open follow-up: a live-login qualification of subscription and current-model search, as #3688 and the decision record say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendsarea: ui-sdkarea: ui-serverepicpriority: p2securitytype: feat

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions