Skip to main content

Benchmark results

Three runs per hrns on a benchmark task using GPT-6-Luna with medium reasoning.

hrns Tests pass All quality gates pass Model responses Tool calls Total cost Average/run
Codex 3/3 3/3 44 56 $0.03658 $0.01219
OpenCode 3/3 2/3 43 47 $0.03578 $0.01193
hrns 3/3 3/3 44 59 $0.03300 $0.01100

All runs pass 130/130 tests. Quality gates cover Ruff lint, Ruff formatting, and Pyrefly type checking.

Counts and costs are totals across three runs. Model responses include tool-only responses and final answers. Tool calls count underlying attempts, including failures; Codex's 41 orchestration calls contain 56 underlying attempts. Costs are cache-aware API equivalents in USD using common Standard model pricing.

Skill loads: Codex 0/3, OpenCode 1/3, hrns 3/3. The loaded skill is incremental-implementation, with relevant selection and partial adherence.


hrns

Define an agent once. Run it in Python, open it in a terminal, or host it remotely.

hrns combines native Pydantic AI capabilities with policy-controlled sessions, an independent ACP terminal, and authenticated remote hosting. Agent behavior stays in ordinary Python; the terminal can also connect to standard ACP agents that do not use this runtime.

Start developing

Requires Python 3.11+, macOS or Linux, uv, and just.

just install
just check

The checked-in lockfile pins the tested upstream versions. just install also installs the prek Git hook, which runs just check before each commit without applying automatic fixes. To install the hook after a manual dependency sync, run uv run prek install.

Use a local agent with your model

The local developer agent is the default connection mode. Install the provider extra and set the API key for the provider you use:

uv sync --locked --extra client --extra runtime --extra openai
export DEEPSEEK_API_KEY='your-key'
uv run hrns

Press l to configure a provider and model, type /models in a session, or create hrns.local.toml in the project:

provider = "deepseek"
model = "deepseek-chat"
api_key_env = "DEEPSEEK_API_KEY"

uv run hrns starts a session in the current directory using that model. The bundled hrns.coder capability gives it file tools, content search, and a shell in that directory: reads are automatic, while writes, edits, and commands ask for approval first. hrns.ask_user lets the model ask structured multiple-choice questions in the terminal; disable it with [capabilities] ask_user = false for headless runs. hrns.todo gives the model a session-scoped plan and shows it in the Todos tab of the right drawer. Configuration uses pydantic-settings. See local setup for OpenAI-compatible endpoints, local inference, other Pydantic AI providers, and headless execution.

