PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← Guides> Library> Topic

Running LLM-generated code safely: code execution and sandboxing

Letting a model write and run code is powerful: it can do exact arithmetic, transform data and chain many steps in one program instead of dozens of tool calls. It is also risky, because the code is untrusted. It might read files, open network connections, loop forever or exhaust memory, whether by mistake or because a prompt injection told it to.

A sandbox runs that code in isolation, usually a container with no network, a read-only file system and limits on time, memory and processes. These guides show how to set up such a sandbox in Python, how code-action agents write one program in place of many tool calls, and how Program-of-Thought prompting hands calculations to code that runs safely.

6
guides
3
Intermediate
3
Advanced
2 h
of reading
01

Start here

Run Coding Agents in Dev Containers Safely

How to run coding agents like Claude Code and Codex in a dev container safely: an egress allowlist, no sudo, read-only Git hooks, and checks that prove it.

Intermediate · 18 minRead the guide →

5 guides

  1. 01AutoGen Docker Task Isolation: Secure the Code ExecutorSet up AutoGen Docker task isolation: configure DockerCommandLineCodeExecutor, run one container per task, cut the network, set limits and fix errors.Intermediate · 20 minGuardrails and securityIntermediate · 20 minGuardrails and security→
  2. 02AI Agent Code Execution Sandbox: Run LLM Code SafelyLet an AI agent write and run Python in a Docker sandbox: analyse a CSV, try real escape attempts, set limits, and learn where the sandbox stops.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  3. 03AI Agent Network Egress: Limit Where Agents Can ConnectLimit AI agent network egress: give agent code no network, route the rest through an allowlist proxy, and make tools refuse private IPs and redirects.Advanced · 18 minGuardrails and securityAdvanced · 18 minGuardrails and security→
  4. 04Code-Action Agents in Python: One Program vs 37 Tool CallsBuild a code-action agent in Python over an MCP server: the model writes one program that calls your tools in a Docker sandbox, within a budget you set.Advanced · 15 minTools and the Model Context Protocol (MCP)Advanced · 15 minTools and the Model Context Protocol (MCP)→
  5. 05Program-of-Thought in Python: Run Model Code SafelyCompute answers with model-written code in Python: an output contract, a locked-down Docker sandbox, a two-run check, and when to use a code tool instead.Advanced · 8 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→

Related topics

  • Deployment40
  • Model Context Protocol (MCP)54
  • Agent Harness5
  • Agent Reasoning Patterns4
  • AI Agent Frameworks13
  • Coding Agents4
  • Human-in-the-Loop27
  • Multi-Agent Systems12

Topic hubs

  • Guardrails and security→
  • Runtime, triggers and deployment→
  • Tools and the Model Context Protocol (MCP)→
  • Agent reasoning patterns→

By category and level

  • AI Engineering guides147
  • Prompt Engineering guides54
  • Intermediate guides140
  • Advanced guides38

Search every guide.

The library lists all guides with filters for topic, level, category and reading time.

All guidesLearning paths