Skip to content

security(runner): reject direct AG-UI connections that bypass backend proxy #754

Description

@jeremyeder

Jira: RHOAIENG-51907

Problem

The runner pod exposes its AG-UI endpoint on port 8001 with no access control. Anyone who can reach the pod (in-cluster, or via port-forward) can:

  • Send prompts and consume the response stream
  • Execute arbitrary work in the session's context
  • Do so without the frontend or backend being aware

The runner doesn't validate that requests came through the backend proxy. There's no shared event bus — AG-UI is request/response SSE, so whoever makes the POST gets the exclusive stream. No fan-out to other listeners.

Impact

  • Work can happen "off-camera" — the UI shows nothing
  • No audit trail through the backend
  • Potential security concern in multi-tenant clusters

Proposed Solution

The runner should validate that AG-UI requests came through the backend proxy. Options:

  1. Require a proxy header/token that only the backend adds (e.g., X-Ambient-Internal-Token)
  2. NetworkPolicy restricting port 8001 to only the backend pod
  3. mTLS between backend and runner

Option 1 is simplest. The backend already has the runner token — it could include it as a header, and the runner validates it.

Context

Discovered when a direct curl to the runner pod via port-forward delivered a prompt and consumed the entire AG-UI stream, leaving the frontend with no visibility into the session's work.

Activity

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

    ambient-code:auto-fixAmber agent: automated low-risk fixes (formatting, linting)stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions