A warrant daemon for agent actions — earned autonomy with an audit trail.
Project description
warrantd
A warrant daemon for agent actions — earned autonomy with an audit trail.
warrantd answers one question for an agent that wants to take an action:
ALLOW, REQUIRE_APPROVAL, or BLOCK? — and governs how an action class earns
more autonomy over time. It is a standalone, framework-agnostic trust primitive:
it knows nothing about Slack, Stripe, OpenAI, Anthropic, FastAPI, or any
transport/provider/store. Your app supplies those by implementing three small
protocols.
See warrantd-spec.md for the authoritative design.
Install
uv add warrantd # or: pip install warrantd
Define a policy
from decimal import Decimal
from warrantd import (
ActionClass, AutonomyState, GraduationThresholds, RiskTier, TrustPolicy,
)
policy = TrustPolicy(
actions={
"read_ledger": ActionClass(name="read_ledger", risk=RiskTier.READ),
"issue_refund": ActionClass(
name="issue_refund",
risk=RiskTier.REVERSIBLE_WRITE,
auto_cap=Decimal("100"), # auto-approve at/below this
hard_cap=Decimal("1000"), # never auto-approve above this
),
},
thresholds=GraduationThresholds(
pass_rate={AutonomyState.SUPERVISED: 0.80, AutonomyState.AUTONOMOUS: 0.95},
adversarial_pass_rate={AutonomyState.SUPERVISED: 0.70, AutonomyState.AUTONOMOUS: 0.90},
min_samples={AutonomyState.SUPERVISED: 50, AutonomyState.AUTONOMOUS: 200},
),
)
Gate an action
Implement MetricsProvider and AuditSink (and optionally ApprovalGate),
then call evaluate() before every tool execution and record() after:
from warrantd import ActionRequest, TrustLayer, Verdict
trust = TrustLayer(policy=policy, metrics=my_metrics, audit=my_audit)
decision = trust.evaluate(ActionRequest("issue_refund", tenant_id="acme", value=Decimal("250")))
if decision.verdict is Verdict.ALLOW:
... # execute
elif decision.verdict is Verdict.REQUIRE_APPROVAL:
... # route to your ApprovalGate
else:
... # BLOCK
A runnable end-to-end example with in-memory stubs lives in
examples/quickstart.py.
How autonomy is earned
Each action class advances MANUAL → SUPERVISED → AUTONOMOUS only when its eval
metrics clear the thresholds for the target state, subject to a per-class policy
ceiling (max_state) and a risk ceiling for CONSEQUENTIAL actions. The
graduation function is pure and deterministic — no LLM, no randomness — so the
same metrics always yield the same allowed state.
Documentation
A comprehensive, self-contained reference lives at
docs/warrantd-notebooklm.md. It explains the
concepts, the graduation model, the decision flow, the full API, worked
examples, a glossary, and an FAQ in prose form — written to be dropped into
NotebookLM (or any RAG system) as a single knowledge source.
Development
uv sync --all-extras --dev
uv run ruff check .
uv run mypy --strict warrantd
uv run pytest --cov=warrantd
Releasing
Releases publish to PyPI via OIDC trusted publishing — no API tokens are
stored. One-time setup: register the warrantd trusted publisher on PyPI
(repo moritzkazooba-wq/warrantd, workflow release.yml, environment pypi).
Then:
- Bump the version in
pyproject.tomlandwarrantd/__init__.py, updateCHANGELOG.md, and tag (vX.Y.Z). - (Optional) Run the release workflow manually with target
testpypito rehearse the upload. - Cut a GitHub Release — the workflow builds, runs
twine check, and publishes to PyPI.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file warrantd-0.1.0.tar.gz.
File metadata
- Download URL: warrantd-0.1.0.tar.gz
- Upload date:
- Size: 72.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4a336066e25c433359bf0f7a0568b9f40f253fde0f2042a769f460a2b882ed3
|
|
| MD5 |
1876cabd6bfec249fc9654099aa72c9a
|
|
| BLAKE2b-256 |
f78d27599150eb20ddf9df741f7c02347fa303a2b5ad181b7cc74b4eb1fb0781
|
Provenance
The following attestation bundles were made for warrantd-0.1.0.tar.gz:
Publisher:
release.yml on moritzkazooba-wq/warrantd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
warrantd-0.1.0.tar.gz -
Subject digest:
b4a336066e25c433359bf0f7a0568b9f40f253fde0f2042a769f460a2b882ed3 - Sigstore transparency entry: 1774005987
- Sigstore integration time:
-
Permalink:
moritzkazooba-wq/warrantd@bfbe873ca22aec61c3c8bced11b60c6920295b3b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/moritzkazooba-wq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bfbe873ca22aec61c3c8bced11b60c6920295b3b -
Trigger Event:
release
-
Statement type:
File details
Details for the file warrantd-0.1.0-py3-none-any.whl.
File metadata
- Download URL: warrantd-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c755c09978a1269459c62beac97c9c57075b85bb912659184d32d612b1784a0
|
|
| MD5 |
27bcffdffda50d847c9de320e64fdc9e
|
|
| BLAKE2b-256 |
1b57e8a31d1f74f5e426cbbc1ebe7f26be154340fe2e45c3f6669a3a2b30d2d2
|
Provenance
The following attestation bundles were made for warrantd-0.1.0-py3-none-any.whl:
Publisher:
release.yml on moritzkazooba-wq/warrantd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
warrantd-0.1.0-py3-none-any.whl -
Subject digest:
5c755c09978a1269459c62beac97c9c57075b85bb912659184d32d612b1784a0 - Sigstore transparency entry: 1774006117
- Sigstore integration time:
-
Permalink:
moritzkazooba-wq/warrantd@bfbe873ca22aec61c3c8bced11b60c6920295b3b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/moritzkazooba-wq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bfbe873ca22aec61c3c8bced11b60c6920295b3b -
Trigger Event:
release
-
Statement type: