Metadata-Version: 2.4
Name: truthlocks-langchain
Version: 1.0.1
Summary: Truthlocks MAIP integration for LangChain — auto-generate cryptographic receipts for every chain and agent action
Project-URL: Homepage, https://truthlocks.com
Project-URL: Documentation, https://docs.truthlocks.com/sdk/langchain
Project-URL: Repository, https://github.com/truthlocks/maip
Author-email: Truthlocks Inc <support@truthlocks.com>
License-Expression: Apache-2.0
Keywords: ai-provenance,langchain,machine-identity,maip,receipts,truthlocks
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Requires-Dist: maip-ai-connectors[langchain]>=1.0.0
Description-Content-Type: text/markdown

# truthlocks-langchain

Cryptographic receipt generation for every LangChain chain, agent, and tool invocation. Part of the [Truthlocks MAIP](https://truthlocks.com) (Machine-Attested Identity Protocol) ecosystem.

## Installation

```bash
pip install truthlocks-langchain
```

## Quick Start

```python
from truthlocks_langchain import MAIPCallbackHandler

# Create the receipt handler
handler = MAIPCallbackHandler()

# Attach to any LangChain chain
chain.invoke(input, config={"callbacks": [handler]})

# Every LLM call, tool use, and chain step now produces
# a cryptographic receipt anchored to a tamper-proof log
```

## API

| Class | Description |
|---|---|
| `MAIPCallbackHandler` | LangChain callback that auto-generates MAIP receipts for every event in a chain run |
| `MAIPRunnableWrapper` | Wraps any LangChain `Runnable` to emit receipts on `.invoke()` / `.stream()` / `.batch()` |
| `MAIPTracer` | Full tracing integration that produces a receipt tree matching the LangChain call graph |

## What You Get

- **Tamper-proof audit trail** for every LLM call, retrieval, and tool invocation
- **Cryptographic receipts** anchored to a transparency log with sub-40 ms latency
- **Zero-config** drop-in integration -- add the callback and receipts flow automatically
- **Compliance-ready** evidence packages for SOC 2 Type II, ISO 27001, and EU AI Act

## How It Works

`truthlocks-langchain` is a thin wrapper around [`maip-ai-connectors`](https://pypi.org/project/maip-ai-connectors/), the core Truthlocks MAIP SDK for Python. It re-exports the LangChain-specific classes so you can install only what you need.

## Requirements

- Python >= 3.9
- A Truthlocks API key ([get one free](https://truthlocks.com/get-started))

## Documentation

Full guides, API reference, and examples: **[docs.truthlocks.com/sdk/langchain](https://docs.truthlocks.com/sdk/langchain)**

## License

Apache 2.0 -- see [LICENSE](https://github.com/truthlocks/maip/blob/main/LICENSE).
