Skip to content

backends: route host web execution through mandatory egress and per-call admission #3687

Closed

Description

@schlessera

Out of scope

Executor construction (sibling slice), subscription login (sibling slice), a complete USD stop claim, TLS interception, any new public seam.

Context

Part of #2765. Read docs/plans/host-owned-web-search.md, "Common bridge and governance design", items 3 and 4. A server-owned egress proxy already exists (startEgressProxy, packages/ui-sdk/src/server/egress-proxy.ts:124) and fronts the host inference relay for ordinary workers (egress, packages/ui-backend-pi/src/worker-launch.ts:90-92). Upstream utils.ts proxy support can spawn curl and honors bypass settings, so passing proxy variables alone does not establish containment.

Blocked by #3686

Scope

  • Route all executor networking, provider APIs and extracted URLs alike, through a mandatory server-owned egress route. Check DNS/IP/port and every redirect. Refuse private, link-local, metadata and non-HTTP destinations. Bound response bytes. Never forward credentials across unapproved origins.
  • Before each provider call, extraction fallback and nested model call, apply permission, data-routing, taint, attribution, outward-action and budget admission. Record external content as untrusted. Unknown cost stays unknown, and any unmetered path is disclosed.

Acceptance criteria

  • Executor traffic that bypasses the route (direct socket, curl spawn, proxy-bypass settings) fails in tests, and a mutation that removes the mandatory route makes them pass wrongly, recorded in the PR.
  • Redirects to private/metadata destinations and cross-origin credential forwarding are refused, with tests.
  • Data-routing, taint, attribution and budget admission apply to provider calls, extraction fallbacks and nested model calls, with tests. An unknown cost is reported as unknown, never as zero.
  • The session is tainted by forwarded external content, and that is visible through the existing safety history.

Verification

bun run test packages/ui-backend-pi packages/ui-server packages/ui-sdk
bun run check:pr --base origin/main

Loopback-only transport; native/egress tests need hosted proof.

Contract impact

Expected none beyond existing taint/budget semantics. Any new reported coverage field is additive with CONTRACT: handling.

Activity

  1. added
    type: featA new capability or a change in user-visible behaviour.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    area: backendsAgentBackend implementations and the seam they share.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    securityAuth, isolation, egress, secrets, or anything in the threat model.
    on Nov 8, 2026
  2. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #3686 is closed, so scripts/sync-project.ts is removing the blocked label.

  3. removed
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 11, 2026
  4. self-assigned this
    on Nov 11, 2026
  5. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-af263407. Branch: feat/3687-web-egress-admission.

  6. added this to the 0.45.0 milestone on Nov 11, 2026
  7. schlessera commented on Nov 12, 2026

    @schlessera
    OwnerAuthor

    Part A, the mandatory egress route, landed in #3990 as d7f8a2f. Main's run 43184188418 on that commit passed all 17 jobs, heavy proof included. Part B, per-call admission of each web provider request (data routing, budget, unknown-cost attribution, taint visible in the safety history), is in #3991, which closes this issue.

  8. schlessera commented on Nov 13, 2026

    @schlessera
    OwnerAuthor

    Part B landed in #3991 (squash 9e0e736). Main's run on the squash, 43426061524, passed every job. Each external recipient a Pi web call reaches is now admitted for the calling turn: data routing (G2) and budget, with each admitted provider request counted as unknown spend. Pages stay under the egress route (G5). The decision record lists the disclosed gaps.

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

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: backendsAgentBackend implementations and the seam they share.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.securityAuth, isolation, egress, secrets, or anything in the threat model.type: featA new capability or a change in user-visible behaviour.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions