Skip to main content

Control M2

Tool Sandboxing & Isolation

Implement defense-in-depth isolation for tool execution environments using containerization, virtualization, and strict resource controls to prevent tool misuse, contain breaches, and prevent unexpected code execution.

  • 5 threats mitigated
  • 9 AISVS requirements
  • 3 AISVS chapters
  • 75 tasks

All controlsLifecycle view

Threats mitigated

  • T2 Tool Misuse

    Manipulation of tools, APIs, or environment access to perform unintended actions or access unauthorized resources, including exploitation of access to external systems.

  • T3 Privilege Compromise

    Breaking information system boundaries through context collapse, causing unauthorized data access/leakage, or exploiting tool privileges to gain unauthorized access to systems.

  • T4 Resource Overload

    Overwhelming external services through excessive API calls or resource consumption, potentially causing denial of service or excessive costs.

  • T11 Unexpected RCE and Code Attacks

    Tools or environments enabling unexpected code execution, presenting direct risks to code execution environments.

  • T16 Insecure Inter-Agent Protocol Abuse

    Attackers abuse the trust and control semantics of agent interoperability protocols such as MCP and A2A: manipulating server responses, injecting context, publishing misleading tool descriptions or exploiting ambiguous consent flows.

OWASP AISVS coverage

The AISVS 1.01 chapters and verification requirements this control helps satisfy.

C4 Infrastructure, Configuration & Deployment Security

  • C4.1.1 Level 1

    Verify that AI models execute in isolated sandboxes.

C9 Orchestration & Agentic Security

  • C9.1.1 Level 1

    Verify that per-tool quotas and timeouts (e.g., CPU, memory, disk, egress, and execution time) are enforced by the runtime.

  • C9.3.1 Level 1

    Verify that each tool/plugin executes in a least-privilege sandbox or is otherwise isolated from model operations.

  • C9.3.3 Level 2

    Verify that tool manifests declare required privileges, resource limits, and output validation requirements.

  • C9.3.4 Level 2

    Verify that the runtime enforces the privileges, resource limits, and output-validation requirements declared in tool manifests.

  • C9.3.5 Level 2

    Verify that components processing untrusted data are isolated from tool-calling capabilities, ensuring that compromised data processing cannot trigger unauthorized tool invocations.

  • C9.3.6 Level 2

    Verify that there is architectural separation between processing of untrusted tool outputs and agent operations.

  • C9.3.9 Level 2

    Verify that services reachable from agent or tool sandboxes enforce the defined run, task, or tenant isolation policy on agent-writable state, including object names.

C10 Model Context Protocol (MCP) Security

  • C10.1.3 Level 2

    Verify that locally launched MCP servers run in a least-privilege sandbox with restricted file system, network, and system access.

Design phase

Architecture, threat modelling and policy decisions made before code is written. 23 tasks.

Tool Risk Assessment & Classification

  • Define tool risk categories based on capabilities:
    • LOW RISK: Read-only operations, data retrieval, calculations
    • MEDIUM RISK: File operations, API calls, data processing
    • HIGH RISK: System operations, network access, database writes
    • CRITICAL RISK: Financial transactions, user impersonation, system administration
  • Design isolation requirements per risk level with appropriate boundaries
  • Plan fail-safe mechanisms for tool failures and timeout scenarios
  • Design tool capability attestation and verification systems
  • Plan tool dependency mapping and security verification
  • Design tool communication protocols with security controls

Sandboxing Architecture

  • Design container-based isolation strategy using Docker/Podman with security profiles
  • Plan microVM isolation for critical tools using Firecracker or QEMU/KVM
  • Design WebAssembly (WASM) sandboxes for lightweight, memory-safe execution
  • Plan network isolation strategies with custom namespaces and firewalls
  • Design resource quotas and limits for CPU, memory, disk, and network
  • Plan security policy enforcement using AppArmor, SELinux, or seccomp-bpf
  • Design tool chaining security to prevent privilege escalation

Execution Environment Design

  • Plan ephemeral execution contexts with automatic cleanup
  • Design stateless tool execution patterns
  • Plan secure tool parameter passing mechanisms
  • Design tool output validation and sanitization pipelines
  • Plan tool execution monitoring and logging strategies
  • Design tool capability tokens and permission verification

Build phase

Implementation, testing and hardening while the agent is developed. 28 tasks.

