Skip to main content

ActAuth (Python)

Reference implementation of the rule engine, scoped resolution, conditions, and audit log. See the root README for the product pitch and rule format; this file only covers what's specific to the Python package.

Install

pip install -e ".[dev]"

Quickstart

python examples/quickstart.py
import asyncio
from actauth import AuditLog, Gate, Scope

async def main():
    gate = Gate.from_config(
        "examples/actauth.yml",
        audit_log=AuditLog("actauth-audit.jsonl"),
    )
    scope = Scope(tenant="beta-fintech", environment="production", agent="payments-agent")
    result = await gate.evaluate("send_refund", {"amount": 5000}, scope)
    print(result.decision, result.reason)

asyncio.run(main())

Run the tests

pytest

Project layout

src/actauth/
  models.py       Decision, Scope, Rule, EvaluationResult
  conditions.py   safe {field, op, value} evaluator, no eval()
  rules.py        RuleSet — loads YAML, resolves scope + conditions
  audit.py        AuditLog — append-only JSONL
  approvers.py    Approver interface, ConsoleApprover, SlackApprover (stub)
  gate.py         Gate — ties the above together
examples/
  actauth.yml     example rule set
  quickstart.py   runnable end-to-end demo
tests/

Status

Rule engine, scoping, conditions, and audit log are real and tested. SlackApprover is a stub — ConsoleApprover is the working default. No agent-SDK adapter yet.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

actauth-0.0.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

actauth-0.0.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file actauth-0.0.2.tar.gz.

File metadata

  • Download URL: actauth-0.0.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.8

File hashes

Hashes for actauth-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2e3a72ce892a6644cb3687cad155955e161ca3c22b1895606f28a405869120f8
MD5 686935f918c7f8cc4e4d12e606e14aea
BLAKE2b-256 a378b7b764311af93fd5ba5c257cf9c8d89b55e5e455d6a61c709c085408f737

See more details on using hashes here.

File details

Details for the file actauth-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: actauth-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.8

File hashes

Hashes for actauth-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c55f95123a02545e3983b16cd9a126a16452f0a4674329de7d4963748656005c
MD5 07e972c5375e28ef3c29666edbd2fb36
BLAKE2b-256 c0bca9e0aef516e783a042c4d89b673a59db30bd5edba30d4e5ae83e7f90d2e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page