A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model
How can we disable prompt and response content in Foundry "responsesapi" traces while keeping operational telemetry?
We have a .NET Microsoft Agent Framework hosted agent deployed to Microsoft Foundry. The Foundry project is connected to Application Insights.
We want to retain operational telemetry, such as latency, errors and token usage, but avoid recording user prompts, model responses and tool content because they can contain financial information.
Following the tracing and privacy guidance, we configured the hosted-agent deployment with:
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=false
AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACING=false
In our test environment, we observed:
- The sampled hosted-agent .NET
invoke_agentandchatspans had empty input and output message fields. - Separate spans with
cloud_RoleName=responsesapiandsdkVersion=aifoundry-v1.0still containedgen_ai.input.messagesandgen_ai.output.messages. - The content was visible in Foundry’s trace conversation view and in Application Insights / Log Analytics, including
AppGenAIContentandAppDependencies.
Is there a supported way to disable or redact message and tool content in these responsesapi spans while retaining metadata-only tracing? Are the hosted-agent environment variables expected to affect these spans, or is there a separate service-side setting?