Files
crewAI/lib
Devin AI e28a564e33 feat: add sandlock as lightweight OS-level sandboxing backend for code execution
Addresses #5150 - adds sandlock (Landlock + seccomp-bpf) as a new execution
backend for CodeInterpreterTool, providing kernel-level process isolation
without requiring Docker.

Changes:
- Add 'execution_backend' parameter to CodeInterpreterTool with options:
  'auto' (default), 'docker', 'sandlock', 'unsafe'
- Add sandbox configuration options: sandbox_fs_read, sandbox_fs_write,
  sandbox_max_memory_mb, sandbox_max_processes, sandbox_timeout
- Add run_code_in_sandlock() method using sandlock's Sandbox/Policy API
- Add _check_sandlock_available() to verify Linux + sandlock installation
- Add _build_sandlock_policy() to construct sandlock Policy from config
- Update run_code_safety() to fall back to sandlock when Docker unavailable
- Update error messages to mention sandlock as an alternative
- Add 'sandlock' optional dependency in pyproject.toml
- Add 18 new tests covering all sandlock integration paths

Co-Authored-By: João <joao@crewai.com>
2026-03-27 22:11:54 +00:00
..
2026-03-27 11:26:04 +08:00
2026-03-27 11:26:04 +08:00