algovoi-keystone-agent
The agentic behaviour layer for Keystone: make an agent govern itself. Declare rules,
triggers and behaviours as small specs, deploy them in an Engine, and gate any
keystone-connect write. Every firing produces a content-addressed behaviour_ref, so the agent's
own governance decisions are verifiable Keystone records, recomputable offline with a stock RFC 8785
implementation and standard SHA-256. No AlgoVoi software in your trust base. Apache-2.0.
Pairs with algovoi-keystone-connect: connectors bind writes to the decision that authorised them; behaviours decide, gate and react to those writes.
Define a behaviour in a few lines
from algovoi_keystone_agent import rule, trigger, behaviour, Engine
cap = rule("spend_cap", lambda ev: "BLOCK" if ev.get("amount", 0) > 500 else "ALLOW")
charge = trigger(stage="spend_decision", where=lambda ev: ev.get("action_type") == "charge")
freeze = behaviour("freeze_on_cap", on=charge, rule=cap,
action=lambda ev, verdict: {"froze": ev.get("scope")} if verdict == "BLOCK" else None)
engine = Engine([freeze], decision_ref=decision_ref)
for record in engine.dispatch(spend_event):
... # record["behaviour_ref"] recomputes byte for byte
- rule -- a pure predicate to a verdict (
"ALLOW"/"FLAG"/"BLOCK", or a bool). - trigger --
stageplus awhere(event)predicate: when does this behaviour wake. - behaviour --
trigger+rule+ optionalaction(event, verdict). - Engine -- deploys behaviours;
dispatch(event)fires matches and emits abehaviour_refrecord;verdict(event)returns the strongest verdict (BLOCK > FLAG > ALLOW).
Gate a real write
Engine.guard(client) wraps a keystone-connect client so each call is dispatched as an event first.
A BLOCK denies the call before it reaches the data plane; reads and non-matching calls pass through.
from algovoi_keystone_agent import Denied
guarded = engine.guard(keystone_s3_client)
guarded.put_object(Bucket="receipts", Key="r1", Body=b"{}") # allowed
guarded.put_object(Bucket="locked", Key="r2", Body=b"{}") # raises Denied, no write, block recorded
Test a behaviour at any stage of the flow
You do not need a live gateway or real payments. synth_event(stage) stands in for whatever precedes
your behaviour, and the check_* battery verifies the keystone properties offline.
from algovoi_keystone_agent import check_rule, check_trigger, check_behaviour, synth_event
report = check_behaviour(
freeze,
[synth_event("spend_decision", amount=900, action_type="charge", scope="acct/7")],
expect="BLOCK",
)
assert report.ok # fires, behaviour_ref recomputes, self-describing, decision-bound, tamper-evident
print(report)
A behaviour that ignores its decision_ref, or a rule that is not deterministic, fails report.ok.
The battery reports a broken behaviour; it never crashes on one.
Keystone-only edition, Apache-2.0. Built on the AlgoVoi substrate (RFC 8785 JCS + SHA-256).
Metadata
Release files for algovoi-keystone-agent 0.5.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 |
|---|---|---|---|---|
| algovoi_keystone_agent-0.5.0.tar.gz | 20.3 kB | Without provenance | Details for algovoi_keystone_agent-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| algovoi_keystone_agent-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for algovoi_keystone_agent-0.5.0-py3-none-any.whl |
Total release size: 35.4 kB
Release files / algovoi_keystone_agent-0.5.0.tar.gz
| Download URL | algovoi_keystone_agent-0.5.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fc72586d30403b7b1c6d96da339644262bd230d16f9c6a2a94b01abd4148a2b
|
|
BLAKE2b-256 checksum How to use checksums |
ff40129fadfcebc8c673ac4c1e3344be82d557c2ef67169d61c6fdf581ab227c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / algovoi_keystone_agent-0.5.0-py3-none-any.whl
| Download URL | algovoi_keystone_agent-0.5.0-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
845f2c942cc9c27264c51cc717cdc63898a5d2edbea9aa64831e09902c414e98
|
|
BLAKE2b-256 checksum How to use checksums |
3d76b4da546babfbecd0e1c7d7cd4bf28ae559ddf3377820ece9a9104bbd800a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for algovoi-keystone-agent 0.5.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.