Share via


Use code interpreter to generate and execute Python code

Enabled for Public preview General availability
Admins, makers, marketers, or analysts, automatically Aug 1, 2025 Aug 29, 2025

Business value

Streamline end-to-end business process execution without manual sequential workflows to perform complex mathematical calculations, operations like write actions to Dataverse, send emails, and create CRM cases. This reduces cost by minimizing or eliminating large language model (LLM) calls, resulting in agent systems becoming about 30 percent more cost-effective.

Feature details

Code interpreter in Microsoft Copilot Studio and AI Builder prompts lets makers build AI agents that:

  • Execute Python code for data analysis, Word, Excel, PowerPoint, and PDF processing, and visualizations
  • Use language models for generative responses

This feature is tailored for developers, business analysts, and low-code makers. Code generation and execution integrate seamlessly with the Copilot Studio ecosystem to create powerful, AI-driven solutions.

Some use cases for code generation and execution include:

  • Excel file processing to create, copy, and update Excel worksheets in a workbook, read StyleNames, apply StyleNames, copy formatting across cells, copy and update formulas across cells
  • Word and PowerPoint file processing
  • PDF file processing to create and copy PDF files, read tables, and text paragraphs
  • Complex mathematical and statistical computations
  • Data analysis, manipulation, and visualization

Code interpreter adds the following capabilities to AI Builder prompts:

  • Support for files as an output type in prompts
  • Support for Excel files as input and output types for prompts

You can create AI Builder prompts in two ways:

  • Use the Build your own prompt option in AI Hub in Power Apps
  • Within a prompt tool added to an agent in Copilot Studio at the agent level

For more information on AI Builder prompts and code interpreter, see Prompts overview and Use code interpreter to generate and execute Python code in Copilot Studio.

Geographic areas

Visit the Explore Feature Geography report for Microsoft Azure areas where this feature is planned or available.

Language availability

Visit the Explore Feature Language report for information on this feature's availability.

Additional resources

Use code interpreter to generate and execute Python code (docs)