Skip to content

Conversation

@prassanna-ravishankar
Copy link
Member

@prassanna-ravishankar prassanna-ravishankar commented Sep 4, 2025

EDIT: Updated from Security-by-default to pass-through-by-default

This PR enables pass-through by default forwarding of HTTP headers from applications to agents. Sensitive and hop by hop headers are excluded at the FastACP server boundary. Agents receive headers via the unified request object without additional setup.

What changed

  • Forward all headers from request to agents by default
  • Exclude sensitive and transport headers in FastACP using constants
    • Skips headers like x-agent-api-key, connection, content-length, transfer-encoding and common forwarded or sec prefixes
  • Remove allowlist logic from the service
  • Remove header_allowlist from agent config
  • Keep a single request structure so agents read headers from params.request.headers

Why

This supports OAuth tokens, tenant context, tracing and role metadata with minimal configuration. Exclusions protect agent API key and noisy transport headers while keeping the model simple.

Tests

  • Service forwards headers unchanged to agent RPC calls
  • FastACP server does not expose x-agent-api-key and still passes custom headers

If an agent needs tighter rules it can filter inside its handler. This keeps the core path simple and fast.

@jasonyang101
Copy link
Collaborator

Instead of doing extra_headers and adding it to ACP, can you please do something like:

"request": {
  "headers": {
    ...
  }
}

for the ACP. This is because we likely may need to also pass in additional items as well to this and we shouldn't have it expand at the top level too far.

@prassanna-ravishankar prassanna-ravishankar force-pushed the feat/forward-headers branch 3 times, most recently from af44d2a to 7dabcd4 Compare September 5, 2025 16:50
@prassanna-ravishankar prassanna-ravishankar changed the title 🔐 Add Security-by-Default Custom Header Forwarding for AgentEx Add pass-through-by-default Custom Header Forwarding for AgentEx Sep 5, 2025
@prassanna-ravishankar prassanna-ravishankar force-pushed the feat/forward-headers branch 2 times, most recently from f9ac098 to a3f03f8 Compare September 5, 2025 17:13
@prassanna-ravishankar prassanna-ravishankar changed the title Add pass-through-by-default Custom Header Forwarding for AgentEx Add pass-through-by-default Custom Header Forwarding for Agentex Sep 5, 2025
@prassanna-ravishankar prassanna-ravishankar changed the title Add pass-through-by-default Custom Header Forwarding for Agentex Add pass-through-by-default header forwarding Sep 5, 2025
@prassanna-ravishankar prassanna-ravishankar changed the title Add pass-through-by-default header forwarding Pass-through header forwarding with server-side exclusions Sep 9, 2025
@prassanna-ravishankar prassanna-ravishankar force-pushed the feat/forward-headers branch 2 times, most recently from 807f155 to c7731c8 Compare September 9, 2025 13:57
@prassanna-ravishankar prassanna-ravishankar merged commit f9ef768 into main Sep 10, 2025
7 of 8 checks passed
@prassanna-ravishankar prassanna-ravishankar deleted the feat/forward-headers branch September 10, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants