Demo day. Someone drops HostedCodeInterpreterTool into ChatOptions.Tools , uploads a CSV, and the model returns a clean summary with a chart. Applause. Then staging: the same tool list, fluent prose, zero CodeInterpreterToolCallContent . Another run ships a .exe -shaped artifact "so the user can see what was blocked." A third treats a hosted file id the model never downloaded as grounded evidence.
The marker did its job. Policy did not.
HostedCodeInterpreterTool in Microsoft.Extensions.AI is a marker (name code_interpreter ). Capable backends may run a sandbox. The class does not enforce MIME allowlists, byte caps, secret shapes, or hash binding. Prefer the Responses path ( GetResponsesClient().AsIChatClient() or equivalent) so CodeInterpreterToolCallContent / CodeInterpreterToolResultContent surface cleanly.
This post is five mistakes I keep seeing β idea, why it hurts, skeleton of the fix. Snippets are truncated on purpose.
Tech Skill Builder is $5/month for a very limited time only (normally $10).β¦