Security Model Overview
SmolVM provides hardware-level isolation through microVMs, offering significantly stronger security boundaries than traditional containers. However, proper operational practices are essential for maintaining a secure environment.SmolVM uses KVM-backed microVMs (Firecracker on Linux, QEMU on macOS) to provide hardware-level isolation. Each VM runs with its own kernel, isolated from the host and other VMs.
Trust Model and Scope
Understand what SmolVM protects against and where you need additional controls:What SmolVM Protects
- Code execution isolation: Untrusted code runs in a separate VM with its own kernel
- Resource isolation: CPU, memory, and disk are isolated per-VM
- Network isolation: Each VM has its own network namespace and IP
- Host protection: Hardware virtualization prevents guest code from accessing the host
What Requires Additional Controls
- Network security: SmolVM provides local NAT by default; external network security is your responsibility
- Data exfiltration: VMs have internet access by default; implement network policies if needed
- Secrets management: Don’t pass sensitive credentials without proper protection
- Multi-tenancy: Additional isolation may be needed for untrusted multi-tenant scenarios
Current SSH Trust Model (Important)
Security Impact
The current SSH implementation:- Accepts unknown host keys on first connection
- Does not validate host identity cryptographically
- Could allow man-in-the-middle attacks in untrusted network environments (CWE-295)
Recommended Usage
SmolVM should be treated as a trusted-host / trusted-network local runtime:Use on trusted infrastructure
Run SmolVM on:
- Local developer machines
- Trusted CI/CD runners
- Private networks with controlled access
Avoid public exposure
Do not expose:
- Guest SSH endpoints to the internet
- VM management interfaces publicly
- Unprotected API endpoints from within VMs
Operational Security Best Practices
Secrets and Credentials Management
Never expose secrets unnecessarily to VMs:Best practices for secrets:
- Use ephemeral VMs: Destroy VMs immediately after use to avoid credential leakage
- Rotate credentials: Use short-lived tokens when possible
- Limit scope: Only provide the minimum required permissions
- Audit access: Log when secrets are injected into VMs
Network Security
Control VM network access based on your threat model:Restricting Outbound Access
If you need to limit VM internet access:Future versions of SmolVM may include built-in network policy controls. For now, use host-level firewall rules to restrict VM traffic.
Monitoring Network Activity
Monitor VM network usage:Resource Limits and DoS Prevention
Preventing resource exhaustion:Disk Isolation
Use isolated disk mode (default) for per-VM disk isolation:- Changes in one VM don’t affect others
- VMs can’t access each other’s data
- Clean slate on each VM creation
Isolated mode creates a copy-on-write disk for each VM. Disk changes are discarded when the VM is deleted.
Security Hardening Checklist
Use this checklist for production deployments:Host hardening
- Keep kernel and Firecracker/QEMU updated
- Enable AppArmor or SELinux policies
- Restrict access to
/dev/kvm - Run SmolVM processes with minimal privileges
- Enable host firewall (ufw, firewalld)
Network security
- Use private networks for VM communication
- Implement egress filtering if needed
- Monitor network traffic for anomalies
- Avoid exposing SSH ports publicly
- Use VPN or bastion for remote access
Access control
- Limit who can create/manage VMs
- Use RBAC for multi-user environments
- Audit VM creation and command execution
- Implement authentication for management APIs
Data protection
- Use isolated disk mode (default)
- Encrypt sensitive data before passing to VMs
- Destroy VMs immediately after use
- Avoid storing secrets in VM images
- Regularly clean up stale VMs:
smolvm cleanup --all
Security in AI Agent Scenarios
Special considerations when running LLM-generated code:Code Sandboxing
Always execute untrusted LLM-generated code in isolated VMs:Using a context manager (
with SmolVM()) ensures the VM is automatically destroyed after execution, preventing data leakage between runs.Preventing Prompt Injection Attacks
LLM-generated code might attempt to exfiltrate data or escalate privileges:Rate Limiting and Resource Quotas
Prevent abuse in agent scenarios:Vulnerability Reporting
If you discover a security vulnerability in SmolVM:Reporting Process
- Use GitHub’s private reporting: https://github.com/CelestoAI/SmolVM/security/advisories/new
-
Include in your report:
- Clear description of the vulnerability and impact
- Affected version/commit and environment (OS, architecture)
- Reproduction steps or proof-of-concept
- Expected vs. actual behavior
- Suggested mitigation if available
-
Response timeline (best effort):
- Acknowledgment within 3 business days
- Triage and severity assessment within 7 business days
- Periodic updates as fixes are developed
Coordinated Disclosure
- Please allow reasonable time for a fix before public disclosure
- Security advisories will be published for confirmed issues
- Reporter credit is provided unless anonymity is requested
Security Scope
This security policy covers:- Vulnerabilities in SmolVM code and release artifacts
- Issues caused by documented SmolVM usage patterns
- Vulnerabilities in third-party dependencies or upstream projects
- Host misconfiguration outside documented setup
- Security findings without realistic exploit path or impact
License and Disclaimer
SmolVM is licensed under Apache License 2.0. All software is provided “AS IS” without warranties.
Next Steps
Performance
Optimize VM performance for your workload
Troubleshooting
Debug issues and resolve errors