A secure, self-hosted runtime for isolated AI agent execution
Project description
AgentNest
The open-source runtime for secure AI agent execution.
AgentNest gives AI agents disposable, policy-controlled environments for Python, shell commands, files, packages, browsers, GPUs, and Git work. It is self-hosted, Python-first, and deliberately not another cloud or cluster orchestrator.
from agentnest import Sandbox
with Sandbox("python:3.12-slim", timeout=60) as sandbox:
sandbox.write_file("main.py", "print('Hello from isolation')")
result = sandbox.exec_shell("python main.py")
print(result.stdout)
Why AgentNest
- Secure defaults: non-root, read-only root, no capabilities, denied networking, limits, cleanup
- Backend-independent: Docker, gVisor, Kata, Kubernetes, remote workers, Firecracker transport
- Agent-native: async, streaming, secrets, approvals, audit events, snapshots, pools, artifacts
- Self-hosted: one Docker installation locally; your own nodes and policies in production
- Extensible: third-party runtime plugins through standard Python entry points
[!WARNING] Containers share the host kernel. Choose an isolation boundary appropriate for your threat model. Read the security model before running hostile multi-tenant workloads.
Install
pip install agentnest
agentnest doctor
Optional extras:
pip install 'agentnest[kubernetes]'
pip install 'agentnest[server]'
pip install 'agentnest[mcp]'
pip install 'agentnest[all]'
Capabilities
from agentnest import NetworkPolicy, Sandbox, Secret, SecurityPolicy
policy = SecurityPolicy(
network=NetworkPolicy.denied(),
max_output_bytes=2_000_000,
require_image_digest=True,
)
with Sandbox(
"python@sha256:<digest>",
security_policy=policy,
environment={"TOKEN": Secret("redacted-in-output")},
memory="512m",
cpus=1.0,
) as sandbox:
for event in sandbox.stream_shell("python main.py"):
print(event.data, end="")
checkpoint = sandbox.snapshot("workspace.tar")
for artifact in sandbox.artifacts("output/**/*"):
print(artifact.path, artifact.sha256)
Also included: AsyncSandbox, deterministic Template builds, bounded SandboxPool, Git workspace
helpers, browser/GPU presets, MCP tools, YAML profiles, a CLI, and an authenticated remote API.
Architecture
flowchart LR
App["Agent application"] --> API["Sandbox API"]
API --> Guard["Policy · approvals · events"]
Guard --> Contract["RuntimeBackend"]
Contract --> Docker["Docker / gVisor / Kata"]
Contract --> K8s["Kubernetes"]
Contract --> Remote["Remote / Firecracker"]
Contract --> Plugins["Third-party plugins"]
Read the quickstart, architecture, deployment guide, and complete documentation.
Development
pip install -e '.[dev,docs]'
ruff check .
ruff format --check .
mypy agentnest
pytest --cov=agentnest --cov-report=term-missing
mkdocs build --strict
Docker integration tests are opt-in:
AGENTNEST_DOCKER_TESTS=1 pytest -m integration
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentnest-0.2.0.tar.gz.
File metadata
- Download URL: agentnest-0.2.0.tar.gz
- Upload date:
- Size: 179.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cc0f2d1b36cab0f5f2c9595b7c919b7ace8a15432e2b866b48da1306d39390e
|
|
| MD5 |
ddc1ddf65995063647af80918ddf63ce
|
|
| BLAKE2b-256 |
e9b372a2181685c89148e495250f79b228493f1dafaac985ba9764abad6fe1e5
|
Provenance
The following attestation bundles were made for agentnest-0.2.0.tar.gz:
Publisher:
release.yml on mihirahuja1/agentnestOSS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentnest-0.2.0.tar.gz -
Subject digest:
4cc0f2d1b36cab0f5f2c9595b7c919b7ace8a15432e2b866b48da1306d39390e - Sigstore transparency entry: 2192305373
- Sigstore integration time:
-
Permalink:
mihirahuja1/agentnestOSS@ae6a53625997ac460b310b04aeccb43319a421c5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mihirahuja1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ae6a53625997ac460b310b04aeccb43319a421c5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentnest-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agentnest-0.2.0-py3-none-any.whl
- Upload date:
- Size: 43.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13cd8d82b17d2f083c2425f24be0f41a10ff94fabc835ed6d66eadf1dcfed9fb
|
|
| MD5 |
bc2bd020b1ffb5f1b6ba999b00255975
|
|
| BLAKE2b-256 |
10a765efd853e033007a8d326a6417ba87da2fe4b0e447d388e0ca580df34fd4
|
Provenance
The following attestation bundles were made for agentnest-0.2.0-py3-none-any.whl:
Publisher:
release.yml on mihirahuja1/agentnestOSS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentnest-0.2.0-py3-none-any.whl -
Subject digest:
13cd8d82b17d2f083c2425f24be0f41a10ff94fabc835ed6d66eadf1dcfed9fb - Sigstore transparency entry: 2192305445
- Sigstore integration time:
-
Permalink:
mihirahuja1/agentnestOSS@ae6a53625997ac460b310b04aeccb43319a421c5 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mihirahuja1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ae6a53625997ac460b310b04aeccb43319a421c5 -
Trigger Event:
push
-
Statement type: