| name | python-executor |
| description | Execute Python snippets or Python files through a normalized skill entrypoint with explicit cwd, timeout, and argv. Use when tasks require ad-hoc Python execution and you want skill-based execution instead of built-in PythonTools. |
Python Executor
Run Python code with one deterministic script:
Use this skill when the model needs to run a Python snippet or script file.
Quick Start
Inline code:
.venv/bin/python skills/python-executor/scripts/run_python.py \
--code "import platform; print(platform.python_version())" \
--cwd . \
--timeout 600
From a file:
.venv/bin/python skills/python-executor/scripts/run_python.py \
--code-file scripts/task.py \
--arg input.json \
--arg output.json \
--cwd . \
--timeout 600
Script Contract
- Exactly one of:
--code "..." for inline snippets
--code-file PATH for existing files
- Optional:
--arg VALUE repeated to pass sys.argv[1:]
--cwd working directory (default .)
--timeout seconds (default 600)
--python interpreter path (default current interpreter)
Exit code is propagated from the Python process.
Usage Rules
- For long snippets, prefer
--code-file.
- Set
--cwd explicitly to avoid path confusion.
- Pass all needed arguments via repeated
--arg.
Security Sandbox (--base-dir)
Pass --base-dir <DIR> to restrict --cwd and --code-file to the given directory:
.venv/bin/python skills/python-executor/scripts/run_python.py \
--base-dir /workspace \
--code-file /workspace/scripts/task.py --cwd /workspace
.venv/bin/python skills/python-executor/scripts/run_python.py \
--base-dir /workspace \
--code-file /etc/exploit.py --cwd /workspace
- Inline
--code is not restricted (matches Agno PythonTools behaviour).
- When
--base-dir is omitted, behaviour is unchanged (no restriction).