Sandboxing
Sandboxing is the practice of running code or processing data in a secure, isolated environment, separate from the host machine and operating system. This approach is commonly used to test unverified or third-party software and to limit the impact of potential code execution vulnerabilities. In the context of machine learning (ML) models or LLM–generated code, sandboxing often involves containerizing these components and restricting their access to network resources, internal services, and application programming interfaces (APIs).
OWASP recommends several best practices for sandboxing an LLM: restrict the LLM’s access to sensitive resources, limit its capabilities to only what is necessary for its intended purpose, audit the LLM’s environment and access controls to ensure proper isolation, and log LLM interactions to detect and analyze potential sandboxing issues.
Cybersecurity firm Proofpoint describes several key features of sandboxes:
- They emulate real-world devices and target operating systems.
- They are typically hosted on virtual machines, where such activities as file system modifications, network communications, and system calls are closely monitored.
- They limit network access and prevent unauthorized file modifications.
When setting up a sandbox, the Cloud Security Alliance recommends applying the same security settings used in the operational environment—such as multifactor authentication (MFA), single sign-on (SSO), and identity providers (IDP)—to the sandbox environment. Additional recommendations include employing data masking and syncing the sandbox with the production environment on a daily basis.
Commercial Off-the-Shelf Solutions and Simple Recommendations
- LLM Sandbox1
- Datasaur’s Sandbox2
- ChatGPT Playground3
- gVisor with Google Kubernetes Engine (GKE) Sandbox4
- WebAssembly5
- Azure Sandbox6
- CodeSandbox ML examples7
- Secure Container Isolation in Kubernetes8
- Podman container9
- Salesforce Sandboxes10
See also Amazon SageMaker,11 Microsoft Azure Machine Learning,12 IBM Watson Studio,13 Kaggle Kernels,14 H2O.ai,15 DataRobot,16 Anaconda Enterprise,17 Cloudera Data Science Workbench,18 RapidMiner,19 SandboxJS,20 AppArmor,21 SELinux,22 Sandbox2,23 Bubblewrap,24 Minijail,25 NSJail,26 Sandboxed API,27 RLBox,28 Flatpak,29 Windows Sandbox,30 and chroot() jail,31
Other Sources of Information About This Topic
- “What Are Sandboxed Containers?” (Red Hat)32
- “Code Execution Isolation and Containment with Sandbox Solutions” (Google for Developers)33
- “What Is a Sandbox?” (Proofpoint)34
- “Sandboxing as a Security Control in ML and LLMs” (LinkedIn)35
- “Sandboxing Agentic AI Workflows with WebAssembly” (NVIDIA)36
- “Code Sandboxes for LLMs and AI Agents” (Amir’s Blog)37
- “Not All Sandboxes Are for Children” (Cloud Security Alliance)38
- “SandboxEval” (arXiv)39
- “Native Client” (Communications of the ACM)40
Notes
- Duy, “LLM Sandbox.” Return to content ⤴
- Datasaur, “Sandbox.” Return to content ⤴
- HARPA AI Technologies, “How to Use ChatGPT Sandbox”; Layton, “ChatGPT Playground.” Return to content ⤴
- Lacasse, “Open-Sourcing gVisor, a Sandboxed Container Runtime”; gVisor, “Kubernetes Quick Start”; Google Cloud, “GKE Sandbox.” Return to content ⤴
- Lucas, “Sandboxing Agentic AI Workflows with WebAssembly.” Return to content ⤴
- Doherty, “Azure Sandbox.” Return to content ⤴
- CodeSandbox, “Find Machine Learning Examples and Templates.” Return to content ⤴
- Allclair, “Secure Container Isolation.” Return to content ⤴
- Podman, “Homepage.” Return to content ⤴
- Salesforce, “Salesforce Sandboxes.” Return to content ⤴
- AWS, “Amazon SageMaker.” Return to content ⤴
- Microsoft, “Azure Machine Learning.” Return to content ⤴
- IBM, “IBM Watson Studio.” Return to content ⤴
- Kaggle, “Code.” Return to content ⤴
- H2O.ai, “About Us.” Return to content ⤴
- DataRobot, “Homepage.” Return to content ⤴
- Anaconda, “Anaconda Platform.” Return to content ⤴
- Cloudera, “Cloudera AI.” Return to content ⤴
- Altair, “Altair RapidMiner.” Return to content ⤴
- nyariv, “SandboxJS.” Return to content ⤴
- AppArmor, “Homepage.” Return to content ⤴
- Red Hat, “What Is SELinux (Security-Enhanced Linux).” Return to content ⤴
- Google for Developers, “What Is Sandbox2.” Return to content ⤴
- Containers, “Bubblewrap.” Return to content ⤴
- Google Git, “Minijail.” Return to content ⤴
- NsJail, “Homepage.” Return to content ⤴
- Google for Developers, “What Is Sandboxed API.” Return to content ⤴
- PLSysSec, “RLBox.” Return to content ⤴
- Flatpak, “Flatpak.” Return to content ⤴
- Pulapaka, “Windows Sandbox.” Return to content ⤴
- Newell, “How to Set Up Linux chroot Jails.” Return to content ⤴
- Red Hat, “What Are Sandboxed Containers”; “Understanding Containers.” Return to content ⤴
- Google for Developers, “Code Execution Isolation and Containment with Sandbox Solutions.” Return to content ⤴
- Proofpoint, “What Is a Sandbox.” Return to content ⤴
- Huang, “Sandboxing as a Security Control in ML and LLMs.” Return to content ⤴
- Lucas, “Sandboxing Agentic AI Workflows with WebAssembly.” Return to content ⤴
- Malik, “Code Sandboxes for LLMs and AI Agents.” Return to content ⤴
- Livneh, “Not All Sandboxes Are for Children.” Return to content ⤴
- Rabin et al., “SandboxEval.” Return to content ⤴
- Yee et al., “Native Client.” Return to content ⤴