Metadata-Version: 2.4
Name: ujex-compliance-callback
Version: 0.1.1
Summary: Drop-in tamper-evident audit callbacks for LangChain, LangGraph, CrewAI, AutoGen, PydanticAI. Streams events into the Ujex hash-chained audit ledger (IETF draft-sharif-agent-audit-trail-00).
Author-email: Ujex <hello@ujex.dev>
License-Expression: Apache-2.0
Project-URL: Homepage, https://ujex.dev/compliance
Keywords: ujex,audit,compliance,langchain,crewai,eu-ai-act,iso-42001,soc2,hipaa,tamper-evident
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 :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == "langchain"
Provides-Extra: crewai
Requires-Dist: crewai>=0.55; extra == "crewai"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# ujex-compliance-callback (Python)

Drop-in tamper-evident audit callbacks for AI agent frameworks. Streams events into a Ujex hash-chained ledger that satisfies IETF `draft-sharif-agent-audit-trail-00` (AAT) and ISO/IEC 42005:2025 evidence requirements.

Resolves LangChain RFC [#35691](https://github.com/langchain-ai/langchain/issues/35691).

## Install

```bash
pip install ujex-compliance-callback
```

## LangChain / LangGraph

```python
from langchain_openai import ChatOpenAI
from ujex_compliance_callback import UjexComplianceClient, UjexLangChainCallback

client = UjexComplianceClient(
    endpoint="https://us-central1-axy-ujex.cloudfunctions.net",
    device_key=os.environ["UJEX_DEVICE_KEY"],
    agent_id="my-agent",
    agent_version="1.4.2",
)
handler = UjexLangChainCallback(client)

llm = ChatOpenAI(callbacks=[handler])
```

## CrewAI

```python
from crewai.events import event_bus
from ujex_compliance_callback import UjexComplianceClient, UjexCrewAICallback

cb = UjexCrewAICallback(UjexComplianceClient(...))
event_bus.on("agent_execution_started", cb.on_agent_execution_started)
event_bus.on("tool_usage_started",     cb.on_tool_usage_started)
event_bus.on("tool_usage_finished",    cb.on_tool_usage_finished)
```

## Verify the chain offline

```bash
pip install ujex-audit-chain
python -m ujex_audit_chain verify bundle.zip   # also accepts an extracted dir or records.jsonl
```

## License

Apache-2.0.
