Skip to content
Merged
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/pages/agent-network/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ upstream:
Guardrails](#policies-limits-and-guardrails).
5. **Stamp identity for the gateway.** Add the caller's identity to the upstream request
(for example into `metadata.tags` and `x-litellm-end-user-id`) for gateways that key
their own budgets and attribution off it.
their own budgets and attribution off it, or into a provider's own cost-allocation
metadata such as AWS Bedrock's `X-Amzn-Bedrock-Request-Metadata`. This is on by default
and can be turned off per provider — see [Identity
Metadata](/agent-network/providers#identity-metadata).
6. **Apply guardrails.** Enforce the model allowlist and the prompt-capture rules.

The request is then forwarded to the upstream API or gateway. On the response leg, in
Expand Down
27 changes: 27 additions & 0 deletions src/pages/agent-network/integrations/bedrock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ for details.
5. Save the provider. The key is now held server-side — the next step authorizes who can use
it.

<p>
<img src="/docs-static/img/agent-network/integrations/agent-network-bedrock-connect.png" alt="Connect the AWS Bedrock provider in NetBird Agent Network" className="imagewrapper" />
</p>

See [Providers](/agent-network/providers) for details.

## Create a Policy
Expand All @@ -64,6 +68,29 @@ before anyone can route through it.

See [Policies](/agent-network/policies) for details.

## Cost Allocation

NetBird forwards the caller's identity to every provider by default — see
[Identity Metadata](/agent-network/providers#identity-metadata) for the general behavior and
how to turn it off. For Bedrock that identity lands in the
[`X-Amzn-Bedrock-Request-Metadata`](https://docs.aws.amazon.com/bedrock/latest/userguide/cost-mgmt-request-metadata.html)
header — the one AWS reads for cost-allocation tags — carrying the caller's **user** and the
**group that authorized the request**:

```
X-Amzn-Bedrock-Request-Metadata: {"user": "user@example.com", "group": "engineering"}
```

Activate the matching **cost-allocation tags** in **AWS Billing and Cost Management → Cost
allocation tags**; Bedrock spend in AWS Cost Explorer can then be broken down by NetBird user
and group. Values are sanitized to Bedrock's accepted character set before they are sent.

The provider's **Mappings** tab shows exactly what NetBird sends:

<p>
<img src="/docs-static/img/agent-network/integrations/agent-network-bedrock-mappings.png" alt="Bedrock identity metadata mapping: user to user email and group to groups in the X-Amzn-Bedrock-Request-Metadata header" className="imagewrapper" />
</p>

## Use with Claude Code

To route [Claude Code](/agent-network/integrations/claude-code) through this Bedrock provider
Expand Down
8 changes: 7 additions & 1 deletion src/pages/agent-network/integrations/litellm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ the gateway can attribute usage and enforce its own controls:
budgets and rate limits.
- The **user identity** is sent in the `x-litellm-end-user-id` header.

The proxy strips any client-supplied value first, so an app can't spoof its identity.
The proxy strips any client-supplied value first, so an app can't spoof its identity. To stop
forwarding identity to LiteLLM, turn off
[Forward identity metadata](/agent-network/providers#identity-metadata) on the provider.
Comment on lines +57 to +59

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Qualify the earlier “every request” claim.

This page currently says NetBird forwards identity on every request, but this section introduces a provider-level opt-out. Change the earlier wording to “by default” or otherwise state that forwarding occurs only while the setting is enabled.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/agent-network/integrations/litellm.mdx` around lines 57 - 59,
Update the earlier identity-forwarding statement in the LiteLLM integration
documentation to clarify that forwarding happens by default or only when the
provider’s Forward identity metadata setting is enabled. Keep the existing
opt-out guidance and meaning unchanged.


<p>
<img src="/docs-static/img/agent-network/integrations/agent-network-litellm-mappings.png" alt="LiteLLM identity mappings: x-litellm-end-user-id to user email and metadata.tags to groups" className="imagewrapper" />
</p>

<Note>
The configured key must be a LiteLLM **virtual key** with `metadata.allow_client_tags: true`,
Expand Down
18 changes: 18 additions & 0 deletions src/pages/agent-network/providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ skipping verification.

The switch appears only for custom (self-hosted) providers and is **off by default**.

### Identity Metadata

By default NetBird stamps the caller's **user** and the **group that authorized the request**
onto each upstream request, so the provider or gateway can attribute usage to the real caller
instead of the shared API key. The exact header or field is provider-specific — see the
provider's [integration guide](/agent-network/integrations) for details (for example, AWS
Bedrock carries it in a header used for [cost-allocation tags](/agent-network/integrations/bedrock#cost-allocation),
and AI gateways receive their own attribution headers).

This is controlled by the **Forward identity metadata** toggle on the provider — **on by
default**, and shown only for providers that support it (first-party APIs such as OpenAI or
Anthropic have no such metadata channel, so the toggle doesn't appear for them). Turn it off
to keep the caller's identity out of the upstream request.
Comment on lines +103 to +106

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target MDX file around the cited lines and nearby references to the toggle label.
git ls-files src/pages/agent-network/providers.mdx
wc -l src/pages/agent-network/providers.mdx
sed -n '80,120p' src/pages/agent-network/providers.mdx
printf '\n--- search for toggle wording ---\n'
rg -n "Disable identity metadata|Forward identity metadata|identity metadata" src/pages/agent-network/providers.mdx

Repository: netbirdio/docs

Length of output: 2783


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '90,115p' src/pages/agent-network/providers.mdx
printf '\n--- occurrences ---\n'
rg -n "Disable identity metadata|Forward identity metadata|identity metadata" src/pages/agent-network/providers.mdx

Repository: netbirdio/docs

Length of output: 1856


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('src/pages/agent-network/providers.mdx')
text = p.read_text()
for needle in ['Disable identity metadata', 'Forward identity metadata', 'identity metadata']:
    print(f'--- {needle} ---')
    for i, line in enumerate(text.splitlines(), 1):
        if needle.lower() in line.lower():
            print(f'{i}: {line}')
PY

Repository: netbirdio/docs

Length of output: 852


Use one label for this toggle. The body says Forward identity metadata, while the screenshot alt text says Disable identity metadata. Match the UI wording and, if the control is disable-style, make the on/off behavior explicit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/agent-network/providers.mdx` around lines 103 - 106, Use a single
label consistently for the provider toggle described in the “Forward identity
metadata” section, matching the actual UI wording and screenshot alt text. If
the control is disable-style, explicitly document which on/off state forwards
identity metadata and which prevents it.


<p>
<img src="/docs-static/img/agent-network/providers/agent-network-provider-metadata.png" alt="Connect Provider modal with the Disable identity metadata toggle" className="imagewrapper" />
</p>

## Models and Pricing

Each provider carries a list of models it serves. Leaving the list empty makes the
Expand Down
Loading