WebsitePlatform Login

Code Sandbox

Isolated Python and JavaScript execution for file analysis, transformations, and computations (secure, deleted after use, EU-hosted).

The Code Sandbox is a built-in tool that lets an assistant run real code (Python or JavaScript) instead of just generating text answers. It's especially relevant for tasks the model alone can't reliably handle: exact calculations, processing of Excel/CSV files, file generation.

Why a sandbox?

A language model like GPT or Claude is at its core a text generator: it reads and writes text. Three things it can't reliably do on its own: but that come up constantly in real work:

  1. Read binary files: an .xlsx file is not text, it's a binary format. The model only sees what was extracted as text beforehand.
  2. Calculate reliably: for larger multiplications or multi-step computations, the model can miscalculate, because it "guesses" numbers based on probability.
  3. Complex data analysis: pivots, filters, aggregations across thousands of rows are simply impossible with text processing alone.

The sandbox solves this by giving the model its own small computer. Instead of estimating the answer textually, the model writes Python code that runs on this machine and returns the real result.

How a sandbox call flows

File upload: You upload a file to the chat (e.g. an Excel sheet, a CSV, a Python script).
Task recognition: The assistant detects from your question that the file needs to be processed directly.
File loaded into the sandbox: The original file (not just extracted text) is copied into the sandbox workspace.
Code generation: The assistant writes Python code that solves the task, e.g. import pandas as pd; df = pd.read_excel('file.xlsx'); print(df['Revenue'].mean()).
Execution: The code runs in the isolated environment. The common libraries are preinstalled (incl. pandas, numpy, matplotlib, openpyxl) – no pip install at the start of a session.
Result back: You get the result in chat, plus optionally generated files (e.g. the modified Excel or a PNG chart) as a download.

Images, screenshots, and individual PDF pages are recognized natively – the model sees the image content directly instead of guessing it via OCR. You can also hand multiple files to the sandbox in a single step.

With sandbox vs. without sandbox

Use caseWithout sandboxWith sandbox
Excel analysis ("Compute the average of the Revenue column")Model guesses the numbers, often inaccuratePython reads the file and calculates exactly
Edit Excel ("Add a margin column")Not possible: the model can't write a file backThe file is modified, you receive the edited .xlsx as a download
Charts from dataOnly simple text diagrams (Mermaid)Real PNG charts via matplotlib or plotly
Run codeModel can show the code but not execute itCode is run, output comes back
Large tables (50,000+ rows)Doesn't fit in the model's contextPython handles arbitrarily large files

What you see in the chat

From a user perspective, this all happens automatically. You see:

  • A short loading indicator while the sandbox starts and the code runs (typically seconds, for complex analysis 10–30 seconds)
  • Optionally a display of the executed code: depending on the workspace setting
  • The result as text in the chat or as a download link for generated files
  • On errors, an error message; the assistant often tries an alternative approach automatically

Security and hosting

The sandbox is an isolated virtual machine: code running inside it has no access to other customer data, the internet, or the meinGPT system. Even if faulty or malicious code were executed, it could do no damage outside the sandbox.

  • Hosting: Falkenstein, Germany (Hetzner), fully EU-hosted
  • Lifetime: Each sandbox is deleted after use, fresh for the next request
  • Data flow: Original files are temporarily loaded into the sandbox for processing and deleted immediately after execution. For on-premise customers it's important to note that sandbox processing happens in the cloud
  • Internet access: disabled by default
  • Script libraries: a broad stack is preinstalled (no pip install needed). Python for data analysis (pandas, numpy, matplotlib), Office/PDF files (openpyxl, python-docx, python-pptx, pdfplumber, PyMuPDF, reportlab), images and OCR (Pillow, pytesseract); for Node incl. SheetJS (xlsx), pdfkit, docx, pptxgenjs

Current methods

When the Code Sandbox connector is attached to an assistant, the following methods are available:

  • sandbox-create-session: start a new sandbox session
  • sandbox-write-file: write a chat file into the sandbox
  • sandbox-upload-file: upload an external file
  • sandbox-download-file: fetch a generated file back into the chat
  • sandbox-list-files: list workspace contents
  • sandbox-execute-command: execute a command inside the sandbox

Limits

  • No persistence: the sandbox is deleted after the request; data does not survive across sessions
  • Split complex workflows: very long compute pipelines are better expressed as multiple smaller steps than one monolithic call
  • No outbound internet from inside the sandbox: external APIs are reached via connectors or skills, not from the code itself

Frequent questions

Where to go next

  • Excel: the Excel agent uses the Code Sandbox under the hood
  • Skills: your own code packages with libraries and external API access
  • Assistants: how to attach the Code Sandbox to an assistant as a tool

On this page