[GH-ISSUE #6793] Support X-Amzn-Bedrock-Request-Metadata for AWS Bedrock cost allocation #11624

Open
opened 2026-08-05 01:30:11 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @mlsmaycon on GitHub (Jul 16, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/6793

Originally assigned to: @mlsmaycon on GitHub.

Summary

Forward the caller's identity to AWS Bedrock in the
X-Amzn-Bedrock-Request-Metadata
header so Bedrock spend routed through the Agent Network can be attributed in AWS Cost
Management
via cost-allocation tags — mirroring the per-user/group breakdown already shown
in the NetBird dashboard.

Promoted from discussion #6765.

Proposed behavior

  • The proxy stamps X-Amzn-Bedrock-Request-Metadata: {"user": <caller>, "group": <authorizing group>}
    on Bedrock upstream requests. group is the group that authorized the request — the same
    identity value already forwarded to other gateways.
  • Values are sanitized to Bedrock's accepted metadata character set (letters/digits/space +
    + - = . _ : / @), so the groups-CSV comma and arbitrary characters in group names don't
    trigger an HTTP 400.

Make identity metadata optional (all providers)

Identity metadata is injected by default for every provider. Add a per-provider
metadata_disabled flag (default false) that suppresses the identity shape while leaving
catalog routing headers intact — surfaced in the dashboard as a Disable identity metadata
toggle.

Out of scope (follow-ups)

  • X-Amzn-Bedrock-Service-Tier
  • Additional Bedrock metadata fields (policy / guardrails) and full per-provider metadata
    customization

Implementation

Originally created by @mlsmaycon on GitHub (Jul 16, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/6793 Originally assigned to: @mlsmaycon on GitHub. ## Summary Forward the caller's identity to AWS Bedrock in the [`X-Amzn-Bedrock-Request-Metadata`](https://docs.aws.amazon.com/bedrock/latest/userguide/cost-mgmt-request-metadata.html) header so Bedrock spend routed through the Agent Network can be attributed in **AWS Cost Management** via cost-allocation tags — mirroring the per-user/group breakdown already shown in the NetBird dashboard. Promoted from discussion #6765. ## Proposed behavior - The proxy stamps `X-Amzn-Bedrock-Request-Metadata: {"user": <caller>, "group": <authorizing group>}` on Bedrock upstream requests. `group` is the group that authorized the request — the same identity value already forwarded to other gateways. - Values are sanitized to Bedrock's accepted metadata character set (letters/digits/space + `+ - = . _ : / @`), so the groups-CSV comma and arbitrary characters in group names don't trigger an HTTP 400. ## Make identity metadata optional (all providers) Identity metadata is injected by default for every provider. Add a per-provider `metadata_disabled` flag (default `false`) that suppresses the identity shape while leaving catalog routing headers intact — surfaced in the dashboard as a **Disable identity metadata** toggle. ## Out of scope (follow-ups) - `X-Amzn-Bedrock-Service-Tier` - Additional Bedrock metadata fields (policy / guardrails) and full per-provider metadata customization ## Implementation - netbird (proxy + management + OpenAPI): #6791 - dashboard (toggle): netbirdio/dashboard#715 - docs: netbirdio/docs#857
saavagebueno added the enhancementfeature-request labels 2026-08-05 01:30:11 -04:00
Author
Owner

@linear-code[bot] commented on GitHub (Jul 16, 2026):

NET-1405

<!-- gh-comment-id:4988348533 --> @linear-code[bot] commented on GitHub (Jul 16, 2026): <!-- linear-linkback --> <p><a href="https://linear.app/netbird/issue/NET-1405">NET-1405</a></p>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#11624