Metadata-Version: 2.4
Name: cwn-langchain-trust-gate
Version: 0.1.0
Summary: LangChain tools for Trust Gate post-quantum receipts (Ed25519 + ML-DSA-65, verifiable offline).
Author-email: Cyber Warrior Network <apps@cyberwarriornetwork.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/CWNApps/langchain-trust-gate
Project-URL: Trust Gate, https://trust-gate-mcp.onrender.com
Project-URL: Smithery, https://smithery.ai/servers/apps/cwn-trust-gate
Project-URL: Source, https://github.com/CWNApps/langchain-trust-gate
Keywords: langchain,mcp,trust-gate,post-quantum,agent,receipt
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software 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 :: Security :: Cryptography
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langchain-core>=0.3
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-asyncio>=0.21; extra == "test"
Dynamic: license-file

# langchain-trust-gate

LangChain tools for **Trust Gate** post-quantum, tamper-evident receipts on consequential agent actions.

Trust Gate receipts are signed Ed25519 + ML-DSA-65 (FIPS 204) by the hosted MCP server (no local signing key). Each receipt is verifiable offline from the certificate alone. The hosted server defaults to PQ-required verify (defends against Ed25519-only downgrade); set TRUST_GATE_REQUIRE_PQ=false on your own deployment to allow Ed25519-only receipts.

## Install

```bash
pip install cwn-langchain-trust-gate
```

## Usage

```python
from langchain_trust_gate import MintActionReceiptTool, VerifyReceiptTool

# wire into any LangChain agent
tools = [MintActionReceiptTool(), VerifyReceiptTool()]

# typical flow inside an agent:
#   1. the agent decides to do something consequential
#   2. it calls trust_gate_mint_action_receipt(agent_id, operation, target)
#   3. the receipt is stored, attached to the audit log, returned to the user
#   4. later anyone can call trust_gate_verify_receipt(receipt) to confirm tamper-free
```

## Configuration

```bash
# point at a different deployment (Render / Smithery / self-hosted)
export TRUST_GATE_URL="https://trust-gate-mcp.onrender.com"
```

## Tools

| Tool | Purpose |
|---|---|
| `trust_gate_mint_action_receipt` | Mint a post-quantum receipt for any consequential agent action. |
| `trust_gate_verify_receipt` | Verify a Trust Gate receipt from the certificate alone. Defaults to PQ-required. |

## Telemetry

Each tool invocation makes one fire-and-forget `GET /x?via=langchain&kind=api` against the Trust Gate server. No PII, no cookies, no fingerprinting -- just a channel tag so we can measure adoption per framework. Telemetry never blocks or fails the tool.

## Background

* **Trust Gate MCP** -- the hosted server: <https://trust-gate-mcp.onrender.com>
* **Smithery listing** -- <https://smithery.ai/servers/apps/cwn-trust-gate>
* **Official MCP Registry** -- `io.github.CWNApps/trust-gate-mcp`
* **OAO** -- the open-source receipt primitive: <https://github.com/CWNApps/openagentontology>

## License

Apache-2.0.
