codex-sandbox
FreeNo executable scriptsNot checkedRun code in Codex fully isolated sandbox - network disabled, CWD only, Seatbelt/Docker isolation
by DNYoussef★ 34 GitHub starsAbout this skill
Codex Sandbox Skill
LIBRARY-FIRST PROTOCOL (MANDATORY)
Before writing ANY code, you MUST check:
Step 1: Library Catalog
- Location:
.claude/library/catalog.json - If match >70%: REUSE or ADAPT
Step 2: Patterns Guide
- Location:
.claude/docs/inventories/LIBRARY-PATTERNS-GUIDE.md - If pattern exists: FOLLOW documented approach
Step 3: Existing Projects
- Location:
D:\Projects\* - If found: EXTRACT and adapt
Decision Matrix
| Match | Action |
|---|---|
| Library >90% | REUSE directly |
| Library 70-90% | ADAPT minimally |
| Pattern exists | FOLLOW pattern |
| In project | EXTRACT |
| No match | BUILD (add to library after) |
Purpose
Execute code in Codex's fully isolated sandbox environment for safe experimentation with untrusted or risky code.
Unique Capability
What Claude Can't Do: Claude runs in your environment. Codex sandbox provides:
- Network DISABLED: No external connections
- CWD only: Cannot access parent directories
- OS-level isolation: macOS Seatbelt or Docker
- Resource limits: CPU, memory constraints
- Safe experimentation: Can't break your system
When to Use
Perfect For:
- Running untrusted code safely
- Risky refactoring experiments
- Testing code with potential bugs
- Isolated prototyping
- Security research
- Experimental dependencies
Don't Use When:
- Need network access
- Need to access files outside project
- Production debugging
Usage
# Basic sandbox execution
/codex-sandbox "Refactor auth system and run tests"
# With iteration limit
/codex-sandbox "Fix all tests" --max-iterations 10
# Risky experiment
/codex-sandbox "Try experimental algorithm implementation"
CLI Command
codex --full-auto --sandbox true --network disabled "Your task"
# Via script
CODEX_MODE=sandbox bash scripts/multi-model/codex-yolo.sh "Task" "id" "." "10" "sandbox"
Isolation Layers
| Layer | Protection |
|---|---|
| Network | DISABLED - no external connections |
| Filesystem | CWD only - no parent access |
| OS-Level | Seatbelt (macOS) / Docker |
| Process | Subprocess jail with limits |
| Commands | Blocked: rm -rf, sudo, etc. |
Integration Pattern
// 1. Run risky refactoring in sandbox
const result = await codexSandbox("Refactor entire auth system");
// 2. If successful, apply to real codebase
if (result.tests_pass) {
Task("Coder", "Apply sandboxed changes to main", "coder");
}
Memory Integration
- Key:
multi-model/codex/sandbox/{session_id} - Contains: commands, files created/modified, test results
Install codex-sandbox in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
BashReadWriteTodoWriteGlobGrepFAQ
What does the codex-sandbox skill do?
Run code in Codex fully isolated sandbox - network disabled, CWD only, Seatbelt/Docker isolation
How do I install the codex-sandbox skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the codex-sandbox skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic