Harnessed
A Python agent SDK built from reversible plugins. Harnessed owns the loop, tool policies and append-only session log; optional provider integrations use PydanticAI's Direct API. Python 3.12-3.14, Pydantic v2 and modern generics.
Harnessed 0.x is alpha software. APIs and persisted session formats may change in minor releases before 1.0. See the release notes and compatibility policy.
Core SDK
uv add "harnessed[openai]"
import asyncio
from harnessed import Agent, Plugin, tool
class Calculator(Plugin):
@tool(readonly=True)
async def add(self, a: int, b: int) -> int:
"""Add two integers."""
return a + b
agent = Agent(
model="deepseek:deepseek-chat", # DEEPSEEK_API_KEY
instructions="Keep answers concise.",
plugins=[Calculator()],
)
async def main():
async with agent.session() as session:
result = await session.run("What is 19 + 23?")
print(result.text)
asyncio.run(main())
Agent has three configuration inputs: model, instructions, and plugins.
It is reusable; each session owns its runtime and plugin lifetimes.
- Composition: tools, policies and capabilities are plugins. Slots replace
defaults, and
agent.pluginsshows the resolved composition. - Ownership: removing a plugin removes its registrations and effects.
Class
Inject[T]dependencies suspend and rebuild mounts as services change;provides=Truepublishes the mounted plugin as a service. - Context: instructions and plugin guidance are fixed per session; named context values and steering supply changes during a run.
- History: immutable events are the source of truth. Persistence, replay, forks and control outcomes use the same append-only log.
Test without credentials
from harnessed.testing import ScriptedModel, assert_tool_called, call, reply
model = ScriptedModel([call(Calculator.add, a=19, b=23), reply("42")])
agent = Agent(model=model, plugins=[Calculator()])
# Inside an async function:
# result = await agent.run("Add 19 and 23")
# assert_tool_called(result, "add", a=19, b=23)
Read by topic
Start with the documentation index or the SDK reference.
- Models and provider settings
- Tools, hooks and cancellation
- Plugin composition and lifecycle
- Instructions and changing context
- Sessions, controls, persistence and forks
- Typed events and custom extensions
- Approvals and headless operation
- Offline testing
- Executable examples
- Development and CI
- Changelog and breaking changes
The standalone harnessed.kernel uses only the standard library. Optional
features live under harnessed.plugins; providers live under harnessed.models.
Inspired by DeepSeek Harness and Cordis.
Released under the MIT License.
Metadata
Release files for harnessed 0.2.0
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 |
|---|---|---|---|---|
| harnessed-0.2.0.tar.gz | 137.0 kB | With provenance | Details for harnessed-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| harnessed-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for harnessed-0.2.0-py3-none-any.whl |
Total release size: 303.0 kB
Release files / harnessed-0.2.0.tar.gz
| Download URL | harnessed-0.2.0.tar.gz |
|---|---|
| Size | 137.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
400d514406480c26e685ec14c9a0d794e3f62d0a8d7f0213416855d74b4f88ab
|
|
BLAKE2b-256 checksum How to use checksums |
da1b4f7692feb1b1159dd4111950506f99a8b1554d7d21863aaed44368fd1ee3
|
| 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 29, 2026.
Transparency logRelease files / harnessed-0.2.0-py3-none-any.whl
| Download URL | harnessed-0.2.0-py3-none-any.whl |
|---|---|
| Size | 166.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da852808f83e654c49b0e7d3d573f537fea68ab49a7183a6e740b1034db5109c
|
|
BLAKE2b-256 checksum How to use checksums |
52360b0fbe55478887503e17c6d2aa5e027f183f2069630fc111bf6c511dc330
|
| 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 29, 2026.
Transparency logSecurity for harnessed 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for harnessed-0.2.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 Oct 29, 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.