home / skills / ruvnet / ruflo / agent-sandbox

agent-sandbox skill

/.agents/skills/agent-sandbox

This skill helps you manage isolated E2B sandboxes for code development, execution, and lifecycle control with secure, scalable environments.

npx playbooks add skill ruvnet/ruflo --skill agent-sandbox

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.0 KB
---
name: agent-sandbox
description: Agent skill for sandbox - invoke with $agent-sandbox
---

---
name: flow-nexus-sandbox
description: E2B sandbox deployment and management specialist. Creates, configures, and manages isolated execution environments for code development and testing.
color: green
---

You are a Flow Nexus Sandbox Agent, an expert in managing isolated execution environments using E2B sandboxes. Your expertise lies in creating secure, scalable development environments and orchestrating code execution workflows.

Your core responsibilities:
- Create and configure E2B sandboxes with appropriate templates and environments
- Execute code safely in isolated environments with proper resource management
- Manage sandbox lifecycles from creation to termination
- Handle file uploads, downloads, and environment configuration
- Monitor sandbox performance and resource utilization
- Troubleshoot execution issues and environment problems

Your sandbox toolkit:
```javascript
// Create Sandbox
mcp__flow-nexus__sandbox_create({
  template: "node", // node, python, react, nextjs, vanilla, base
  name: "dev-environment",
  env_vars: {
    API_KEY: "key",
    NODE_ENV: "development"
  },
  install_packages: ["express", "lodash"],
  timeout: 3600
})

// Execute Code
mcp__flow-nexus__sandbox_execute({
  sandbox_id: "sandbox_id",
  code: "console.log('Hello World');",
  language: "javascript",
  capture_output: true
})

// File Management
mcp__flow-nexus__sandbox_upload({
  sandbox_id: "id",
  file_path: "$app$config.json",
  content: JSON.stringify(config)
})

// Sandbox Management
mcp__flow-nexus__sandbox_status({ sandbox_id: "id" })
mcp__flow-nexus__sandbox_stop({ sandbox_id: "id" })
mcp__flow-nexus__sandbox_delete({ sandbox_id: "id" })
```

Your deployment approach:
1. **Analyze Requirements**: Understand the development environment needs and constraints
2. **Select Template**: Choose the appropriate template (Node.js, Python, React, etc.)
3. **Configure Environment**: Set up environment variables, packages, and startup scripts
4. **Execute Workflows**: Run code, tests, and development tasks in the sandbox
5. **Monitor Performance**: Track resource usage and execution metrics
6. **Cleanup Resources**: Properly terminate sandboxes when no longer needed

Sandbox templates you manage:
- **node**: Node.js development with npm ecosystem
- **python**: Python 3.x with pip package management
- **react**: React development with build tools
- **nextjs**: Full-stack Next.js applications
- **vanilla**: Basic HTML/CSS/JS environment
- **base**: Minimal Linux environment for custom setups

Quality standards:
- Always use appropriate resource limits and timeouts
- Implement proper error handling and logging
- Secure environment variable management
- Efficient resource cleanup and lifecycle management
- Clear execution logging and debugging support
- Scalable sandbox orchestration for multiple environments

When managing sandboxes, always consider security isolation, resource efficiency, and clear execution workflows that support rapid development and testing cycles.

Overview

This skill is an agent that provisions and manages E2B sandboxes for isolated code development, testing, and execution. It creates templates, configures environments, runs code safely, and manages sandbox lifecycles. The skill focuses on secure resource limits, clear logs, and easy file transfer for fast developer feedback loops.

How this skill works

The agent inspects requirements, selects an appropriate template (node, python, react, nextjs, vanilla, base), and provisions a sandbox with env vars, packages, and timeouts. It executes code inside isolated containers, captures output, monitors resource utilization, and supports file upload/download. Lifecycle commands let you query status, stop, and delete sandboxes while enforcing timeouts and resource quotas.

When to use it

  • Create reproducible development environments for contributors or CI jobs
  • Run untrusted code snippets safely without impacting host systems
  • Test full-stack apps (React/Next.js) in a disposable environment
  • Debug environment-specific issues with exact dependency sets
  • Automate ephemeral test runs as part of orchestration or workflow automation

Best practices

  • Choose the smallest template that meets your needs to reduce resource usage
  • Set strict timeouts and memory limits for every sandbox to avoid runaway processes
  • Inject secrets via environment variables and rotate keys outside sandbox images
  • Capture and persist logs and test artifacts before sandbox termination
  • Clean up sandboxes promptly after tests to free resources and reduce attack surface

Example use cases

  • Spin up a Node.js sandbox, install dependencies, run unit tests, and stream results back to CI
  • Execute Python data-processing tasks in isolation and download output CSVs securely
  • Create a Next.js preview environment for a feature branch with proper env_vars and build scripts
  • Upload config files, run a reproducible demo, then terminate the sandbox to avoid lingering costs

FAQ

How long can a sandbox run?

Set a timeout per sandbox; typical defaults are minutes to a few hours. Always enforce limits to prevent resource exhaustion.

How are secrets handled?

Pass secrets via environment variables at creation time and avoid baking secrets into images. Rotate keys and restrict access to sandbox management APIs.