Skip to main content

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 -- stage plus a where(event) predicate: when does this behaviour wake.
  • behaviour -- trigger + rule + optional action(event, verdict).
  • Engine -- deploys behaviours; dispatch(event) fires matches and emits a behaviour_ref record; 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.4.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 algovoi-keystone-agent 0.4.1
File Size Uploaded Provenance Actions
algovoi_keystone_agent-0.4.1.tar.gz 20.3 kB Without provenance Details for algovoi_keystone_agent-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for algovoi-keystone-agent 0.4.1
File Interpreter ABI Platform Actions
algovoi_keystone_agent-0.4.1-py3-none-any.whl Python 3 none any Details for algovoi_keystone_agent-0.4.1-py3-none-any.whl

Total release size: 50.1 kB

Release files / algovoi_keystone_agent-0.4.1.tar.gz

Download URL algovoi_keystone_agent-0.4.1.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d057fcdeba55e513e0c4a61045e2400645dc43442161858712db6d85dcd35e11
BLAKE2b-256 checksum
How to use checksums
9954a978aa9ef0653770bc8a5d789720d14d3e59cac673c1f4d40916d4d565a7
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.4.1-py3-none-any.whl

Download URL algovoi_keystone_agent-0.4.1-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f509d7f7fc95c3930dc6fc1707aedd6832bd3aeda9557695910f7554d1f2161
BLAKE2b-256 checksum
How to use checksums
85f4e311d91054e1d5d2f351737337f2ce2fb3f277bfd5792911a89c30015126
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.4.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.

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.

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