Useful slash commands include /connect (switch or add a target), /models (configure or select the local model), /effort (change reasoning effort live), /plugins (toggle, configure, or add plugins), /mcp (list MCP servers and their tools), /skills (browse Agent Skills), and /todo (open the session's plan). Typing / shows an inline filtered list. Type $ in the composer to find a skill and insert a $skill-name reference, which runs that skill for the message. The older /model and /capabilities names remain aliases.

Any independent ACP agent can still be launched explicitly:

uv run hrns connect --stdio -- /path/to/agent --acp

See client usage for headless execution, profiles, approvals and the bridge.

Serve agents in your FastAPI app

from fastapi import FastAPI
from hrns.runtime import SQLiteSessionStore
from hrns.server import AgentServer

app = FastAPI()
agents = AgentServer(store=SQLiteSessionStore("./sessions.sqlite3"))
agents.add_agent(definition)
agents.mount(app)

add_agent binds and validates the definition's resource requirements at registration; pass resources=, or a definition.bind(...) result, when a capability needs host values. Install the server extra, register your AgentDefinition objects, and run the app with Uvicorn. Connect using hrns connect --url http://127.0.0.1:8080 --agent AGENT_ID. PostgreSQL and optional FastAPI authentication dependencies use the same API. See server embedding and the runnable example.

Layout

hrns is one distribution with optional extras. Protocol and local settings ship by default; the runtime, terminal, and server dependencies are opt-in.

Module Extra Purpose
hrns.protocol base Versioned extension schemas and transport contracts
hrns.config base Shared local settings using pydantic-settings
hrns.runtime runtime Native agent definitions, plugin management, sessions, hrns-host and hrns-local
hrns.client client Textual terminal, scripted ACP runner and stdio bridge
hrns.server server FastAPI agent registration and in-process WebSocket ACP

Install only what you need, for example pip install 'hrns[client]', pip install 'hrns[openai]', or pip install 'hrns[all]'.

The hrns.client module does not import Pydantic AI or installed agent plugins, and installing hrns[client] alone does not install the runtime. Local stdio agents run in a separate process. Network agents run inside an existing FastAPI application through AgentServer, sharing an explicit SQLite or PostgreSQL store.

Design essentials

  • Upstream ACP execution: PydanticAIACPAgent owns prompts, streaming, approvals, cancellation, history, and transcript replay.
  • Native composition: managed bindings contribute their complete Pydantic AI behavior—tools, instructions, hooks and settings—and are selected when a session is composed.
  • Live model and effort: both use standard ACP configuration options and apply from the next request.
  • Host-owned state: sessions pin their principal/deployment scope, retain history and metadata, and never silently retry an uncertain prompt.
  • Explicit resources: workspace and provider bindings belong to the host. A local workspace is a path, not a sandbox.
  • Standard ACP first: generic streaming content, tools and approvals work without project-specific extensions.

Checks and distribution builds

just check
just lint
just build
just fix

just check runs the checks and builds the package. just lint runs formatting, lint, and type checks; just build builds the package. just fix applies automatic formatting and lint fixes. CI exercises the same non-mutating checks on macOS/Linux and Python 3.11–3.13. A wheel and source distribution are written to dist/; optional dependencies are declared as extras.

External provider, sandbox and durability integrations need their upstream extras and credentials. See the coverage matrix for managed, locally verified and deployment-only distinctions.

Releasing

The version comes from the git tag via hatch-vcs, so there is no version string to edit. Publishing runs on release: create a GitHub release and .github/workflows/publish.yml builds the distribution, runs just check, verifies the tag, and uploads to PyPI.

git tag 0.1.0
git push origin 0.1.0
gh release create 0.1.0 --generate-notes

The tag must match the version hatch-vcs derives, so 0.1.0 publishes 0.1.0. A mismatched tag fails the build instead of uploading an unintended version, and a version that already exists on PyPI is rejected.

Uploads use PyPI Trusted Publishing, so no API token is stored in the repository. Before the first release, configure a publisher on PyPI for the hrns project with this repository's owner and name, workflow publish.yml, and environment pypi. Because hrns does not exist on PyPI yet, use the pending publisher form.

License

MIT. See LICENSE.

Metadata

Release files for hrns 0.0.1

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

Source distribution (sdist)

Source distribution for hrns 0.0.1
File Size Uploaded Provenance Actions
hrns-0.0.1.tar.gz 273.2 kB With provenance Details for hrns-0.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 622.3 kB

Release files / hrns-0.0.1.tar.gz

Download URL hrns-0.0.1.tar.gz
Size 273.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c797b779de4b1bd403569a7c35c0a0217de2f2e899e626008ed5a2d5c5d03809
BLAKE2b-256 checksum
How to use checksums
dd5d370f118c1a74cb4e0f4c7bb32fe0af49e0108b341daff70e9009cb681f43
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 Oct 26, 2026.

Transparency log

Release files / hrns-0.0.1-py3-none-any.whl

Download URL hrns-0.0.1-py3-none-any.whl
Size 349.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4683855dbfdd3238b16b8dcaa08ea19d5518329552c025000a8e6f8c0f8e6510
BLAKE2b-256 checksum
How to use checksums
40a0789e973d59b2eabcf1768c7d4340459e6db819fa05aa7d3889e8a2f88a18
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 Oct 26, 2026.

Transparency log

Security for hrns 0.0.1

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hrns-0.0.1.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 Oct 26, 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.

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