Metadata-Version: 2.4
Name: praxius-sdk
Version: 0.1.0
Summary: Python SDK for Praxius — instrument AI agent decisions for governance, compliance, and audit
License: MIT
Project-URL: Homepage, https://praxius.ai
Project-URL: Documentation, https://docs.praxius.ai
Project-URL: Repository, https://github.com/Hockeywood21/praxius
Keywords: ai,governance,compliance,observability,agent,llm,audit
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28
Provides-Extra: async
Requires-Dist: httpx>=0.24; extra == "async"
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-mock>=3; extra == "dev"
Requires-Dist: responses>=0.24; extra == "dev"
Requires-Dist: httpx>=0.24; extra == "dev"

# praxius-sdk

Python SDK for [Praxius](https://praxius.ai) — instrument AI agent decisions for governance, compliance, and audit.

```bash
pip install praxius-sdk
```

## Quick start

```python
from praxius import Praxius

px = Praxius(
    api_key="prx_your_key",
    endpoint="https://app.praxius.ai",
)

result = px.record_decision(
    event_type="loan_decision",
    outcome="APPROVED",
    confidence=0.94,
    runtime_ms=1200,
    policy_id="LENDING-POLICY-2024",
    gates=[
        {
            "gate_key": "credit_score_check",
            "title": "Credit Score Threshold",
            "passed": True,
            "reason": "Score 742 exceeds minimum of 680",
            "category": "creditworthiness",
        },
    ],
    gaps=[],
    context={"loan_type": "personal", "amount": 25000},
)

print(result.event_id)
```

## Trace context manager

Wrap your agent with automatic timing:

```python
with px.trace("fraud_check") as ctx:
    decision = my_agent.run(transaction)
    ctx.record(
        outcome=decision.label,
        confidence=decision.score,
        gates=decision.gate_results,
        gaps=decision.missing_fields,
    )
# Decision is sent when the with-block exits.
# If an exception is raised, an ERROR event is recorded automatically.
```

## Human review events

```python
px.record_review(
    trace_id=original_decision_trace_id,
    action="override",           # "accept" | "override" | "modify" | "escalate"
    original_outcome="DENIED",
    final_outcome="APPROVED",
    rationale="Client provided supplemental income documentation.",
    reviewer_role="senior_underwriter",
    assigned_at="2026-05-12T14:00:00Z",
    completed_at="2026-05-12T14:22:00Z",
)
```

## Typed gate evaluations

Use the `GateEvaluation` dataclass for full IDE completion:

```python
from praxius import GateEvaluation

gates = [
    GateEvaluation(
        gate_key="aml_screening",
        title="AML Counterparty Screening",
        passed=False,
        reason="Destination account matched OFAC watchlist",
        category="compliance",
        policy_id="AML-POLICY-2024",
        policy_version="v3",
    ),
]
```

## Async support

```bash
pip install praxius-sdk[async]
```

```python
from praxius import AsyncPraxius

px = AsyncPraxius(api_key="prx_...")

async def handle():
    result = await px.record_decision(
        event_type="fraud_check",
        outcome="FLAGGED",
        confidence=0.87,
        runtime_ms=230,
    )
```

## Configuration

| Parameter | Env var | Default | Description |
|---|---|---|---|
| `api_key` | `PRAXIUS_API_KEY` | — | Your API key from Settings → API Keys |
| `endpoint` | `PRAXIUS_API_URL` | `https://app.praxius.ai` | Your Praxius instance URL |
| `timeout` | — | `10` | Request timeout in seconds |
| `retries` | — | `2` | Retry attempts on 5xx errors (exponential backoff) |
| `debug` | — | `False` | Print all requests and responses |

## Docs

Full documentation at [docs.praxius.ai](https://docs.praxius.ai).
