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.0

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.0
File Size Uploaded Provenance Actions
algovoi_keystone_agent-0.4.0.tar.gz 18.9 kB Without provenance Details for algovoi_keystone_agent-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 48.4 kB

Release files / algovoi_keystone_agent-0.4.0.tar.gz

Download URL algovoi_keystone_agent-0.4.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d981dd7467ea322e57ac76d9949798c73432886a9e363d6581c6e74613611e13
BLAKE2b-256 checksum
How to use checksums
6e7d4286d2ca066d387a3826b6e0c38a11291332db155286f7c6443c97b2aa07
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.0-py3-none-any.whl

Download URL algovoi_keystone_agent-0.4.0-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7869c6e8f97d9daae8a5a0a5f47b905c483b58f53ffb2aaa1cc1a038470c72f0
BLAKE2b-256 checksum
How to use checksums
a82662de2ba3c90fd2e2c8c95f2503fc1da70a62a2789b908ff616235ebf10e5
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.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.

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