Skip to content

ui-sdk, modules: taint refusals reach the agent as unrelated errors such as "region not supported" #3431

Closed

Description

@schlessera

Context

When the egress proxy or the provider relay refuses a request because the session is tainted, neither the agent nor the user learns that taint was the cause:

  • Provider relay. The relay answers 403 with {"type":"error","error":{"type":"egress_refused","message":"Provider network admission refused"}} (packages/ui-sdk/src/server/provider-relay.ts:419-423). The OpenAI image provider appends a generic hint to every 403 (packages/module-images/src/providers/openai.ts:197). The CLI therefore printed OpenAI: Provider network admission refused (region not supported, or the org is not verified), and the agent concluded the OpenAI account had a problem.
  • Turn proxy. A narrowed CONNECT is refused with no body the tools surface. WebFetch reports proxy refused the connection, and curl reports CONNECT tunnel failed, response 403.

Observed on a hosted install, 2026-11-02: one image request and several WebFetch calls. In each case the agent's explanation to the user was wrong.

Scope

  • Relay refusals: carry the refusal reason (taint_allowlist, denied_host, not_allowlisted, byte_cap, budget_exceeded) in the response body's error.type or message, without credentials or content.
  • Image providers: do not add the region/verification hint when the response is a relay refusal (brain_provider_refused / egress_refused). Show the relay's message instead.
  • Proxy refusals: answer a refused CONNECT or HTTP request with a short reason in the response, which the proxy currently drops, so WebFetch and curl can surface it. For example: Blocked: this session read untrusted content (<source>); <host> is not on its allow-list.
  • System prompt: make the line about network refusals name taint as a possible cause and say what the user can do.

Out of scope

Acceptance criteria

  • A relayed image request refused for taint produces a CLI error naming the taint cause, with no region/verification hint. The test fails on current main.
  • A refused proxy CONNECT returns a reason that appears in curl -v output in a test.
  • The provider's existing 403 hint still appears for a genuine upstream 403.

Verification

Keyless tests through the real relay and proxy on loopback, with a mutation receipt for the hint suppression.

Contract impact

The relay's refusal body is internal. If error.type values are documented, adding a reason is additive.

Activity

  1. added this to the 0.45.0 milestone on Nov 3, 2026
  2. added
    type: fix
    area: modules
    area: ui-sdk
    priority: p2
    agent-ready
    on Nov 3, 2026
  3. self-assigned this
    on Nov 4, 2026
  4. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Claiming (token c3431-04db). Branch fix/3431-taint-refusal-reasons, based on the epic integration branch epic/3428-session-taint; PR will target the epic with Refs #3431.

  5. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Readiness, 2026-11-04 (epic branch epic/3428-session-taint at 5c883a5b2, main merged in):

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: modulesarea: ui-sdkpriority: p2type: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions