Skip to content

Code interpreter

The code interpreter lets the assistant run a short program in a network-isolated sandbox to answer a question, then read the program output back into the conversation. The assistant uses it for calculation, data analysis, and transforming data — for example computing exact figures over a spreadsheet you attached, or producing a chart from a table. The program runs inside the sandbox only; the model never runs code on your device, and an attached data file is analysed inside the sandbox rather than being sent to the model provider.

The code interpreter is a model-driven tool, not a button. The assistant decides when to run code, based on your request. No toggle or mode is exposed in the chat composer.

The feature produces three kinds of result in the conversation:

  • Text output — the program result, written into the assistant's reply.
  • A chart — a PNG image rendered inline in the reply. The chart is downloadable and can be copied.
  • A generated file — a file the program wrote to its output directory, shown as a download card in the reply. Supported formats are CSV, plain text, JSON, HTML (.html, .htm — for example a slide deck), Excel (.xlsx), Word (.docx), PowerPoint (.pptx), PDF, and OpenDocument (.odt, .ods, .odp). The assistant can author formatted documents directly (for example a Word letter or a PDF report), not only tabular data — the sandbox renders Word/PowerPoint/PDF/OpenDocument documents through a built-in document helper (with the usual Python libraries available as a fallback). The helper also produces interactive checklist PDFs: ask for a checklist you can tick off, and the generated PDF carries standard PDF form checkboxes next to each item (tickable in PDF viewers with form support). A file in any other format is not delivered.

Fonts in generated documents. Documents, PDFs, charts and slide decks the assistant generates can use any of about 2,000 freely licensed font families — the Google Fonts collection, Noto for every script (including Chinese, Japanese and Korean), colour emoji and the Liberation fonts. Ask for a font by name ("set the report in Lora") or let the assistant pick one that suits the purpose. A Word document that uses Calibri, Cambria, Arial, Times New Roman or Courier New is rendered with a metric-compatible substitute (Carlito, Caladea, Liberation), so its line and page breaks stay the same; Microsoft's own fonts are not included, because their licence does not allow redistribution. A PDF or image carries the font inside it; a Word, PowerPoint or Excel file only names the font, so it shows in that font where the font is installed (Google Fonts can be downloaded for free); a deck built with the deck template embeds the fonts it uses.

Slide decks. The assistant builds an HTML slide deck in the sandbox from the built-in deck template (the template and its rules are on the sandbox's asset disk; the finished deck is delivered as a download card and previewed in the chat). A deck that already exists in the conversation it edits with its file-editing tool rather than rebuilding it (a deck you attached stays unchanged: its first change is saved as a new file, whose card reads Created name; later changes, and every change to a deck the assistant built, are saved as new versions, whose card reads Updated name): when it reads such a deck, the embedded fonts and pictures are shown to it shortened (as aig-elided-… placeholders) so the slides fit, and a copy of that shortened view is never saved — the stored file keeps the real bytes. The template's four slides are examples, the cover included: a slide left unchanged is removed by the gateway when the deck is saved, so the stored deck holds only the assistant's own slides and slide numbers match what you count.

💡 Note: The code interpreter is on by default on every gateway once Myra Security has configured the deployment sandbox. A tenant administrator can disable it on a specific gateway (a configuration action); when it is disabled there, the assistant answers without running code. Every user of a gateway on which it is available can use it from chat.

Availability and role

Access to the code interpreter is not a personal setting. The feature is available to every user of a gateway on which it is enabled, and unavailable to every user of a gateway on which it is not. There is no per-user opt-in and no chat control to switch it on.

The assistant runs code only when all of the following hold:

  • The gateway has not disabled the code interpreter (it is on by default).
  • The active model supports tool calling. A model without tool support answers in text and never runs code.

The code interpreter is also available in a project restricted to Local only processing. The sandbox is Myra-owned infrastructure inside the Myra estate and has no internet access, so running code there does not send data out of the project; only local Myra models are used in such a project, as always. The gateway verifies this rather than assuming it: if the deployment's sandbox address is not a host inside the Myra estate (*.myra.eu), the code interpreter is unavailable in Local only projects (conversion answers 409 not_in_estate, or a retryable 503 tier_unresolved while the conversation's project binding cannot be confirmed) while staying available elsewhere, and Myra operations are alerted by an error-level log entry.

Running an analysis on an attached file

The assistant computes exact figures over a spreadsheet or a table you attach, instead of estimating from the extracted text. Attach the data file to the message that asks the question.

To answer a question about the file's contents — counting rows, summing or averaging a column, filtering, or any other aggregate — the assistant computes over the raw attached file, which is already in the sandbox's /input folder in every run (you never have to ask for it to be loaded), rather than reading the short text preview shown in the conversation. This applies to every model the gateway serves, including the locally hosted models, so the answer reflects the full file even when the preview is truncated. (One case where the raw file is not staged and the assistant instead works from the text preview: a PII-protected gateway that does not mask results fail-closed. In a private (ghost) conversation the browser sends the data file with each message, up to the limits in Chat, and the assistant computes over it as well.)

On a gateway with PII protection, the raw file is staged into the sandbox only when the gateway's PII configuration masks results fail-closed; otherwise staging is refused and the assistant answers from the extracted, masked text instead. See File attachments on a PII-protected gateway.

Honesty notices. When the file goes to a model as an inline text preview, the chat tells you what the model actually sees: a notice appears with the message when the preview is truncated (very large file), when personal data in it is masked, or when the gateway offers no code-execution path over the raw file — in each of those cases, answers about the file's contents can be estimates rather than computed results. Additionally, when a reply about an attached data file was produced without running any code, the reply carries the note "No code was executed for this answer — values from <file names> may be estimates based on a preview." with a Regenerate action on it (on the latest answer), so an eyeballed answer is never presented as a computed one. A private (ghost) conversation keeps no attachments on the server, so the raw file cannot be staged into the sandbox there; the assistant answers from the inline text preview instead (results can be estimates when that preview is truncated), and the notice says so and names the way out: start a regular chat without ghost mode and attach the file there (up to the per-file limit, currently 8.3 MB; where the gateway offers no code execution over the raw file, the notice says that instead). The assistant is told why the sandbox input folder is empty in that case, so it does not call it a technical problem or a transfer error, does not ask you to upload the file again, and does not promise a computation it cannot run.

State between runs. Where the gateway offers a persistent kernel, the tool's description says that variables, imports and loaded data (for example pandas DataFrames) survive from one run to the next within the same conversation; where it does not, the description says each run starts empty and the assistant must re-create what it needs. The two claims come from one switch, so the offer, the session and the prompt always agree. If a run on a persistent-kernel gateway nevertheless ran without the kernel (for example the kernel was reaped, or a file was refused), the result carries a gateway note saying variables from earlier runs were not available.

The assistant does not claim a check it did not run. The code-interpreter tool's description tells the model which Python packages and programs the sandbox really has (read from the sandbox image's package list, so it follows the image). If a reply says the assistant itself just ran or checked something in the sandbox ("I just checked the sandbox", "Ich habe die Sandbox gerade geprüft") although no tool ran in that turn, the gateway re-dials the turn once with the code interpreter, so the check is run for real or the claim is withdrawn. If the re-dial is not possible on that turn (for example its budget is used up), the answer gets the note "Note: no tool was run in this answer, so the check described above did not actually take place - its statements about the environment are unverified." (also in German and Danish). Turns without the code interpreter, and replies that name no file or document, are not checked for this claim. See the claim check.

Previews are bounded to the model. The preview a model receives is additionally bounded server-side on every request: when code execution can read the raw file, only a small head of the preview (schema and first rows) is sent — the sandbox computes over the complete file, so a large preview would only cost tokens; when no code-execution path exists, the preview is fitted to the selected model's context window instead of failing. Very large files therefore no longer make a small-window model reject the message outright, and this applies to existing conversations too — earlier messages carrying big previews are bounded the same way on every new turn.

