code-sandbox
Secure sandboxed code execution for AI-generated scripts.
Skill by malue-ai
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/malue-ai-code-sandbox
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: devops
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-sandbox
What's inside
- Skill name
code-sandbox- Description
- Secure sandboxed code execution for AI-generated scripts. Runs Python/JS in isolated environments (Docker or E2B) to protect the user's system.
- License
- MIT
- Instructions
- 174 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 安全代码沙箱
在隔离的沙箱环境中执行 AI 生成的代码,保护用户系统安全。支持 Docker 本地沙箱(免费)和 E2B 云沙箱两种模式。
## 使用场景
- 用户说「帮我写个脚本分析这个 CSV 文件」→ 在沙箱中执行,不污染主系统
- 用户说「帮我画个图表」→ matplotlib 在沙箱中运行,输出图片文件
- 用户说「运行一下这段代码看看结果」→ 安全隔离执行
- 数据分析、原型验证、临时脚本等不适合在主系统直接执行的场景
- 执行来历不明或复杂度高的代码片段
## 何时使用此 Skill(而非直接 system.run)
```
判断逻辑:
需要执行代码
├── 简单系统命令(ls, git, pip 等) → 直接 system.run
├── 用户提供的完整脚本 → code-sandbox ✅ 更安全
├── AI 生成的分析/处理代码 → code-sandbox ✅ 推荐
├── 需要安装额外依赖的代码 → code-sandbox ✅ 不污染主环境
└── 需要网络访问的爬虫/API 调用 → code-sandbox ✅ 隔离风险
```
## 前置条件(二选一)
### 方式一:Docker 本地沙箱(推荐,免费)
1. 安装 Docker:https://www.docker.com/get-started
2. 确保 Docker 正在运行:`docker info`
3. 无需额外配置,首次使用时自动拉取基础镜像
### 方式二:E2B 云沙箱
1. 注册 E2B 账号:https://e2b.dev/
2. 设置环境变量:`export E2B_API_KEY="your-key"`
3. 提供免费额度,适合不想装 Docker 的用户
## 执行方式
### Docker 本地沙箱模式
#### 执行 Python 脚本
```python
import asyncio
import tempfile
import os
async def run_in_sandbox(code: str, files: dict = None, timeout: int = 60):
"""在 Docker 沙箱中执行 Python 代码"""
# 创建临时工作目录
work_dir = tempfile.mkdtemp(prefix="sandbox_")
# 写入用户代码
script_path = os.path.join(work_dir, "script.py")
with open(script_path, "w") as f:
f.write(code)
# 如果有输入文件,复制到工作目录
if files:
for name, content in files.items():
fpath = os.path.join(work_dir, name)
if isinstance(content, bytes):
with open(fpath, "wb") as f:
f.write(content)
else:
with open(fpath, "w") as f:
f.write(content)
# Docker 执行命令
cmd = [
"docker", "run", "--rm",
"--network=none", # 默认禁用网络(需要时可开启)
"--memory=512m", # 内存限制
"--cpus=1.0", # CPU 限制
"-v", f"{work_dir}:/workspace", # 挂载工作目录
"-w", "/workspace",
"python:3.12-slim",
"python", "script.py"
]
proc = await asyncio.create_subprocess_exec(
*cmd,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
stdout, stderr = await asyncio.wait_for(
proc.communicate(), timeout=timeout
)
return {
"success": proc.returncode == 0,
"stdout": stdout.decode(),
"stderr": stderr.decode(),
"output_dir": work_dir, # 检查输出文件
}
```
#### 带依赖安装的执行
```python
async def run_with_deps(code: str, packages: list, files: dict = None):
"""安装依赖后执行"""
pip_install = " ".join(packages)
wrapper = f"""
import subprocess, sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", {', '.join(repr(p) for p in packages)}])
{code}
"""
return await run_in_sandbox(wrapper, files, timeout=120)
```
### E2B 云沙箱模式
```pythonFrom malue-ai/dazee-small, MIT.
More from malue-ai/dazee-small
- 0.496score
deep-research
malue-ai
Conduct multi-step autonomous research on any topic.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
excel-fixer
malue-ai
Auto-detect and fix common Excel formatting issues like merged cells, inconsistent types, duplicate headers, and encoding problems.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
competitive-intel
malue-ai
Monitor competitor websites, products, and social media for updates.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
deep-doc-reader
malue-ai
Deep analysis and Q&A for long documents (PDF reports, contracts, papers, manuals).
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
elegant-reports
malue-ai
Generate beautifully designed PDF reports with Nordic-style typography, charts, tables, and multi-page layouts using reportlab or fpdf2.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
excel-analyzer
malue-ai
Analyze and process Excel/CSV files using pandas and openpyxl.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
app-scanner
malue-ai
Discover installed applications on macOS and recommend the best app for user tasks.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
batch-file-converter
malue-ai
Batch convert files between formats - images (HEIC/PNG/JPG/WebP), documents (Markdown/HTML), and more using Python and system tools.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
content-reformatter
malue-ai
Reformat content for different platforms (WeChat, Zhihu, Xiaohongshu, Twitter, email).
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
cross-app-workflow
malue-ai
Chain multiple local apps and skills into complex multi-step workflows.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
draw-io
malue-ai
Generate professional diagrams in draw.io XML format including flowcharts, org charts, UML diagrams, and network topology diagrams.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
feishu
malue-ai
Feishu (Lark) full integration — messages, documents, calendars, tasks, approvals, and meeting minutes via lark-oapi SDK.
SkillDFreshness: D★ 37Claude Code +9
Signals
- Stars
- 37
- Forks
- 2
- Open issues
- 3
- Last commit (this folder)
- Feb 26, 2026 (8 months ago)
- Last release
- Feb 26, 2026 (8 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/malue-ai/dazee-small
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from malue-ai
- 0.496score
competitive-intel
malue-ai
Monitor competitor websites, products, and social media for updates.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
cross-app-workflow
malue-ai
Chain multiple local apps and skills into complex multi-step workflows.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
app-scanner
malue-ai
Discover installed applications on macOS and recommend the best app for user tasks.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
batch-file-converter
malue-ai
Batch convert files between formats - images (HEIC/PNG/JPG/WebP), documents (Markdown/HTML), and more using Python and system tools.
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
content-reformatter
malue-ai
Reformat content for different platforms (WeChat, Zhihu, Xiaohongshu, Twitter, email).
SkillDFreshness: D★ 37Claude Code +9 - 0.496score
deep-doc-reader
malue-ai
Deep analysis and Q&A for long documents (PDF reports, contracts, papers, manuals).
SkillDFreshness: D★ 37Claude Code +9
Cite this page
code-sandbox skill. Agent Mart. https://agentmart.dev/skills/malue-ai-code-sandbox (last updated 2026-10-24)