Urgent.News

What's breaking now, across thousands of outlets.

AI

Code Interpreter Internals in Microsoft Foundry: What Actually Happens Inside That Sandbox

Day 8 of Microsoft Foundry: 100 Days / 100 Blogs — a daily deep dive into the Foundry ecosystem for developers building production AI systems. Your agent just told a user "I calculated the standard deviation of your Q3 revenue and it's $42,318." How? It didn't call a math library you wrote. It didn't hallucinate a number and hope. Somewhere between the model's token stream and that answer, a real…

On day 8 of the Microsoft Foundry series, a deep dive into the Code Interpreter tool reveals how it functions under the hood. Code Interpreter is a tool that allows language models to execute Python code within a sandboxed environment, providing accurate results for tasks beyond the model's native capabilities. The core concepts involve the tool definition, container, and session.

When an agent uses the Code Interpreter tool, the model decides to execute code and sends the Python source to the Foundry agent runtime. The runtime then manages the container, provisioning it lazily on first use. Each conversation gets its own isolated container session, which lasts up to an hour with a 30-minute idle timeout. This ensures that previous data and intermediate files persist for an agent within the same conversation, allowing for iterative problem-solving.

The model executes the code within the sandbox, reads any input files, and writes output back to a file store. The results are then fed back into the model's context as a tool result. Users can view the results through citation annotations pointing to any output files, which are downloaded via the containers API. The model itself does not have access to the VNet or the public internet, ensuring security and isolation.

Understanding the architecture and flow of requests to the Code Interpreter tool is crucial for developers building production AI systems with Microsoft Foundry. By grasping the separation between tool definition, container execution, and session management, developers can effectively leverage this powerful tool to solve complex tasks that language models alone cannot handle.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

The US wants an AI-era 'red phone' with China

President Donald Trump and Chinese leader Xi Jinping are expected to discuss AI safety and trade at their summit in Washington this week.

  • US proposes AI-based direct communication line with China
  • Aim is to provide notification for major AI security incidents
  • Discussion precedes Trump-Xi summit in Washington

I built the same agent in Strands, LangGraph, and CrewAI — and recorded every LLM call to see how they actually differ

Which framework should I actually use? Every comparison article has an opinion. Almost none of them has data. So I built the same agent three times — once in Strands , once in LangGraph , once in…

  • Strands framework uses model-driven approach with adaptive LLM calls
  • LangGraph employs graph-driven approach with deterministic workflow
  • CrewAI takes role-based framework with consistent output

More from Monday 21 September →