Skip to content

BedrockAgentCoreApp SDK needs update to support expanded Request Header Allowlist #468

@naviret

Description

@naviret

Hi team,

We recently expanded the AgentCore Runtime Request Header Allowlist feature (docs). Previously, the allowlist only supported Authorization and headers prefixed with X-Amzn-Bedrock-AgentCore-Runtime-Custom-. The expansion loosens the validation performed in CP to allow customers to configure any valid HTTP header in their allowlist (e.g., X-Custom-Header, X-Api-Key) while blocking certain restricted headers.
The Runtime service (data plane) correctly forwards all allowlisted headers to the container — this has been validated end-to-end in prod PDX.

Where this breaks in BedrockAgentCoreApp:

The _build_request_context method in app.py#L395-L430 still has the old hardcoded filter that only populates context.request_headers with:

  1. The Authorization header
  2. Headers matching the X-Amzn-Bedrock-AgentCore-Runtime-Custom- prefix

Any newly-supported allowlisted header (e.g., X-Custom-Header, X-Api-Key) that arrives at the container is silently dropped by the SDK before reaching the customer's @app.entrypoint handler via context.request_headers.

Ask:

Since BedrockAgentCoreApp is the recommended SDK for building agents on AgentCore, and the docs show context.request_headers as the access pattern, we'd like the SDK to reflect the expanded feature's behavior. The Runtime service has already enforced the allowlist at the CP and forwarded only valid headers to the container — so the SDK should surface all headers that arrive rather than applying its own secondary filter based on the old prefix rules.

We'd really appreciate your help if you guys could take a look. Thanks so much!

Ivan :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions