Code Interpreter
What Is This?
Code Interpreter lets an Agent execute Python code in a secure sandbox environment, completing tasks programmatically.
With Code Interpreter enabled, the Agent can do more than just reply with text — it can write code to perform calculations, process files you upload, generate Word/PowerPoint/Excel documents, and return the results for you to download.
How Is It Different from Tools?
Nature
Calls pre-defined external APIs
Writes and executes Python on the fly in a sandbox
Flexibility
Limited to what the API provides
Anything Python can do
Typical use cases
Send emails, query CRM, integrate third-party services
Computation, data processing, file generation, charting
Quick rule of thumb: Need to call an external API → Tools; need to compute, process files, or generate documents → Code Interpreter.
What Can It Do?
Data analysis & computation: CSV/Excel calculations, statistics, pivot tables, data cleaning
Chart creation: Turn data into line charts, bar charts, pie charts, and more
Document generation: Produce Word, PowerPoint, Excel, and PDF files for download
File processing: Parse PDFs, convert formats, batch-process uploaded files
Sandbox Environment
The execution environment is a secure sandbox, isolated from production systems — it won't affect any other data
Supports standard Python along with common data and document processing packages
Files generated by the Agent appear in the Output panel within the chat interface and can be downloaded directly
When to Use
Finance/sales teams ask the Agent to organize Excel files and produce weekly reports
HR/admin teams ask the Agent to turn survey results into charts and generate PowerPoint presentations
Legal/contract teams ask the Agent to extract key fields from PDFs and output Word summaries
Any conversation scenario that requires ad-hoc computation or on-the-fly file generation
What Do I Need to Do?
Go to Agent settings — Open the settings page of the AI Assistant you want to enable it for
Enable Code Interpreter — Turn it on in the tools or advanced capabilities section
Test — Ask the Agent to perform a task that requires computation or file generation in a conversation, and verify that the Output panel allows normal downloads
Last updated
Was this helpful?