Container Isolation Implementation

  • Deploy Docker containers with hardened security profiles:
    • Use minimal base images (distroless, Alpine Linux)
    • Implement resource limits using cgroups v2
    • Deploy AppArmor/SELinux profiles for container security
    • Use read-only filesystems where possible
    • Implement capability dropping and privilege restrictions
  • Configure container networking with restricted egress:
    • Use custom network namespaces with controlled routing
    • Implement firewall rules (iptables/nftables) per container
    • Deploy network policies in Kubernetes environments
    • Use service mesh (Istio/Linkerd) for secure inter-container communication

Advanced Isolation Techniques

  • Deploy gVisor for kernel-level isolation of high-risk tools
  • Implement Firecracker microVMs for critical tool isolation
  • Use WebAssembly (WASM) sandboxes with WASI for portable isolation
  • Deploy Kata Containers for VM-level container security
  • Implement user namespace mapping for privilege separation
  • Use chroot jails for filesystem isolation

Resource Controls Implementation

  • CPU Limits: Configure cgroups v2 cpu.max settings and CPU quotas
  • Memory Limits: Set memory.max and memory.swap.max restrictions
  • I/O Limits: Implement blkio throttling and disk quota management
  • Network Limits: Deploy bandwidth limiting and connection quotas
  • Process Limits: Set pids.max to prevent fork bombs and process exhaustion
  • Time Limits: Implement execution timeouts with automatic termination

Tool Security Framework

  • Build tool wrapper libraries with input validation and output sanitization
  • Implement tool capability verification and permission checking
  • Deploy tool execution monitoring with real-time policy enforcement
  • Build tool result verification and integrity checking
  • Implement tool chain validation for complex operations

Operations phase

Monitoring, response and continuous improvement once the agent is live. 24 tasks.

Runtime Security Operations

  • Monitor container and sandbox health with automated restarts
  • Execute regular security scans of container images and runtime environments
  • Maintain updated base images with security patches
  • Monitor resource usage patterns and detect anomalies
  • Execute periodic security assessments of tool configurations
  • Maintain tool capability registries with security metadata
  • Deploy automated threat detection for unusual tool behavior

Container Management

  • Use container orchestration (Kubernetes) with security policies
  • Implement pod security standards and network policies
  • Deploy admission controllers for security policy enforcement
  • Use image scanning and vulnerability assessment tools
  • Implement container runtime security monitoring
  • Maintain container image registries with security scanning

Incident Response for Sandboxed Tools

  • Deploy automated containment for compromised sandboxes
  • Implement forensic data collection from isolated environments
  • Maintain tool execution logs for security analysis
  • Execute automated rollback and recovery procedures
  • Deploy threat hunting capabilities for sandbox environments
  • Implement automated indicators of compromise (IoC) detection

Performance & Scaling

  • Monitor sandbox performance and resource utilization
  • Implement auto-scaling for tool execution environments
  • Deploy load balancing for distributed tool execution
  • Optimize sandbox startup times and resource allocation
  • Maintain tool execution analytics and performance metrics

Tools and frameworks

Containerization & Orchestration

  • Container Runtimes: Docker Engine, Podman, containerd with security configurations
  • Orchestration: Kubernetes with Pod Security Standards, OpenShift with enhanced security
  • Advanced Isolation: gVisor, Kata Containers, Firecracker microVMs
  • WebAssembly: Wasmtime, WasmEdge, WASI SDK for portable sandboxing

Security Enforcement

  • Linux Security Modules: AppArmor profiles, SELinux policies, seccomp-bpf filters
  • Network Security: Calico, Cilium, Istio service mesh, Linkerd
  • Policy Enforcement: Open Policy Agent (OPA), Gatekeeper, Falco for runtime security
  • Image Security: Trivy, Twistlock/Prisma Cloud, Aqua Security

Resource Management

  • Resource Limits: cgroups v2, systemd, Kubernetes resource quotas
  • Monitoring: Prometheus, Grafana, cAdvisor for container metrics
  • Performance: Intel Clear Containers, AWS Nitro Enclaves
  • Storage: Persistent volumes with encryption, ephemeral storage management

Development & Testing

  • Sandbox Testing: Docker Compose for development, Kind for Kubernetes testing
  • Security Testing: Anchore, Clair for vulnerability scanning
  • Compliance: Docker Bench, kube-bench for security benchmarking
  • Cloud Services: AWS Lambda, Google Cloud Run, Azure Container Instances with security features

References

Source: Agentic Security Hub controls (editorial, after OWASP Agentic AI T&M v1.1; mapped to AISVS 1.01) 2026.11 · retrieved 2026-11