Skip to main content

harnesdk

PyPI version

Run major agents and harnesses programmatically, in a sandbox. Openclaw, Claude Code, Hermes agent,...

Installation

pip install harnesdk

Setup

Set the required environment variables:

export ANTHROPIC_API_KEY=your_anthropic_api_key
export E2B_API_KEY=your_e2b_api_key

Usage

Run an agent and get output

import asyncio
from harnesdk.agent import AgentSession

async with AgentSession() as session:
    result = await session.run("Create a hello world HTTP server in Go")
    print(result.output)

Stream output in real time

import asyncio
from harnesdk.agent import AgentSession

async with AgentSession() as session:
    async for chunk in session.stream("Create a hello world HTTP server in Go"):
        print(chunk, end="", flush=True)

Run and serve an app from the sandbox (Jupyter)

from harnesdk.agent import AgentSession
from IPython.display import IFrame

async with AgentSession() as session:
    async for chunk in session.stream(
        "build an 'introducing HarneSDK' html page, and serve it with python http server under port 8000. "
        "Use this pattern nohup your-server-command > /tmp/server.log 2>&1 < /dev/null &"
    ):
        print(chunk)
    page_url = session.sandbox.get_host(8000)
    print(f"app live at {page_url}")
    display(IFrame(f"https://{page_url}", width=700, height=400))

Output:

I'll create an introductory HTML page for HarneSDK and serve it using Python's HTTP server on port 8000.

The server is now running at **http://localhost:8000**

app live at 8000-7zerfgtyjcjpl79a141ez.e2b.app

Generated app:

Development

To set up for local development:

# Clone your fork
git clone git@github.com:your_username/harnesdk.git
cd harnesdk

# Install in editable mode with live updates
uv tool install --editable .

This installs the CLI globally but with live updates - any changes you make to the source code are immediately available when you run harnesdk.

Author

harnesdk was created in 2026 by Alaeddine Abdessalem.

Metadata

Release files for harnesdk 0.2.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 harnesdk 0.2.0
File Size Uploaded Provenance Actions
harnesdk-0.2.0.tar.gz 160.8 kB Without provenance Details for harnesdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for harnesdk 0.2.0
File Interpreter ABI Platform Actions
harnesdk-0.2.0-py3-none-any.whl Python 3 none any Details for harnesdk-0.2.0-py3-none-any.whl

Total release size: 168.9 kB

Release files / harnesdk-0.2.0.tar.gz

Download URL harnesdk-0.2.0.tar.gz
Size 160.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2214436a67ef90d9e22c672affa018668407a91c56b09fa10ba8024013402556
BLAKE2b-256 checksum
How to use checksums
21431b0f0e197e3c4d24f12023df2c7f324cf111f5ead308dce77db541795ca1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / harnesdk-0.2.0-py3-none-any.whl

Download URL harnesdk-0.2.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2664dd0a4e4be242b204981553c7242b22350a45d8cff475081ccfebf370390
BLAKE2b-256 checksum
How to use checksums
36bc612ad79753fc5f6930994742c6a0bef32efdf30f6ea53612213d13f1b991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for harnesdk 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.2.0 This release

2 release files No 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