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 Claude 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.1.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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: actauth-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b0c9039b5b631064aebfc2452857b1ccda8748582bb654b8297942095dd15217
MD5 eddb74e44d5219995c6e8188c14666da
BLAKE2b-256 4d3080287a96ea22ff6c2584ffbf96db8c5305a1e896bfa9b62a06468069a3fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: actauth-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee0bf91c32597c90485feaa0d78e30186d3fbb60b8064eae6ba8ad6ca659037e
MD5 7fb19aa3bf3b3e83ccbb7e380fe0f87e
BLAKE2b-256 50998ebc5b81f671d47df72ef348a8a9c8defc05b617b2f68ee62f9734e1a61e

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 Pingdom Monitoring Sentry Error logging StatusPage Status page