Skip to main content

langchain-agentoath

AgentOath trust protocol integration for LangChain.

Automatically generates cryptographically signed trust receipts for every LangChain chain execution, tool call, and LLM interaction.

Installation

pip install langchain-agentoath

For full LangChain integration (optional):

pip install langchain-agentoath[langchain]

Quick Start

Callback Handler -- automatic receipts

from agentoath import TrustAgent
from langchain_agentoath import AgentOathCallbackHandler

# Create an agent identity
agent = TrustAgent.create(name="MyChain", capabilities=["chat"])

# Create the callback handler
handler = AgentOathCallbackHandler(agent)

# Attach to any LangChain chain
result = chain.invoke(
    {"input": "What is the weather?"},
    config={"callbacks": [handler]},
)

# Every chain/tool/LLM event now has a signed receipt
for receipt in handler.receipts:
    print(receipt.action, receipt.rating, receipt.description)

TrustedChain -- wrapper with pre/post receipts

from langchain_agentoath import TrustedChain

trusted = TrustedChain(chain=my_chain, agent=agent)
result = trusted.invoke({"input": "hello"})

# Pre-execution + post-execution + per-step receipts
print(f"Generated {len(trusted.receipts)} trust receipts")

Trust-aware Tools

from langchain_agentoath import VerifyAgentTool, SignReceiptTool, CheckTrustTool

tools = [
    VerifyAgentTool(trust_agent=agent),
    SignReceiptTool(trust_agent=agent),
    CheckTrustTool(trust_agent=agent, min_score=0.7),
]

# Use in any LangChain agent
result = tools[0].run('{"agent_did": "did:trust:agent:abc123"}')

TrustFilteredRetriever -- trust-gated RAG

from langchain_agentoath import TrustFilteredRetriever

retriever = TrustFilteredRetriever(
    base_retriever=my_vector_store.as_retriever(),
    agent=agent,
    min_trust_score=0.6,
)

# Only returns documents from agents with trust score >= 0.6
docs = retriever.get_relevant_documents("important query")

Components

Component Description
AgentOathCallbackHandler LangChain callback that auto-creates trust receipts for all events
TrustedChain Chain wrapper with pre/post execution receipts
VerifyAgentTool LangChain tool to verify agent identity and trust score
SignReceiptTool LangChain tool to sign trust receipts
CheckTrustTool LangChain tool to check trust before delegation
TrustFilteredRetriever Retriever that filters documents by agent trust score

License

Apache-2.0

Metadata

Release files for langchain-agentoath 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-agentoath 0.2.0
File Size Uploaded
langchain_agentoath-0.2.0.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-agentoath 0.2.0
File Interpreter ABI Platform
langchain_agentoath-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.2 kB

Release files / langchain_agentoath-0.2.0.tar.gz

Download URL langchain_agentoath-0.2.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7848913767ddc07589784751e72982d5af691465fa71b92556a55bbbc05654f2
BLAKE2b-256 checksum
How to use checksums
3f5a213d69e775e110926f5db12eda9a3a15569f5e4685c0120b1968041bb14b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / langchain_agentoath-0.2.0-py3-none-any.whl

Download URL langchain_agentoath-0.2.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9369c9423fd709170dc467f78ced48f647830ee378ffba61af41c86802eec631
BLAKE2b-256 checksum
How to use checksums
e63e1d627979ead09500617a656d35915b9b22014e36eb49897de780a48ff6ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page