Skip to main content

A secure, self-hosted runtime for isolated AI agent execution

Project description

AgentNest

AgentNest

The open-source runtime for secure AI agent execution.

CI Python License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentnest-0.2.0.tar.gz (179.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentnest-0.2.0-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

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

Hashes for agentnest-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4cc0f2d1b36cab0f5f2c9595b7c919b7ace8a15432e2b866b48da1306d39390e
MD5 ddc1ddf65995063647af80918ddf63ce
BLAKE2b-256 e9b372a2181685c89148e495250f79b228493f1dafaac985ba9764abad6fe1e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentnest-0.2.0.tar.gz:

Publisher: release.yml on mihirahuja1/agentnestOSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for agentnest-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13cd8d82b17d2f083c2425f24be0f41a10ff94fabc835ed6d66eadf1dcfed9fb
MD5 bc2bd020b1ffb5f1b6ba999b00255975
BLAKE2b-256 10a765efd853e033007a8d326a6417ba87da2fe4b0e447d388e0ca580df34fd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentnest-0.2.0-py3-none-any.whl:

Publisher: release.yml on mihirahuja1/agentnestOSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page