The code interpreter loads these file types as sandbox inputs: spreadsheets and tabular data (xlsx, xlsm, ods, csv, tsv), JSON data (json), Word and OpenDocument text documents (docx, odt), PowerPoint decks (pptx), PDFs (pdf), plain-text documents including Markdown, HTML, XML, and YAML (txt, text, md, markdown, html, htm, xml, yaml, yml, rtf, log), and Python scripts (py, pyw) — so the assistant can, for example, analyse a JSON dataset, build a new document on an uploaded template, read a project spreadsheet, convert an uploaded Markdown note, or run an attached Python script (see below). (The file types you can attach to a chat message are listed under Importing a file; a JSON dataset can also live in the project's knowledge files.) The picture attached to the latest message is also loaded, as one file named /input/attached_image.png, .jpg or .webp (by its real content), so the assistant can edit the real pixels (for example write labels onto an attached chart) instead of redrawing it. This holds for a PNG, JPEG or WebP of at most 8 MiB, and only when the message carries exactly one picture and the conversation is saved or a plain request (not a ghost chat, and on a PII gateway only where file loading is allowed). It counts as one of the 8 files and 16 MiB. If the picture cannot be loaded (several pictures, too large, another image type such as GIF, an upload only the owner may open, or an unreadable file), the run result says so in one note and the assistant is told not to redraw it; attach the one picture on its own. A picture from an earlier message is not loaded. Other file types (for example other images or a legacy .xls) are not loaded into the sandbox. A run loads at most 8 input files: only the first 8 are passed, and any further files are not loaded. Each file may be up to 8 MiB and all files together up to 16 MiB; a file over a size limit is skipped with a note and the rest still load.

Running an attached Python script

A staged .py (or .pyw) is not only readable — the assistant can execute it in the sandbox. Attach a Python script to the message (or keep one in the project's knowledge files) and ask the assistant to run it; it runs under exactly the same sandbox as any code the assistant writes itself — isolated, no network, and bounded by the same file size and output limits — and it may read the other files you staged from /input and write results to /output. A .py is staged by its extension, so a file that is not really a Python script is still placed in the sandbox; it simply produces an error if the model tries to run it, exactly as running any invalid script would.

The /easy composer with the + menu open, showing Add files or photos The + menu in the /easy composer, where Add files or photos attaches a file for the code interpreter to analyse.

Proceed as follows to run an analysis on an attached file:

  1. Open a conversation on the /easy chat surface.
  2. Click on the + button in the composer.
    • The composer menu opens.
  3. Click on the Add files or photos item.
    • The file picker opens.
  4. Select the spreadsheet or CSV file to analyse.
    • The file appears as an attachment chip above the message input.
  5. Type the question about the file in the message input.
  6. Send the message.
    • The assistant runs the analysis in the sandbox.

-> The assistant returns the result in its reply. A chart appears inline and a generated data file appears as a download card when the program produces one.

💡 Note: The assistant is told the exact filename of each file it produces — in the same turn and on later turns in the conversation — so it refers to a generated file by name and does not wrongly claim a file it created was not created.

💡 Note: You can attach more than one data file to the same message. Only the files the assistant needs for the question are analysed.

Loading a project's files

Automatic loading and its limits. Every code run starts with up to 8 files and 16 MB in total (each file up to 8 MB) of the supported types: the conversation's attachments first (newest first), then the selected project files in the project's order. A file over a limit, unreadable, or gone by the time the run starts is not loaded, and the run result names each such file (once per reply). The note also says how to load it anyway: reference /input/<name> in the code (or pass it in input_files), which loads that file in place of another one. Files of an unsupported type (for example .xls or .odp) and files that have not finished uploading are simply not in /input; they are not named. On a gateway whose PII configuration does not allow loading files, no file is loaded and the run result carries one general note, without file names. The latest edited copy of a file the assistant produced earlier in the conversation (for example deck-3.html after several edits of deck.html) is loaded automatically too, counted against the same limits, so a follow-up change builds on it rather than on the older original; that latest copy is loaded ahead of its original and ahead of every later file when the limits bite, and the other, older copies of the same file are not loaded automatically; an older generated file still has to be requested by name. "Latest" means the most recently written version of the file, original included: if the original was changed or uploaded again after the last copy was made, the original is the one loaded and no copy is.

In a project conversation, the files you selected for the chat from the project's knowledge are in the sandbox's /input folder automatically, together with the files attached to the conversation — nothing has to be named or requested. Ask by the file's name (for example "use FRV_Letterhead.docx as the template"), and the assistant opens the real file so it can build on it — opening a Word template with python-docx, reading a project spreadsheet with pandas, and so on. This is what lets the assistant produce a document that inherits your actual letterhead or layout rather than a re-created approximation.

When you ask for a document on a template or letterhead you provided, the assistant opens that file as the base and adds your content into it — so the original header, footer, logo, and styling are preserved rather than approximated by hand. The whole program runs in a single sandbox step; the assistant does not save a helper script as a separate file for you to download.

Editing a file the assistant made earlier. You can build a file across several turns — "make a spreadsheet of these items", then "now add a total row", then "add a chart". When you ask it to change or add to a data file it produced earlier in the conversation, the assistant re-opens that exact file and builds on it, rather than rebuilding it from scratch (which would drop the earlier content). A changed plain-text file (Markdown, HTML, XML, YAML, CSV/TSV, JSON, text) that the assistant wrote earlier and that is loaded for the run is updated in place when the program writes it back under the same name: it stays the same file and gets a new version, and the reply says so (no deck-2-2.html). The same holds for generated binary files (for example Word, PowerPoint, Excel, PDF or OpenDocument files) that the assistant generated earlier and that are loaded for the run: when the program writes one back under the same name and the same file type, it stays the same file and gets a new version (no sales-2-2.xlsx); the previous bytes are replaced, not kept as a separate version. If the program saves the changed file under a numbered variant of the input's name instead (for example deck-2-2-2.html for the input deck-2-2.html), the gateway still recognises it as the same file when the run produced exactly one non-image file and that name is only the next numbered copy of an input the run loaded: the file is updated in place, and the reply refers to it by the input's name. To keep a separate copy instead, ask for a different, descriptive name (not name-2); otherwise the edited file is updated. The same recognition applies when a plain name.html and a numbered name-2.html both exist but only name-2.html was loaded for the run and the run writes a single file name-3.html: name-2.html is updated in place, because the gateway cannot tell that from a numbered copy. A file you attached yourself, or a result of a different type (for example a Word file written under the name of a spreadsheet), is saved as a new numbered copy (for example sales-2.xlsx); your upload is never overwritten (see below). In a project chat the same holds for the generated binary files (for example Word, PowerPoint, Excel, PDF or OpenDocument) you generated earlier in the project and that are selected for the chat: they are loaded for the run automatically and updated in place, whereas a file another member generated is never changed and the result becomes a new numbered copy. If someone saved a newer version of the file in the meantime, nothing is overwritten and the change is saved as a numbered copy instead. This works for the sandbox input file types listed above — spreadsheets, CSV/TSV, JSON, Word, PowerPoint, PDF, and plain-text documents including Markdown, HTML, XML, and YAML.

How a name is resolved and what is allowed:

  • The most recent version of a name wins between a file the user attached and a file the assistant wrote in the conversation: a file the assistant changed later (rewrote, or edited with the file-edit tool) is newer than the upload it came from, and a file the user re-uploads afterwards is newer than both. A text file the assistant wrote (Markdown, CSV, HTML, …) is loaded with its current text; a file the assistant wrote under an Office or PDF name holds text that is only rendered into the document at download, so for such a name the attached original is loaded instead.
  • A file attached to the current message wins when the same name exists both as an attachment and in the project. If the attachment is too large to load, a same-named project file within the size limit is loaded instead.
  • Access is enforced server-side. Only a project you can access is reached (direct membership, a group grant, or an organisation share all count), and only files you are allowed to see within it — the project id is never taken from the client. A file you cannot access is simply not loaded.
  • Newly uploaded files work immediately. A project file is loadable as soon as its upload is stored, even before text extraction finishes; only a file still uploading, or one with no downloadable content, is skipped (with a note).
  • Files from earlier replies are not lost when the sandbox looks empty. Each run starts with only the files loaded for it, so a file the assistant made in an earlier reply is not in the sandbox unless it is loaded again. So in a saved conversation whose earlier replies delivered files, a run's result names those files (up to 10, newest first, as the conversation record shows them) and says they are stored with the conversation, separate from the sandbox, and that not finding one in the sandbox does not mean it was not created. Files the run loaded, saved or delivered itself are left out (a file it asked for but could not load stays listed); when none remain, nothing is added. If you own the conversation and loading is allowed, the result also says how to load the files that can be loaded by the name shown (input_files → /input/<name>), unless the run's own not-found note already said so; a document the assistant wrote as text (for example a write_file Word file, which is rendered at download) is listed but cannot be loaded into the sandbox. Asked "did you really create that file?", the assistant no longer checks the sandbox, finds nothing, and wrongly says no. Unsaved (ghost) chats do not get this note.
  • Self-correcting on a missed path. If the assistant tries to open a file by a bare name without loading it first, the run reports the file as staged at /input/<name> and the assistant retries against that path — so a first-try mistake recovers instead of the assistant giving up or rebuilding the document from scratch.
  • The same PII rule applies. On a PII-protected gateway that does not mask results fail-closed, project files — like attachments — are not loaded into the sandbox.
  • Your file selection applies here too. A project file you have unchecked in the chat's file panel is not loaded into the sandbox, is not offered to the assistant as an available project file, and cannot be opened or converted by name. If the assistant asks for it, the run continues without the file and says that the file is excluded from this chat's selection, so the assistant can tell you. Check the file again to use it. Files from the conversation itself (attachments) are not affected, and a file the assistant created in the current reply stays usable. The sandbox keeps its state between turns, so data loaded while the file was checked can still be there after you uncheck it; unchecking stops further loading, and a new chat drops what was already loaded.

Downloading a generated file

A program can write a data file — for example a CSV, a text file, a JSON file, or an Excel .xlsx workbook of results. The file is delivered as a download card in the assistant's reply.

Proceed as follows to download a generated file:

  1. Locate the file card in the assistant's reply.
  2. Click on the Download button on the card.

-> The file is saved to your device under its original name.

For API clients: the tool_result stream event of a code_interpreter run that stored a file carries that file's file_id and filename (the first file stored when the run stores several). A run that stored no file, or only images, carries neither. See Inference API › tool-loop side-channel events.

If the assistant runs its program again within the same reply and writes the same file name (for example after fixing an error), you still get one card under the plain name, holding the latest version — not name-2 copies. A file from an earlier reply is not overwritten by a program that did not load it; running again in a new reply creates a numbered copy. The exception is a file the assistant generated earlier (plain text or a generated binary file such as Word, PowerPoint, Excel, PDF or OpenDocument) and that the run loaded: writing it back under the same name (and, for a binary file, the same file type) updates it in place (see Editing a file the assistant made earlier).

A generated file is stored with its conversation and is deleted when the conversation (or the owning account) is deleted. A file generated during a turn that is never persisted — for example, the user navigates away mid-stream — is swept by a periodic reaper, so an abandoned file does not linger. A file generated into a project is a deliberate addition to that project's knowledge base and is kept until it is removed there.

Spreadsheet and CSV safety

Before a generated spreadsheet or CSV (.xlsx, .ods, .csv) is delivered, the platform neutralizes formula injection in it: a cell whose text would make Excel, LibreOffice Calc, or Google Sheets run a command or fetch a URL on open — for example =HYPERLINK(...), =WEBSERVICE(...), =IMAGE(...), an IMPORT/RTD/DDE/CALL function, or a DDE link — is turned into plain text (the cell shows the formula as written instead of executing it). Ordinary formulas such as =SUM(A1:A2) are kept and still compute. This runs on the trusted server for every delivered spreadsheet, so it cannot be switched off from inside the sandbox. A file that cannot be made safe (for example one carrying a dangerous external link or embedded object that cannot be rewritten) is not delivered — it is dropped and the assistant is told, rather than handed to you unverified.

Word, PowerPoint and Excel files are checked before delivery

Before a generated Word, PowerPoint or Excel file (.docx, .pptx, .xlsx) is delivered, the platform checks its structure against the Office Open XML schema. A file with an XML part that is not well-formed, an element duplicated where the schema allows one, or (for PowerPoint, and for the main parts of an Excel workbook) an element in the wrong place or missing, is not delivered: no download card appears for it, and the assistant is told which part is wrong so it can fix the code that generates the file and run it again. Word files are blocked only for the first two kinds. This lowers the chance that Word, PowerPoint or Excel shows a "repair" prompt on open; it cannot rule it out. The check is deliberately narrow: it never blocks a file that merely uses an unusual value, and it ignores faults that the file already contained in a document you loaded into the run (and, if that loaded document could not be checked in full, it does not block on faults it cannot tell apart from the ones the loaded document already had). It runs in a separate, resource-limited helper process on the gateway host, not in the code sandbox. If the check cannot run, or cannot reach a verdict within its limits, the file is delivered as before. If the assistant produced a file that was withheld and does not deliver a corrected one, the reply says so in one sentence, in the language of the conversation, so a missing file is never silent.

Generated files in a private (ghost) conversation

A private (ghost) conversation is not saved on the server — no messages are stored, and a file the code interpreter generates is not stored either, not even when the conversation is opened inside a project (it is not added to that project's knowledge base). The file is still delivered: the card appears in the reply and the download works exactly as above, but it exists only in your browser for as long as you stay in that conversation. The card says so, and leaving the conversation discards it along with the rest of the chat. Download the file before you navigate away if you want to keep it.

The same applies to charts, which are shown inline and downloadable but not stored.

⚠️ Caution: A generated file above the 25 MiB limit (see File size limit) cannot be delivered in a private conversation. The assistant says the file could not be shown instead of offering a card that would not work. Run the analysis in a normal conversation to keep large results.

Chromium error pages are never delivered as PDFs

When code in the sandbox prints an HTML file to PDF with headless Chromium and the file path is wrong, Chromium does not fail: it prints its own error page ("Your file couldn’t be accessed — ERR_FILE_NOT_FOUND") and exits successfully. The gateway recognises that page — a one-page PDF from headless Chromium whose title is the URL it could not open and whose text is Chromium's error message — and does not deliver it as a download. The assistant is told that the input path was wrong — and, where the convert_document tool is offered, to use it instead (see below). A real PDF that merely mentions such error codes is delivered normally.

Converting HTML with the convert_document tool

Wherever the code interpreter is available in your own (saved) conversation, the assistant also has a convert_document tool. It turns an HTML file of the conversation — an attachment, a file the assistant wrote earlier, or a project file you name (an attachment of a message you edited and re-sent is no longer part of the conversation and is not offered) — into an editable PowerPoint, OpenDocument presentation, PDF, Word or OpenDocument text document, using the same converter as the Download menu on HTML file cards (see Chat › Converting an HTML file). The assistant is steered to use it instead of rebuilding the page with code or printing it with Chromium, so the result keeps the page's layout, fonts and tables. The converted file appears as a download card like any other generated file and counts toward the same per-reply file limit (at most 4 generated files). If you name a file that is not in the conversation, the assistant is told which HTML files are available.

Converting Word, OpenDocument, RTF, text and Markdown files

The same convert_document tool also converts office documents. A .docx, .odt, .rtf, .txt or .md file of the conversation (a file you attached, a project file or a file the assistant wrote earlier; see the list of file types you can attach) becomes a PDF, a Word (.docx) or an OpenDocument text (.odt) file; a format is never converted into itself. The original is not changed, and the result is a new download card named like the source with the new extension. Conversion runs in the sandbox without network access, under the same safety checks as editing office files, and is available only where the code interpreter can read your files. Other sources (such as .doc or a PDF) are answered with the list of supported formats. HTML files keep the converter above. See Convert a Word, OpenDocument, RTF, text or Markdown file.

Editing a PowerPoint or Word file — design kept

Wherever the code interpreter can read your files, the assistant can also change text in a PowerPoint (.pptx) or Word (.docx) file and give it back in its original design — with your company's slide master, logos, pictures, charts and tables untouched — and/or as a PDF. Ask for the change in plain words, for example:

Change the title on slide 3 to "Regional Performance Q3 2026", set the North revenue in the table to 43.8, add the bullet "Approve the 2027 fleet budget" to the agenda, and give me the deck and a PDF.

The assistant edits the original file (it does not rebuild the presentation), so everything you did not ask to change stays exactly as it was. You get the edited file under its original name (or the next free name, e.g. deck-2.pptx) and, if you asked for one, a PDF — as download cards.

Good to know:

  • The assistant changes text that it can see in the file — titles, bullets, text boxes, paragraphs and table cells. Speaker notes, charts, SmartArt and slide masters are not changed; in Word files, headers, footers and floating text boxes are not changed either.
  • If the text you mean occurs several times, the assistant asks for (or uses) the slide number.
  • All requested changes are made together — if one cannot be applied, the file is not delivered and the assistant tells you which change failed.
  • Encrypted or password-protected files cannot be edited. The file can be at most 8 MiB.
  • To make further changes, refer to the file you got back (the assistant is told its name).

PDF files. The assistant can also correct text in a PDF that has a text layer; you get the changed PDF as a copy under the next free name (e.g. report-2.pdf). Each change is a single line of text, optionally on a named page, and the assistant lists every change with its status — done, done with a substituted font, or not applied and why. Unlike PowerPoint and Word files, changes are independent: if one cannot be applied, the others are still made. A change that cannot fit its line or is not supported is reported to you as not applied, not worked around. When a text is not found, the assistant tells you so and never changes a similar text instead. It copies the text to change from the tool's own page-by-page read of the PDF, because text printed by other PDF libraries may join or split words differently. Scans without a text layer, password-protected files and PDFs with forms, comments, attachments, scripts or images in an unsupported encoding are not edited. The limits are described in the API reference.

When the assistant opens a PDF, PowerPoint, Word or Excel file in the code interpreter to change it, the gateway adds one short hint per reply: use the file editing tool, which returns the file's exact text, and make all changes in one call, instead of reading the file again and again in the sandbox.

Excel workbooks. The assistant can also change cells in an Excel workbook (.xlsx, .xlsm): set a value, enter a formula, or fill a block of cells, optionally on a named sheet. The change is made in a copy (e.g. budget-2.xlsx), so styles, charts, other sheets and macros stay as they were. Changes are all-or-nothing, and the assistant lists the status of each one. Cells that are merged, protected, part of an array or shared formula, or a table header are refused with the reason, as are formulas that reach other files or the internet. Dependent formulas are recalculated where possible; otherwise Excel recalculates them when you open the file, and the assistant says that the numbers shown in the meantime may be out of date. Details are in the API reference.

File size limit

A single generated file (document, chart, or data file) may be up to 25 MiB. The limit is fixed: the tenant setting Code interpreter file size limit is for platform administrators only, and a lower value has no effect. A reply delivers at most 4 generated files, and one sandbox run produces at most 4 files and 25 MiB in total. The same limit also applies to files and images delivered live in a private/unsaved conversation; there, one reply delivers at most 25 MiB and eight files and images in total. A larger file is not delivered; the assistant reports that it could not be shown rather than offering a download card that would fail.

Calculations on Myra models

On Myra models (for example Qwen), a message that explicitly asks the assistant to compute, recompute, total up or check calculations is answered by running the calculation in the code interpreter, so the number you get was computed rather than estimated. You do not have to name the tool.

  • What counts as a request: an imperative compute verb together with at least one number in your latest message (English and German), or a request to check or verify figures right after a reply that contains figures. Examples that trigger it: "Berechne die Summe von 1234,56 + 7890,12", "Please calculate 19% of 250", "Das ist falsch gerechnet", "Please check all calculations critically", "Please double-check the figures", "Verify my numbers" and "check the totals" right after a reply that contains figures. In English, a check verb (check, double-check, verify, validate) must be followed, optionally through short filler words such as "all", "the", "my", by a calculation word (calculations, figures, numbers, totals, sums, math); "check this email" and "check the phone numbers" do not trigger it. A request that is negated ("no need to recheck the numbers", "do not check the math") does not trigger it either. A compute verb without any number ("rechne das nach") does not trigger it. A question that contains a compute verb together with figures ("Wie berechne ich 19% MwSt auf 100 EUR?") is treated as a calculation request. A comparison request counts as well, even without a compute verb ("Compare these three plans on cost per lead …", "Vergleiche die Angebote …"): the compare word must be in the first or last sentence of your message, together with at least two numbers and a money or price word (a bare "%" is not enough). A message after a reply that contains a figure table counts when it adds at least three numbers and a money word ("Nimm Pitchline mit 990 EUR Onboarding in die Gegenüberstellung auf"). Reports about your own work with a compute verb ("ich habe die Summe berechnet") and requests for a spreadsheet formula or a code file are not treated as calculation requests; a report whose first or last sentence holds a compare word ("Ich vergleiche gerade 500 EUR mit 620 EUR") still is.
  • When it applies: the gateway has the code interpreter enabled, the model is served by Myra, and you did not set your own tool_choice. Other models keep deciding for themselves whether to use the tool.
  • What it does: on the first model call of the turn the gateway requires a code_interpreter call; the following calls are free, so the model can then explain the result. If the fleet refuses the forced call, it is retried once without forcing.
  • No false claims: when the gateway offers the code interpreter, the assistant is told to say that it computed, checked or verified figures with code only if it actually ran the tool in that turn, and otherwise not to claim a code check.
  • Price rules stated in words: when a calculation applies prices, fees, discounts or rates described in words (for example "15 % off every seat above 25" or "990 EUR onboarding once plus 27 EUR per hour"), the assistant is asked to write each rule into the program with what it applies to and how often (one-time, per month, per hour, per unit), to compute every figure you asked for in the form you asked for it (for example a cost per lead that includes the fixed fees), and to state the rules as it read them together with the formula before the results. If a rule was read differently from what you meant, you can see it and correct it in one reply. This applies on every gateway that offers the code interpreter, for every model.
  • Download requests: a message that asks for a file as a download follows the file-tool rules in Downloading a generated file, not this one.

Limits

The sandbox enforces fixed limits on every run. When a limit is hit, the assistant is told what happened and reports it honestly — it does not offer a file it could not produce.

Limit Value What you see
Wall clock 60 seconds per run The program is stopped and the assistant reports that it hit the time limit.
Memory A bounded ceiling of about 1 GB (fleet-configured) A program that keeps allocating is killed; the assistant reports the failed run.
Output 64 KB per stream (stdout, stderr) Longer output is cut, and the assistant is told so in a gateway note placed after the (untrusted) program output, so program text cannot forge or suppress it. The note steers the assistant to process data inside one program rather than print it in chunks; if the output of three tool rounds in a row was cut, a one-time note says that chunked reading costs a round per chunk and asks for a single program that writes the result file. On a gateway that masks personal data, an identifier cut by the limit is masked using the few hundred bytes of output around the cut, so no fragment of it reaches the model. On every gateway, when the program's output was cut, a stream that ends within 256 bytes of the limit may lose up to its last 256 bytes (a shorter stream is never shortened). If masking at the cut is refused (the engine is unavailable, or a block detector matches), that stream is replaced by the placeholder; the other stream and the program's files are still delivered (see PII Protector — Gateway cuts).
Program size 64 KB of program text and 64 KB of input each, up to 128 KiB for the combined job A larger job is refused before it runs, with a clear message.
Network None — the sandbox has no network interface Downloads, API calls and DNS lookups fail inside the sandbox; the assistant cannot fetch anything from the internet with code.

When the sandbox cannot be reached

A sandbox the gateway cannot connect to, or cannot complete the secure handshake with, within 5 seconds each (one unreachable member of the sandbox fleet, for example) is retried, up to 8 attempts with a short growing pause, because the job never started. When the whole fleet is unreachable this takes at most about two minutes in total. A failure after the job was handed over to the sandbox is not retried, because the program may already have run and a second run would repeat its side effects. If every attempt fails, the assistant reports that the code interpreter is temporarily unavailable.

Downloading a chart

A chart produced by the code interpreter is rendered inline in the assistant's reply as an image.

Proceed as follows to download a chart:

  1. Locate the chart image in the assistant's reply.
  2. Click on the Download original button below the chart.

-> The chart image is saved to your device.

💡 Note: Where the browser supports it, a Copy image button is shown next to the chart so the chart can be copied to the clipboard.

In a workflow — the Code node

The same network-isolated sandbox also powers the Code node in the visual Workflow Baukasten, where you write the Python yourself instead of the assistant. A workflow Code node receives run data only as data, never spliced into your program's source:

  • Your code is opaque. The Python you author is run verbatim — it is never rewritten, so a {{…}}-shaped token in your code (an f-string f"{{x}}", a set literal) is literal Python, and the workflow's form/webhook input is never injected into your source.
  • /input/_context.json — the run's trigger input, always staged as a JSON object. Read it with json.load(open("/input/_context.json")); for a form run it is the {field, value} submission (a file field yields the extracted, PII-masked text). It is always present and always an object — a run with no input degrades to {} — so json.load(...).get(...) never raises. _context.json is a reserved name: an input artifact cannot use it.
  • input_refs — up to 7 prior-node artifacts, each staged at /input/<name> (one of the sandbox's 8 input-file slots is reserved for _context.json).

See Workflows API — Code node for the full contract.

See also