Your agent made the chart. Your user never saw it.
Writing code, executing it, and getting the result back are three separate steps. An agent that analyses data needs all three, and the third is the one people forget.
How it works
In Microsoft Foundry, Code Interpreter gives the agent a sandboxed Python environment. Your application uploads the CSV and attaches it to the tool's container. The agent loads the file, runs the analysis, and retries when its own code throws an error.
The step people forget
If the agent produces a chart, the answer is not a paragraph. It is a file sitting in the container. The response points to it through a container file citation, and your application has to read that citation and download the file.
Skip that, and the user gets a sentence describing a chart they cannot see.
The rule
When a task produces an artifact, retrieving the artifact is part of finishing the task. That applies beyond Foundry:
- A pipeline that writes a report is not done until the report is where the user looks.
- An agent that "fixed" a file is not done until the fixed file is back in the repository.
- A tool call that returns a reference is not done until the reference is resolved.
The same thing applies to checking agents. Do not grade the sentence the agent wrote about its work. Grade the artifact.