Metadata-Version: 2.4
Name: actauth
Version: 0.0.1
Summary: A self-hosted policy gate for AI agent tool calls.
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# ActAuth (Python)

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

## Install

```bash
pip install -e ".[dev]"
```

## Quickstart

```bash
python examples/quickstart.py
```

```python
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

```bash
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.
