Skip to main content

agentd

Run agents behind the OpenAI client API, sandboxed.

  • PTC: the model writes bash/python fences instead of JSON tool calls; MCP servers and @tool functions show up as skills.
  • Harnesses: run Claude Code, Codex, OpenCode or omp through the same API and switch between them mid-conversation.
  • Sandboxes: all agent code runs in a libkrun microVM or a Docker container, with no network and no credentials.
  • Egress: optional network access through a host proxy that injects fnox secrets, so the sandbox never holds them.
  • agentd serve: sessions, background turns and schedules as an API, reachable from other boxes over p2claw.

Install

uv add agentd

Then set up a sandbox:

# macOS (Apple Silicon)
brew tap slp/krun
brew trust --formula slp/krun/libkrun slp/krun/libkrunfw slp/krun/virglrenderer-krun
brew install slp/krun/libkrun
python -m agentd.sandbox.rootfs build agents    # base image (needs Docker)

# Linux (KVM)
agentd-sandbox linux setup

# macOS via Colima (M3+, macOS 15+)
agentd-sandbox colima setup

# or Docker
python -m agentd.sandbox.rootfs build agents

Wheels for macOS arm64 and Linux x86_64/aarch64 include the launcher, agentd-net and (for Linux and Colima) libkrun, so nothing gets compiled. From a checkout, run agentd/sandbox/build.sh first.

agentd-sandbox status shows what's ready. Details, custom images and mounts: docs/sandboxes.md.

PTC

from agentd import patch_openai_with_ptc, display_events, tool
from openai import OpenAI

@tool
def calculate(expression: str) -> str:
    """Evaluate a math expression."""
    return str(eval(expression, {"__builtins__": {}}))

client = patch_openai_with_ptc(OpenAI(), cwd="./workspace")
stream = client.responses.create(model="claude-sonnet-5", input="List files, then calculate 12*12", stream=True)

for event in display_events(stream):
    if event.type == "text_delta":
        print(event.text, end="")
    elif event.type == "code_execution":
        print(f"\n$ {event.code}\n{event.output}")

More: docs/ptc.md.

Harnesses

client = patch_openai_with_ptc(OpenAI(), cwd="./workspace", harness="claude-code")
r = client.responses.create(model="claude-sonnet-5", input="Add a test for utils.py and run it")
r = client.responses.create(input="Review that test", previous_response_id=r.id, harness="codex")

harness= is "ptc" (default), "claude-code", "codex", "opencode" or "omp". Each runs the real CLI inside the sandbox; credentials stay on the host behind a proxy. agentd.available(client) says which harnesses are ready and what models they have. Resume, transcripts, custom model servers: docs/harnesses.md.

Network and secrets

from agentd import KrunExecutor
from agentd.egress import Egress
from agentd.egress.approvals import Approvals

executor = KrunExecutor(egress=Egress(
    allow=["pypi.org", "files.pythonhosted.org"],
    approvals=Approvals(webhook="https://approver.example/hook"),
))

Sandboxes get placeholders; the proxy swaps in real values from fnox only for the hosts, methods and paths its rules allow. Anything else is refused or sent to your approval webhook. libkrun only. docs/egress-and-secrets.md.

agentd serve

agentd serve

Serves sessions over Unix sockets: turns, background runs, schedules, transcripts. Other boxes reach it over p2claw, and agentd.remote.Fleet drives them. docs/agentd-serve.md.

Plain tool calling

patch_openai_with_mcp(OpenAI()) runs MCP tool calls in a regular tool_calls loop with any LiteLLM provider, and uvx agentd config.yaml runs YAML-configured agents that react to MCP resource changes. docs/tool-calling.md.

Coming from 0.8: docs/upgrading-0.9.md.

License

MIT

Metadata

Release files for agentd 0.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentd 0.14.0
File Size Uploaded Provenance Actions
agentd-0.14.0.tar.gz 5.1 MB With provenance Details for agentd-0.14.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for agentd 0.14.0
File Actions
agentd-0.14.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for agentd-0.14.0-py3-none-manylinux_2_28_x86_64.whl
agentd-0.14.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for agentd-0.14.0-py3-none-manylinux_2_28_aarch64.whl
agentd-0.14.0-py3-none-macosx_15_0_arm64.whl Python 3 none macOS 15.0+ ARM64 Details for agentd-0.14.0-py3-none-macosx_15_0_arm64.whl
agentd-0.14.0-py3-none-any.whl Python 3 none any Details for agentd-0.14.0-py3-none-any.whl

Total release size: 13.0 MB

Release files / agentd-0.14.0.tar.gz

Download URL agentd-0.14.0.tar.gz
Size 5.1 MB
Tags Source
SHA-256 checksum
How to use checksums
4610bd16ee0c74436c8e9137238653b2770df82f32946a59db5e13d37cce2dca
BLAKE2b-256 checksum
How to use checksums
e0f9c5439671444d5756bff1e70aeea2825b0ffb8dfb18ee635574860a578073
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / agentd-0.14.0-py3-none-manylinux_2_28_x86_64.whl

Download URL agentd-0.14.0-py3-none-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
14bf255074f261ff40a84a103e7da4130712077bf1a34fc36cb503b85e442493
BLAKE2b-256 checksum
How to use checksums
973ab3c68670648c8463c5e9df6082a5493d9f00fed1d07709f83e4d9175f6a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / agentd-0.14.0-py3-none-manylinux_2_28_aarch64.whl

Download URL agentd-0.14.0-py3-none-manylinux_2_28_aarch64.whl
Size 2.2 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
967af3d2fda6ba2512fac07e8da32d2e91f4ce76b7fdbd310051a19efb896cfc
BLAKE2b-256 checksum
How to use checksums
a624d598a6003a59a7c2b737bf421db73311874bb752257604cc376d2ddae0bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / agentd-0.14.0-py3-none-macosx_15_0_arm64.whl

Download URL agentd-0.14.0-py3-none-macosx_15_0_arm64.whl
Size 2.6 MB
Tags Python 3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
635cb78b5ecceb537f14a368d54322814ab4968be8e099330f6029ec39143736
BLAKE2b-256 checksum
How to use checksums
8aa5e3fa41cd188370755eea2eccd5fcb47eb2c630d0f32ec93f6501139e0802
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / agentd-0.14.0-py3-none-any.whl

Download URL agentd-0.14.0-py3-none-any.whl
Size 415.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1358b723d6757a2bb49a24ac88a5097c4ba25656c706bcca45ba6ea81a2fafe8
BLAKE2b-256 checksum
How to use checksums
13dbaae28acdda25ce49021846bd28cfa85cd9d92a09350240ca290fa86eca2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for agentd 0.14.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for agentd-0.14.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.14.0 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page