Skip to content

Support custom ext_proc callouts on ingress and egress #3259

Description

@destijl

Integrators want to add their own checks (for example, authorization or content inspection) to Substrate's gateways without replacing them.

Today:

  • Egress: --experimental-additional-egress-extproc-service=NS/SVC:PORT adds one vendor ext_proc after Substrate's own. It's experimental, headers only, and Envoy dataplane only.
  • Ingress: no hook.

Proposed:

  • Add an ingress hook (atenet-router flag plus xDS change). It should run before Substrate's ext_proc (deny before resume) so unauthorized requests do not wake suspended actors and cause a denial-of-service on worker pool resources.
  • Graduate the egress hook from experimental.
  • Open questions:
    • Allowing multiple ext_proc callouts in a chain vs. only a single external service.
    • Which Substrate request attributes (e.g. dev.ate.actor.identity, dev.ate.target.actor) are considered stable API for third-party ext_proc services to read.
    • Whether egress callouts should see injected credentials or run prior to injection.
    • Opt-in body processing modes with size limits.

Activity

  1. joeyorlando commented on Nov 13, 2026

    @joeyorlando

    👋 we'd like to use the egress hook for OpenAPPA, an MIT-licensed information-flow policy engine for agents. It tracks what data an agent has touched and refuses tool calls that would leak it, for example a public GitHub comment after a private repo read. At the egress gateway it covers every actor, whatever its harness or image.

    What it needs, from a working prototype I have:

    • Opt-in body access per request. The processor buffers only MCP tools/call POSTs, by returning a mode_override from request_headers, and reads the response to label the actor. Everything else stays headers-only, so SSE streams are never buffered. Sketch: Add --openappa to install OpenAPPA guardrails at the egress gateway #3817, which is allow_mode_override with one allowed mode plus a configurable timeout, and is a no-op by default.
    • dev.ate.actor.identity as a stable attribute. The processor keys its state on it.
    • A longer timeout than 2s, since a decision can need a policy lookup.

    On the open questions: we'd want the callout to run after the policy filter, and ideally not see injected credentials. A single external service is enough for us.

    Spun up a discussion of this in the community slack here - happy to demo on a community call.

  2. JeffLuoo commented on Nov 16, 2026

    @JeffLuoo
    Collaborator

    I'd like to use the egress hook for an out-of-tree Cost Service that meters per-actor LLM token usage at atenet-egress (design doc). Today the additional egress ext_proc filter gets request headers only and fails closed. To meter tokens, the first milestone needs one filter that:

    1. Reads response headers and the response body, with response_body_mode: STREAMED and observability_mode: true. Model responses are often SSE streams with usage in the last chunk. BUFFERED would hold the stream until the response ends and fail on responses over the buffer limit.
    2. Can fail open. An observability-mode filter cannot block or change traffic, so a metering outage should not block model calls. Policy callouts stay fail-closed.

    I'd also like a dev.ate.actor.uid filter state entry next to dev.ate.actor.identity. Cost records are keyed by actor UID, and today I map the identity to a UID from lifecycle events. That mapping can attribute a call to the wrong actor when a name is reused after a crash or a delete.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions