Security fixes are applied to the latest minor release on the main branch.
| Version | Supported |
|---|---|
0.2.x (latest) |
✅ |
< 0.2.0 |
❌ (upgrade to >=0.2.0) |
CodeShield provides application-layer defense-in-depth for executing LLM-generated Python snippets (analytics, data transformation, scripting, and agent tool calls):
- Fail-closed Static AST Gate: blocks syntax errors, overly broad exception handlers, dangerous builtins (
eval,exec,compile,__import__, reflection helpers), aliased or variable-rebound calls, restricted modules (subprocess,ctypes,importlib,pickle,socket,shutil,builtins, etc.), dangerousos/sysAPIs, and reflection dunder attributes (__subclasses__,__builtins__,__globals__, etc.). - Minimal Environment Allowlist: subprocesses never inherit the full host
os.environ(protectingGEMINI_API_KEY, cloud credentials, and database secrets). Extra variables must be passed explicitly viaCodeExecutionRequest(env=...)orSubprocessRunner(env_allowlist=...), while interpreter-hijacking variables (LD_PRELOAD,PYTHONPATH,PYTHONSTARTUP, etc.) are blocked. - Workspace & Path Hardening: child processes execute with
cwdlocked to the ephemeral sandbox directory, temporary directories redirected inside the workspace, strict validation against path traversal in file/venv names, and strict PEP 508 validation on package specifiers (blocking pip flags, VCS URLs, and local paths). - Resource & Process-Tree Guardrails: bounded
stdout/stderrcapture (max_output_bytes) prevents memory exhaustion,stdin=DEVNULLprevents interactive hangs, host workspace paths are redacted fromstderr/tool errors, and timeouts terminate the entire process tree.
Important boundary: Python virtualenvs and static AST inspection are not a substitute for kernel-level OS isolation. If your deployment runs untrusted or adversarial multi-tenant code, run CodeShield inside an OS-level sandbox such as Docker (with
--network=none,--read-only, dropped capabilities, and memory/CPU limits), gVisor, Kata Containers, or Firecracker microVMs.
Please do not open a public GitHub issue for suspected security vulnerabilities.
Instead, report vulnerabilities privately via GitHub Security Advisories:
Include a concise description of the issue, affected version, reproduction steps, and potential impact. We aim to acknowledge reports within 72 hours and coordinate a fix before public disclosure.