Skip to content
Back to skills

Sandbox And Security

ASecurity

"Guides PandasAI sandboxed code execution, the abstract Sandbox

  • 247 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 8, 2026
toolspythonrustgobashsqldockersecurity

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill sandbox-and-security --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sandbox And Security?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sandbox And Security
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-sandbox-and-security/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-sandbox-and-security)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sandbox-and-security
description: "Guides PandasAI sandboxed code execution, the abstract Sandbox
  contract, Docker sandbox setup, and security troubleshooting for generated
  code."
disable-model-invocation: true
metadata:
  disco-role: operating
license: NOASSERTION
---

# Sandbox and Security

Use this sub-skill when a task asks how to isolate PandasAI-generated code,
whether to use the Docker sandbox, or how the abstract `Sandbox` contract
behaves.

PandasAI executes LLM-generated Python locally by default. If the app is public,
untrusted, or handling sensitive data, the user should consider a sandbox before
running generated code.

## Fast route

1. If the user needs only a conceptual decision, explain that sandboxing is
   optional but recommended for untrusted prompts or production exposure.
2. If the user needs a concrete runtime, prefer the Docker sandbox extension
   when Docker is available.
3. If Docker is unavailable or the user needs a custom runtime, implement a
   subclass of the abstract `Sandbox` interface and verify it with the bundled
   smoke script.
4. Once sandbox choice is settled, return to the conversational-analysis
   sub-skill for the chat workflow itself.

## Read next

- [`references/sandbox-workflows.md`](references/sandbox-workflows.md) for
  `Sandbox` contract details, Docker lifecycle, and execution patterns.
- [`references/security-model.md`](references/security-model.md) for security
  posture, code-execution expectations, and SQL-safety notes.
- [`references/troubleshooting.md`](references/troubleshooting.md) for missing
  Docker, missing package, subclass, or code-execution problems.
- [`scripts/sandbox_contract_smoke.py`](scripts/sandbox_contract_smoke.py) for a
  no-Docker contract smoke.

## Boundaries

- Route chat/response generation to
  [`../conversational-analysis/SKILL.md`](../conversational-analysis/SKILL.md).
- Route CLI login and dataset creation to
  [`../cli-and-project-ops/SKILL.md`](../cli-and-project-ops/SKILL.md).
- Do not assume Docker or the `pandasai-docker` package is present unless the
  user explicitly asks for the Docker sandbox.

## Safe validation

```bash
python sub-skills/sandbox-and-security/scripts/sandbox_contract_smoke.py
```

The helper uses a tiny in-memory subclass of `Sandbox`. It checks `start`,
`stop`, `execute`, SQL query extraction, and syntax compilation without Docker.

## Common gotchas

- `Sandbox.start`, `stop`, `_exec_code`, and `transfer_file` are abstract on the
  base class.
- `execute` auto-starts a sandbox the first time it is called.
- Generated code can still be unsafe if it runs outside a sandbox.
- SQL queries extracted from code are heuristics; dynamic query construction may
  not be fully visible to the extractor.
- The package's SQL sanitizer and code validator are separate protections; do
  not assume one replaces the other.

Files in this skill

  • SKILL.md2.8 KB
  • references/sandbox-workflows.md2.6 KB
  • references/security-model.md2.1 KB
  • references/troubleshooting.md2.3 KB
  • scripts/sandbox_contract_smoke.py3.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.