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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_agentoath-0.2.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_agentoath-0.2.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file langchain_agentoath-0.2.0.tar.gz.

File metadata

  • Download URL: langchain_agentoath-0.2.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.12

File hashes

Hashes for langchain_agentoath-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7848913767ddc07589784751e72982d5af691465fa71b92556a55bbbc05654f2
MD5 229d09c0db02cec4ae80825f1274b603
BLAKE2b-256 3f5a213d69e775e110926f5db12eda9a3a15569f5e4685c0120b1968041bb14b

See more details on using hashes here.

File details

Details for the file langchain_agentoath-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_agentoath-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9369c9423fd709170dc467f78ced48f647830ee378ffba61af41c86802eec631
MD5 dbf8e7b4d9cc63eb4702f493002d262a
BLAKE2b-256 e63e1d627979ead09500617a656d35915b9b22014e36eb49897de780a48ff6ad

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page