.NET: Python: FoundryToolbox does not send the Foundry-Features header or honor FOUNDRY_AGENT_TOOLSET_FEATURES · Issue #7689 · microsoft/agent-framework · GitHub
Skip to content

.NET: Python: FoundryToolbox does not send the Foundry-Features header or honor FOUNDRY_AGENT_TOOLSET_FEATURES #7689

Closed

Description

@westey-m

Describe the bug

Python's FoundryToolbox never sends the Foundry-Features header, and ignores the
platform-injected FOUNDRY_AGENT_TOOLSET_FEATURES environment variable. The .NET implementation
does both, so the two SDKs disagree on what a toolbox request looks like.

The Foundry toolbox reference documents the header as mandatory:

Header: Always include Foundry-Features: Toolboxes=V1Preview.

Python — packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py, the only place
request headers are set (_ToolboxAuth._apply_headers):

def _apply_headers(self, request: httpx.Request, token: AccessToken) -> None:
    request.headers["Authorization"] = f"Bearer {token.token}"
    for key, value in get_request_context().platform_headers().items():
        request.headers[key] = value

grep -rn "Foundry-Features" python/packages returns nothing, and no code reads
FOUNDRY_AGENT_TOOLSET_FEATURES.

.NET — dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/FoundryToolboxService.cs reads the
features variable at startup and merges it into the header it sends on every request:

this._featuresHeader = Environment.GetEnvironmentVariable("FOUNDRY_AGENT_TOOLSET_FEATURES");

Impact

Requests currently succeed without the header against today's service, so this is latent rather
than breaking. The risk is that it is documented as required and is the mechanism by which the
service gates preview toolbox behaviour — so a future service change, or any feature flag the
platform passes via FOUNDRY_AGENT_TOOLSET_FEATURES, would silently not apply to Python callers.

To Reproduce

  1. Build a FoundryToolbox and connect it to any toolbox MCP endpoint.
  2. Capture the outbound request headers.
  3. Observe Authorization and x-agent-foundry-call-id, but no Foundry-Features.

Expected behavior

FoundryToolbox should send Foundry-Features: Toolboxes=V1Preview by default and merge any
values from FOUNDRY_AGENT_TOOLSET_FEATURES, matching FoundryToolboxService in .NET.

Platform

  • Language: Python
  • Package: agent-framework-foundry-hosting

Activity

  1. changed the title [-]Python: FoundryToolbox does not send the Foundry-Features header or honor FOUNDRY_AGENT_TOOLSET_FEATURES[/-] [+].NET: Python: FoundryToolbox does not send the Foundry-Features header or honor FOUNDRY_AGENT_TOOLSET_FEATURES[/+] on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .NetpythonUsage: [Issues, PRs], Target: Python

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions