Registry / security / bashkit

bashkit

JSON →
library0.9.0pypypi✓ verified 80d ago

A sandboxed bash interpreter for AI agents, providing a safe environment to execute shell commands with resource limits and output capture. Version 0.9.0 requires Python >=3.9. Actively maintained, release cadence is periodic.

pip install bashkit
INSTALL
IMPORT
SIG · BASHKIT
B
bashkit
securitypythonv0.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Bash
from bashkit import Bash
from bashkit import BashSandbox
BashError
from bashkit import BashError
ExecResult
from bashkit import ExecResult

Create a sandbox, run a command, capture output and exit code.

from bashkit import BashSandbox sb = BashSandbox() result = sb.run("echo 'Hello, World!'") print(result.stdout) # Hello, World! print(result.returncode) # 0
Debug
Known issues
breakingSandbox.run() returns a Result object with .stdout and .stderr as strings, not dict. Accessing result['stdout'] fails.
fix
Use result.stdout instead of result['stdout'].
affects: >=0.9.0
gotchaResource limits (CPU time, memory) are enforced per sandbox instance; defaults are restrictive (1 second CPU, 128MB memory). Long-running commands will be killed.
fix
Configure limits on BashSandbox instantiation: BashSandbox(cpu_limit=5, memory_limit=512).
affects: >=0.9.0
deprecatedThe 'output' attribute in Result objects is deprecated in favor of 'stdout' and 'stderr'.
fix
Use result.stdout and result.stderr instead of result.output.
affects: >=0.8.0
Upgrade
Version history
0.9.0latest on PyPI · released Jun 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
20
Resources
bashkit — pip install bashkit · libregistry