Copilot Studio Code Interpreter: Uses, Setup, and Limits
The code interpreter capability in Copilot Studio lets an assistant run code to analyze data, perform calculations, and generate results from files. Here is what it supports, how to configure it, and where human review belongs.
Updated 5 min read
Copilot Studio's code interpreter capability lets an assistant execute code as part of a conversation to analyze data, perform calculations, and generate outputs from files. Instead of asking a user to download a spreadsheet and do the math themselves, the assistant can take the file, run the analysis, and return the result directly in the conversation.
The capability is useful for business assistants that work with structured data: financial reports, project trackers, survey exports, and similar files. The analysis assumptions the assistant uses, and the outputs that need a person to review before acting on, are worth recording. Tools like fenbs keep those assumptions and the open review items in one place outside the conversation.
What the code interpreter can do
The code interpreter can execute Python code within a sandboxed environment. It can read uploaded files, perform calculations, sort and filter data, generate summary statistics, and produce outputs such as tables or charts. The user uploads a file or provides data in the conversation, and the assistant writes and runs the code to produce the requested result.
Common use cases include: calculating a total from a budget spreadsheet, summarizing survey responses from a CSV, finding the highest or lowest value in a dataset, or reformatting data for a report. The assistant handles the code; the user provides the data and asks the question.
How to enable it in Copilot Studio
Code interpreter is enabled as a generative action in Copilot Studio. In the assistant's settings, you add the code interpreter action to the list of capabilities the assistant can use. Once added, the assistant can invoke it during a conversation when the user's request calls for data analysis or calculation.
Microsoft's documentation on generative actions in Copilot Studio (opens in a new tab) covers the current steps for enabling and configuring code interpreter. The exact setup flow may change as the platform evolves, so check the live documentation rather than relying on a static guide.
File handling and data privacy
Files uploaded to the assistant during a code interpreter session are processed in a sandboxed environment for the duration of the conversation. Check Microsoft's data handling documentation to confirm how uploaded files are handled, where they are stored during processing, and what happens after the session ends.
Consider the sensitivity of the files before enabling code interpreter for an assistant used with real business data. A general-purpose assistant that could receive files from many users needs a clearly defined policy for which files are acceptable to upload. An assistant scoped to a specific team with known data types is easier to govern.
Keep the analysis assumptions where the team can find them
When the assistant's code interpreter uses specific assumptions, such as which columns in a report to sum or which date range to apply, record those as context notes in the fenbs project. A colleague reviewing the output six months later can check the assumptions rather than guessing how the result was produced. Add the open review items as tasks.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
Where human review belongs
Code interpreter outputs are as reliable as the code the AI writes and the data it receives. Both can have problems. The AI may write code that is technically correct but uses the wrong column. The data file may have formatting errors the AI does not flag. For outputs that will be shared with clients, used in a financial decision, or included in a report, a person should verify the result before it leaves the conversation.
A simple check is to ask the assistant to show its work: what code did it write, and what does each step do? If the code is hard to read or the logic is not clear, that is a signal to verify the result independently. An assistant that shows the code is easier to audit than one that returns only the final number.
Limits to be aware of
The code interpreter runs in a sandboxed environment with limited access. It cannot write to external systems, access the internet, or retrieve data from connectors during the code execution itself. The data available to the code is what is in the conversation: the uploaded file and any data the assistant gathered through topic questions.
File size limits, supported file types, and the scope of the Python environment are defined by Microsoft and may change. For current limits, check the Copilot Studio documentation (opens in a new tab) on Microsoft Learn. Build your conversation design around these limits rather than assuming they will expand.
How to do this with fenbs
Use fenbs to hold the scope decisions and the review items that arise from code interpreter use.
- Create a free account and add a project for the assistant.
- Add a task describing the code interpreter use case: what data the assistant analyzes, what outputs it produces, and who reviews the results.
- Record the data policy as a Decision in fenbs: which file types are acceptable, what sensitivity level is permitted, and who approved the scope.
- When a code interpreter result needs human review before sharing, add it as a task with the output and the review question. Mark it done when a person has confirmed it.
- After the first real-data runs, record any patterns in errors or unexpected outputs as a Lesson. Apply them to the assistant's instructions to reduce the same errors in future sessions.
fenbs does not connect to Copilot Studio's code interpreter directly. It keeps the scope decisions and the review backlog in one place, separate from the conversation where the analysis happens.