Skip to main content

LangChain AgentMesh Integration

Cryptographic identity verification and trust-gated tool execution for LangChain agents.

Installation

pip install agentmesh-langchain

Features

  • VerificationIdentity: Ed25519-based cryptographic identity for agents
  • TrustGatedTool: Wrap any tool with trust requirements
  • TrustedToolExecutor: Execute tools with automatic verification
  • TrustCallbackHandler: Monitor trust events during chain execution
  • TrustHandshake: Verify peer agents before collaboration
  • DelegationChain: Hierarchical capability delegation

Quick Start

from langchain_agentmesh import VerificationIdentity, TrustGatedTool, TrustedToolExecutor

# Generate agent identity
identity = VerificationIdentity.generate('research-agent', capabilities=['search', 'summarize'])

# Wrap a tool with trust requirements
gated_tool = TrustGatedTool(
    tool=search_tool,
    required_capabilities=['search'],
    min_trust_score=0.8
)

# Execute with verification
executor = TrustedToolExecutor(identity=identity)
result = executor.invoke(gated_tool, 'query')

Use Cases

Multi-Agent Trust Verification

from langchain_agentmesh import TrustHandshake

# Create handshake for peer verification
handshake = TrustHandshake(my_identity)

# Verify peer before collaboration
result = await handshake.verify_peer(peer_identity)
if result.trusted:
    # Safe to delegate task
    response = await peer_agent.invoke(task)

Trust-Gated Tool Execution

from langchain_agentmesh import TrustGatedTool

# Sensitive tool requiring high trust
code_execution_tool = TrustGatedTool(
    tool=python_repl,
    required_capabilities=['code:execute'],
    min_trust_score=0.9,
    audit_logging=True
)

# Only trusted agents can use this tool
result = executor.invoke(code_execution_tool, code)

Callback Integration

from langchain_agentmesh import TrustCallbackHandler

# Monitor trust events
callback = TrustCallbackHandler(
    on_verification=lambda r: print(f"Verified: {r.peer_did}"),
    on_violation=lambda v: alert(f"Violation: {v}")
)

agent = create_agent(callbacks=[callback])

Configuration

Parameter Default Description
min_trust_score 0.5 Minimum trust score required
required_capabilities [] Required capability list
audit_logging False Enable audit trail
cache_ttl 900 Verification cache TTL (seconds)

Related

License

MIT

Metadata

Release files for agentmesh_langchain 3.6.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 agentmesh_langchain 3.6.0
File Size Uploaded Provenance
agentmesh_langchain-3.6.0.tar.gz 21.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentmesh_langchain 3.6.0
File Interpreter ABI Platform
agentmesh_langchain-3.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.3 kB

Release files / agentmesh_langchain-3.6.0.tar.gz

Download URL agentmesh_langchain-3.6.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dae0e20a7d2da49217b5cc2002697b986bef6fdc25e0d58c5c757810377a5c8a
BLAKE2b-256 checksum
How to use checksums
a8ec3d6b38d643b40e5835c014dda0ce4588c12422b647a7c415adbaf54bea4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Release files / agentmesh_langchain-3.6.0-py3-none-any.whl

Download URL agentmesh_langchain-3.6.0-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e850d6d89602b53dd18761681ffcdc44399e8107ff48ee0ce1982fd4ca85c337
BLAKE2b-256 checksum
How to use checksums
5866d30bc1e68f15ab418620d01b6c9e2dae32575e05940bb78d58af71c74f26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Security for agentmesh_langchain 3.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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