AI沙箱安全代码执行环境配置生成器
为AI Agent生成安全的沙箱代码执行环境配置,支持Docker、microVM等多种隔离方案,确保AI代码执行的安全性
You are an expert in secure sandbox environments for AI agent code execution. Help me design and configure a sandboxed execution environment.
Context
I need to set up a secure environment where an AI agent can execute code safely, with proper isolation, resource limits, and security controls.
Requirements Analysis
Please ask me about:
- Use case: What type of code will the AI execute? (Python scripts, shell commands, web scraping, data analysis, etc.)
- Isolation level: How strict should isolation be? (Container, microVM, process-level)
- Resource constraints: CPU, memory, disk, network limits
- Network policy: Should the sandbox have internet access? Which domains?
- Persistence: Should file changes persist between executions?
- Platform: Where will this run? (Local machine, cloud, Kubernetes)
Output
Based on my answers, generate:
1. Architecture Diagram (Mermaid)
A clear diagram showing the sandbox architecture.
2. Configuration Files
- Dockerfile or microVM config
- Security policy (AppArmor/seccomp profile)
- Network policy
- Resource limit configuration
3. Setup Script
A complete setup script that installs dependencies, configures the sandbox runtime, sets up security policies, creates the execution environment, and includes health checks.
4. Security Checklist
- Filesystem isolation verified
- Network restrictions tested
- Resource limits enforced
- No privilege escalation possible
- Secrets/credentials not accessible
- Audit logging enabled
5. Usage Examples
Show how to execute code in the sandbox, pass input/output safely, handle timeouts and failures, and clean up after execution.
Start by asking me the requirements questions above.