You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 92cdf28
Browse filesBrowse the repository at this point in the historyBrowse files
docs(dotnet): Document GenAI data collection for AI Agents
The snippets set RecordInputs and RecordOutputs to true. Once
Sentry.Extensions.AI honours DataCollection.GenAI, an explicit flag
overrides it for that chat client, so an app that copied the snippet
would keep sending prompts and responses after turning GenAI off.
Drop the flags from both snippets, describe how they combine with
DataCollection, and show how to turn AI content off for every chat
client with ConfigureDataCollection.
Closesgetsentry/sentry-dotnet#5954
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
<SdkOptionname="Experimental.RecordInputs"type="bool"defaultValue="true"defaultNote="unless GenAI.Inputs is false">
88
86
89
-
Whether to include request messages in spans. When enabled, the content of messages sent to the AI model will be recorded in the span data.
87
+
Whether to include AI inputs in spans: request messages, tool definitions, and tool call arguments.
88
+
89
+
If you set it, it overrides `GenAI.Inputs` from [`ConfigureDataCollection`](#stop-sending-prompts-and-responses) for this chat client. If you don't, `GenAI.Inputs` decides, and that defaults to `true`.
<SdkOptionname="Experimental.RecordOutputs"type="bool"defaultValue="true"defaultNote="unless GenAI.Outputs is false">
94
+
95
+
Whether to include AI outputs in spans: response text, response tool calls, and tool call results.
94
96
95
-
Whether to include response content in spans. When enabled, the content of responses from the AI model will be recorded in the span data.
97
+
If you set it, it overrides `GenAI.Outputs` from [`ConfigureDataCollection`](#stop-sending-prompts-and-responses) for this chat client. If you don't, `GenAI.Outputs` decides, and that defaults to `true`.
96
98
97
99
</SdkOption>
98
100
@@ -102,6 +104,27 @@ Name of the agent. This name will be used to identify the agent in the Sentry UI
102
104
103
105
</SdkOption>
104
106
107
+
## Stop Sending Prompts and Responses
108
+
109
+
To stop sending AI content from every chat client, turn off generative AI inputs and outputs when you initialize the SDK. Sentry still sends metadata, such as model names and token counts. For details, see <Linkto="/product/agents/privacy/#sdk-data-collection">AI Agents Privacy</Link>.
110
+
111
+
```csharp
112
+
SentrySdk.Init(options=>
113
+
{
114
+
options.Dsn="___PUBLIC_DSN___";
115
+
options.TracesSampleRate=1.0;
116
+
options.ConfigureDataCollection(dc=>
117
+
{
118
+
dc.GenAI.Inputs=false;
119
+
dc.GenAI.Outputs=false;
120
+
});
121
+
});
122
+
```
123
+
124
+
`ConfigureDataCollection` is experimental and may change in a future release.
125
+
126
+
To keep sending content from a specific chat client, set `RecordInputs` or `RecordOutputs` to `true` in its `AddSentry()` call.
0 commit comments