Python Execution

Tool-use protocol in the leaked Meta AI (Muse Spark) system prompt (2026-10-24): invoke container.python_execution in a stateless Python 3.9 sandbox for numerical results.

Triggering

Use container.python_execution when the user asks the model to calculate, compute, or verify any numerical result: math, statistics, date calculations, encoding/hashing, data visualizations, or algorithm execution.

Do Not Use Python For

  • Explaining coding concepts.
  • Writing code for the user to run (show it in a markdown code block instead).

Known Weakness: Floating-Point Intuition

The prompt explicitly warns that internal intuition on simple floating-point arithmetic is unreliable:

  • 9.8 - 9.11 = 0.69, not 0.31 (9.8 is larger than 9.11).
  • 6.8 - 6.11 = 0.69; 3.8 - 3.11 = 0.69.

This is a documented, version-level awareness that LLM numeric intuition is adversarial to its own heuristics — hence the requirement to route numerical verification to an external interpreter.

Output Contract

  • Generated files are not automatically visible to the user. Show images with ![description](container:///mnt/data/file.png) and other files with [description](container:///mnt/data/file.html).
  • When the user asks to write code, show it in a markdown code block; do not execute it.
  • Do not show code for math answers — only the result.

Relationship to Tools

Python execution is one of four environment tools alongside [[search-guidelines]] (browser.search + meta_1p.content_search), [[media-generation]], and third_party.link_third_party_account (calendar/email linking). All follow the same “call immediately, never announce” discipline.

Relationship to Response Formatting

Python execution outputs integrate with [[response-formatting]]: images use ![description](container:///mnt/data/file.png) and other files use [description](container:///mnt/data/file.html).

Implications

  • Explicit self-awareness: The prompt acknowledges a known reasoning flaw rather than pretending numeric intuition is reliable — a rare example of self-documenting weakness in a system prompt.
  • Stateless sandbox: container.python_execution is stateless (per-call sandbox), so cross-call state cannot be assumed — relevant for iterative computations that would normally need persistent variables.
  • Cost discipline: Computation is offloaded to a sandbox rather than letting the model “think aloud” numerically, which is consistent with token-budget discipline.

Open Questions

  • Does 1.1 change the Python version or add package access?
  • Can the sandbox persist scratch files across a multi-turn conversation, or must each turn recompute?

Sources