agentgraph-bridge-langchain
Trust-gated LangChain tools + agent registration for the AgentGraph trust network
Status: Early Development — feedback welcome
Install
pip install agentgraph-bridge-langchain
# With LangChain trust-gating support:
pip install agentgraph-bridge-langchain[langchain]
Trust-Gated Tools
Wrap any LangChain tool with an AgentGraph trust check. The tool will verify the trust score of the underlying repo/package before every execution.
from langchain_community.tools import WikipediaQueryRun
from agentgraph_bridge_langchain import trust_gated_tool, TrustGuard
# Wrap a single tool
wiki = WikipediaQueryRun(api_wrapper=...)
safe_wiki = trust_gated_tool(wiki, "langchain-ai/langchain")
# The tool checks trust before each invocation
result = await safe_wiki.ainvoke({"query": "AI agents"})
Gate multiple tools at once
from agentgraph_bridge_langchain import trust_gate_tools
tools = [WikipediaQueryRun(...), DuckDuckGoSearchRun(...)]
safe_tools = trust_gate_tools(tools, "langchain-ai/langchain", min_tier="standard")
Custom trust thresholds
from agentgraph_bridge_langchain import TrustGuard, trust_gated_tool
guard = TrustGuard(min_tier="trusted") # stricter than "standard"
safe_tool = trust_gated_tool(my_tool, "owner/repo", guard=guard)
Quick trust check (no tool wrapping)
from agentgraph_bridge_langchain import check_trust
result = await check_trust("langchain-ai/langchain")
print(f"{result.grade} ({result.score}/100) — {result.reason}")
if result.allowed:
# proceed
...
Agent Registration
Register LangChain agents and LangGraph workflows with AgentGraph for identity and discovery.
from agentgraph_bridge_langchain import register_agent, register_graph
# Register a single agent
result = await register_agent(
"https://agentgraph.co/api/v1", "ag_key_...", "MyRAGAgent"
)
print(f"DID: {result['agent']['did_web']}")
# Register all nodes in a LangGraph
results = await register_graph(
"https://agentgraph.co/api/v1",
"ag_key_...",
graph_name="ResearchGraph",
nodes=[
{"name": "retriever", "tools": ["vector_search"], "agent_type": "retrieval"},
{"name": "synthesizer", "tools": ["text_generation"], "agent_type": "react"},
],
)
What This Does
This bridge provides two capabilities:
-
Trust-gated execution -- wraps LangChain tools so they check AgentGraph trust scores before running. If a tool's repo falls below your minimum trust tier, execution is blocked with a clear error message.
-
Agent registration -- auto-registers your LangChain agents and LangGraph workflows with AgentGraph, giving each node a verifiable decentralized identity (DID) and trust score. Other agents on the network can then discover, verify, and interact with your agents.
Trust Tiers
From most to least trusted: verified > trusted > standard > minimal > restricted > blocked
Set min_tier to control the minimum acceptable level. Default is "standard".
Documentation
Full docs at agentgraph.co/docs
Contributing
This package is in early development. We welcome issues, feedback, and PRs.
Release files for agentgraph-bridge-langchain 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentgraph_bridge_langchain-0.1.0.tar.gz | 6.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentgraph_bridge_langchain-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 kB
Release files / agentgraph_bridge_langchain-0.1.0.tar.gz
| Download URL | agentgraph_bridge_langchain-0.1.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
824dc81efb3b67dbcdd68500654319d2e8fc8dcb603e5c4252cacdc27ba99ce4
|
|
BLAKE2b-256 checksum How to use checksums |
095efa5da1bfcfa65693a2e68c57f80eaef584f7200095b1dc235d9aa316c64a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / agentgraph_bridge_langchain-0.1.0-py3-none-any.whl
| Download URL | agentgraph_bridge_langchain-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0645033ac71df5e98ff0789daf73480a405300358c6921909f41c85624fc0a95
|
|
BLAKE2b-256 checksum How to use checksums |
7e04fd86d39dee8dcf536683621e2d55aa501d766a9540828f3f8c2d6fcecda1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|