Isolates agent execution environments using container sandboxing, permission boundaries, resource limits, and network segmentation. Covers process-level (seccomp, AppArmor), container-level (Docker), and VM-level (Firecracker) isolation.
Ships in all-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part of Agent Skills™ by googleadsagent.ai™
Sandbox Hardening isolates agent execution environments using container sandboxing, permission boundaries, resource limits, and network segmentation. The agent configures and validates sandboxes that prevent AI-generated code from accessing unauthorized resources, consuming unbounded compute, or affecting the host system.
An AI agent with unrestricted shell access is a security liability. Without sandboxing, a prompt injection or hallucinated command could delete files, exfiltrate data, install malware, or consume unbounded resources. Sandbox Hardening applies the principle of least privilege: the agent receives only the permissions it needs, in an isolated environment with strict resource limits and monitored network access.
This skill covers three isolation levels: process-level sandboxing (seccomp, AppArmor), container-level isolation (Docker with restricted capabilities), and VM-level isolation (microVMs like Firecracker). The appropriate level depends on the trust boundary: internal development tools use process-level, multi-tenant platforms use container-level, and untrusted code execution requires VM-level isolation.
graph TD
A[Agent Task] --> B{Trust Level Assessment}
B -->|Internal Dev| C[Process Sandbox]
B -->|Multi-Tenant| D[Container Sandbox]
B -->|Untrusted Code| E[VM Sandbox]
C --> F[seccomp + AppArmor Profile]
D --> G[Docker: No Root + Read-Only FS]
E --> H[Firecracker microVM]
F --> I[Resource Limits: CPU, Memory, Disk]
G --> I
H --> I
I --> J[Network Policy: Allowlist Only]
J --> K[Filesystem: Scoped Mount]
K --> L[Monitoring: Syscall Audit]
L --> M[Execution within Sandbox]
The sandbox is configured before the agent executes any code. Trust level determines the isolation technology, and all levels apply resource limits, network restrictions, and filesystem scoping.
# Container sandbox: minimal, non-root, read-only
FROM node:20-slim AS sandbox
RUN groupadd -r agent && useradd -r -g agent -d /workspace agent
WORKDIR /workspace
COPY --chown=agent:agent . .
USER agent
# docker-compose sandbox configuration
services:
agent-sandbox:
build: .
read_only: true
tmpfs:
- /tmp:size=100M,noexec
security_opt:
- no-new-privileges:true
- seccomp:seccomp-profile.json
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
deploy:
resources:
limits:
cpus: "2.0"
memory: 512M
pids: 100
reservations:
cpus: "0.5"
memory: 128M
networks:
- sandbox-net
dns:
- 1.1.1.1
networks:
sandbox-net:
driver: bridge
internal: false
import resource
import os
class ProcessSandbox:
"""Process-level sandboxing for single-tenant development."""
@staticmethod
def apply_limits(
max_memory_mb: int = 256,
max_cpu_seconds: int = 30,
max_file_size_mb: int = 10,
max_open_files: int = 64,
max_processes: int = 10,
):
mb = 1024 * 1024
resource.setrlimit(resource.RLIMIT_AS, (max_memory_mb * mb, max_memory_mb * mb))
resource.setrlimit(resource.RLIMIT_CPU, (max_cpu_seconds, max_cpu_seconds))
resource.setrlimit(resource.RLIMIT_FSIZE, (max_file_size_mb * mb, max_file_size_mb * mb))
resource.setrlimit(resource.RLIMIT_NOFILE, (max_open_files, max_open_files))
resource.setrlimit(resource.RLIMIT_NPROC, (max_processes, max_processes))
@staticmethod
def restrict_filesystem(allowed_dirs: list[str]):
"""Use chroot or bind mounts to restrict filesystem access."""
for d in allowed_dirs:
assert os.path.isabs(d), f"Allowed dirs must be absolute: {d}"
assert os.path.exists(d), f"Allowed dir does not exist: {d}"
@staticmethod
def validate_command(command: str, blocklist: list[str]) -> bool:
"""Check command against blocklist before execution."""
return not any(blocked in command for blocked in blocklist)
COMMAND_BLOCKLIST = [
"rm -rf /", "mkfs", "dd if=", "> /dev/sd",
"curl | sh", "wget | bash", "chmod 777",
"iptables", "mount", "umount",
]
no-new-privileges security option| Platform | Support | Notes |
|---|---|---|
| Cursor | Full | Docker + process sandboxing |
| VS Code | Full | Dev container support |
| Windsurf | Full | Sandbox configuration |
| Claude Code | Full | Container-based isolation |
| Cline | Full | Security boundary config |
| aider | Partial | Process-level only |
sandbox container-security isolation least-privilege resource-limits seccomp docker-hardening agent-isolation
© 2026 googleadsagent.ai™ | Agent Skills™ | MIT License
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/all-skills:sandbox-hardeningfrom all-skills
npx claudepluginhub itallstartedwithaidea/agent-skills --plugin all-skills73 skills in this plugin
/ad-copy-generationThe Ad Copy Generation skill produces high-performance responsive search ad (RSA) copy using AI-driven generation pipelines calibrated against millions of ad performance data points./adversarial-resilienceAdversarial Resilience is the practice of hardening AI agents against deliberate attacks — prompt injection, data exfiltration, sandbox escape, and unauthorized capability escalation./agent-instinct-systemThe Agent Instinct System implements pre-cognitive reflexes — automatic safety checks and validations that fire before every code change, tool call, or output generation./agent-security-scanningAgent Security Scanning detects vulnerabilities in AI-generated code before it reaches production./ai-chat-studioAI Chat Studio provides a multi-LLM chat orchestration framework with 300+ assistant presets, intelligent model routing, and conversation management./anthropic-tool-masteryAnthropic Tool Mastery is the definitive skill for leveraging Claude's native tool_use capability to its fullest potential.2 plugins ship this exact skill · first indexed Jul 18, 2026