hrns
Pydantic AI agents with server-owned conversations, ACP interaction, and read-only AG-UI streams.
hrns builds a Pydantic AI Agent from capabilities and exposes it over ACP,
for terminals and editors.
Install
uvx hrns
Or install with pip install hrns. Both include the terminal client and server.
For a minimal installation, use hrns-slim, adding [client] for the terminal or
[server] for the agent and HTTP entry points. Without extras, it provides the shared
hrns config, profiles, and mcp commands. Python imports and the command remain hrns.
For local development, run just install.
Define the agent
from hrns.server import build_agent
agent = build_agent("anthropic:claude-sonnet-5-5", cwd=".")
The default agent includes coding tools, task tracking, skills, user questions, and approval handling. Compose your own agent with the capabilities reference.
Skills
The agent reads Agent Skills from
<workspace>/.agents/skills and ~/.agents/skills by default. A skill is a directory
with a SKILL.md; the model sees its name and description, and loads the instructions
only when it needs them. A person can list skills with /skills and invoke one with
$name; the terminal sends the id, and the server expands the instructions.
[skills]
paths = ["~/shared/skills"] # libraries read before the defaults
exclude = ["experimental-release-notes"]
build_agent discovers skills by default. Applications can supply Python definitions
with Skills(skills=...); see examples/fastapi_app.py. The full reference, including the
ACP _meta payloads and the security notes, is in docs/skills.md.
Serve agents
from contextlib import asynccontextmanager
from fastapi import FastAPI
from hrns.server import HrnsServer, build_agent
server = HrnsServer()
coder = server.add_agent("coder", factory=lambda session: build_agent("anthropic:claude-sonnet-5-5", cwd=session.cwd))
@asynccontextmanager
async def lifespan(app: FastAPI):
async with server:
yield
app = FastAPI(lifespan=lifespan)
server.mount_acp(app, prefix="/acp")
server.mount_ag_ui(app, prefix="/ag-ui")
Install observation support with pip install 'hrns[ag-ui]'.
Use AcpServer when only ACP is needed. Register multiple factories under different
agent IDs. One ACP client may interact with a session while any number of AG-UI clients
observe it. Execution survives client disconnects.
Inside the server lifecycle, start work directly:
session = await coder.new_session(cwd="/srv/project")
turn = await session.submit("Investigate the deployment failure")
result = await turn.result()
Follow-ups share a FIFO with ACP prompts. Cancellation and failures pause it;
pending_prompts(), resume_queue(), and clear_queue() are Python-only controls.
Permissions/questions wait for an ACP attachment. See agent servers
for configuration, authentication, stores, and model/provider routing, and
AG-UI observation for read-only snapshots and SSE replay.
hrns connect --server ws://127.0.0.1:8000/acp/coder
hrns run --server ws://127.0.0.1:8000/acp/coder "summarize this repo"
Remote hosts require wss://. Pass a bearer token with --token env:NAME or
--token keyring:service/user; admitted clients share the agent's server scope.
The FastAPI example shows both mounts with authentication.
For the packaged single-agent server:
HRNS_MODEL=provider:model hrns serve --port 8000
# ACP endpoint: ws://127.0.0.1:8000/acp/agent
For stdio:
from hrns.server import build_agent, run_acp_stdio
run_acp_stdio(lambda: build_agent("anthropic:claude-sonnet-5-5"))
hrns acp starts the default agent over stdio; hrns agent uses the configured
models and provider routing. The terminal uses the same configured entry point.
Configuration
The client and server read one document: config.toml in the platform
config directory, with an optional hrns.toml in the working directory overriding it
key by key. HRNS_* environment variables override both.
Configuration is the field reference and the location map.
hrns agent launches the ACP entrypoint with the configured provider and model. The
terminal client reuses that entrypoint, so it passes the same document to it.
In the TUI connection picker, l opens provider management. Add or edit a provider
to paste its API key into the password field; the key is stored in the OS keyring. After saving a provider without an active model, the model
picker opens so a catalog or custom id can be selected. /model provider:model also
sets it directly.
/providers acts on whatever you are connected to. Over stdio to hrns agent it opens
the entry editor above; connected to a remote agent that advertises provider
configuration it lists that agent's providers and sends providers/set /
providers/disable for you.
hrns agent seeds its ACP provider registry from those TOML entries, so a client that
speaks providers/* sees one provider per entry and can reroute it to its own gateway.
The entry this deployment starts with is marked required, because disabling it would
leave the default session without a model; the headers a client sends reach the request
as extra_headers model settings.
Runtime behavior
- Run one worker per server. Sessions, queues, pending interactions, and observation live in the process. Durable session stores restore committed state after restart.
- Provider routing changes apply on the next turn. A running turn keeps its selected endpoint; session setting changes apply before its next model request.
- MCP exports require client consent at session start. Headless clients export servers
configured with
always_allow = true. The/mcppanel shows startup and authentication failures. See MCP over ACP for the request scope and upstream behavior. - Tool approvals are enabled by default. Reads run freely; file writes and shell calls
request permission through ACP.
approval=Falsedelegates approval to the deployment.
Metadata
Release files for hrns 0.0.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hrns-0.0.23.tar.gz | 4.7 kB | With provenance | Details for hrns-0.0.23.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hrns-0.0.23-py3-none-any.whl | Python 3 | none | any | Details for hrns-0.0.23-py3-none-any.whl |
Total release size: 9.4 kB
Release files / hrns-0.0.23.tar.gz
| Download URL | hrns-0.0.23.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adc88e542d3713b0ba539654c273e4e5d880b11d3da717434d15b67949ef6747
|
|
BLAKE2b-256 checksum How to use checksums |
6770926be8506f0926852704356d9df92bb78d3011a2804777aba83d0a3df8c9
|
| 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 10, 2026.
Transparency logRelease files / hrns-0.0.23-py3-none-any.whl
| Download URL | hrns-0.0.23-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa7320c452fe71d5787442076694cfd1be123e14fcb925ef62481621a6821bf5
|
|
BLAKE2b-256 checksum How to use checksums |
8d4adb96c4ec99b5d2d3add7e78caa9af406e650f0fffbed6fe3db9cca5f6ac2
|
| 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 10, 2026.
Transparency logSecurity for hrns 0.0.23
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
Both files in this release have been uploaded with provenance metadata.
Attestation for hrns-0.0.23.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 10, 2026.
Transparency logA 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.