langchain - ✅(Solved) Fix Feature: Agent Identity Verification for Tool Calls [1 pull requests, 14 comments, 7 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#35393Fetched 2026-04-08 00:26:24
View on GitHub
Comments
14
Participants
7
Timeline
37
Reactions
0
Timeline (top)
commented ×14mentioned ×11subscribed ×11labeled ×1

Root Cause

  1. Multi-agent safety: Agents should verify who they're delegating to
  2. Audit trails: Cryptographic proof of which agent performed which action
  3. Access control: Tools can check agent identity before executing
  4. Reputation: Trust scores enable risk-based delegation decisions

PR fix notes

PR #36742: partners: Add Joy Trust Network integration

Description (problem / solution / changelog)

Summary

Adds langchain-joy partner package for agent trust verification before delegation.

Closes #35393

Features

  • JoyTrustCallbackHandler: Intercepts on_tool_start events, verifies agent trust scores before allowing execution
  • JoyTrustClient: Direct API access for trust queries and agent discovery
  • @require_trust decorator: Function-level trust requirements
  • Fail-closed security: Blocks execution on verification errors by default
  • Caching: Reduces API calls with configurable TTL
  • Audit logging: All verification attempts logged for compliance

Usage

from langchain_joy import JoyTrustCallbackHandler
from langchain.agents import initialize_agent

# Add trust verification to any agent
handler = JoyTrustCallbackHandler(min_trust_score=1.5)
agent = initialize_agent(tools, llm, callbacks=[handler])

# Tool calls are now verified against Joy trust scores
agent.run("Use the calculator tool")

Why Joy?

From the discussion in #35393, there are several agent identity solutions. Joy differentiates by:

AspectJoyOthers (AIP, asqav, etc.)
SetupAPI call, no keysCryptographic key management
Network8,100+ agents liveMostly pre-launch
IntegrationCallback handlerRequires code changes
ApproachTrust scoringCryptographic identity

Test plan

  • Unit tests for client
  • Integration tests against live API
  • Test with real LangChain agents

Links


Generated with Claude Code

Changed files

  • libs/partners/joy/.gitignore (added, +8/-0)
  • libs/partners/joy/LICENSE (added, +21/-0)
  • libs/partners/joy/README.md (added, +96/-0)
  • libs/partners/joy/langchain_joy/__init__.py (added, +14/-0)
  • libs/partners/joy/langchain_joy/callback.py (added, +288/-0)
  • libs/partners/joy/langchain_joy/client.py (added, +177/-0)
  • libs/partners/joy/langchain_joy/decorators.py (added, +98/-0)
  • libs/partners/joy/pyproject.toml (added, +70/-0)
  • libs/partners/joy/tests/__init__.py (added, +1/-0)
  • libs/partners/joy/tests/integration_tests/__init__.py (added, +1/-0)
  • libs/partners/joy/tests/unit_tests/__init__.py (added, +1/-0)
  • libs/partners/joy/tests/unit_tests/test_client.py (added, +105/-0)

Code Example

from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from aip_identity.integrations.langchain_tools import get_aip_tools

# Get AIP tools as LangChain tools
tools = get_aip_tools()

# Initialize agent with identity capabilities
agent = initialize_agent(
    tools=tools,
    llm=ChatOpenAI(),
    agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
)

# Agent can now verify other agents before delegating
result = agent.run("Verify agent did:aip:abc123 and check their trust score before calling their API")
RAW_BUFFERClick to expand / collapse

Problem

LangChain currently has no mechanism for agents to cryptographically prove their identity when making tool calls or participating in multi-agent workflows. This means:

  • No way to verify which agent made a specific tool call
  • No trust scoring for agent delegation decisions
  • No cryptographic audit trail for agent actions
  • No way for tools to enforce identity-based access control

As agent-to-agent communication becomes more common (via LangGraph, multi-agent chains, etc.), the lack of identity verification creates trust and accountability gaps.

Proposed Solution

Integrate with a decentralized agent identity layer. One working implementation is AIP (Agent Identity Protocol), which provides:

  • Cryptographic identity: Ed25519 keypairs + DIDs (Decentralized Identifiers)
  • Trust verification: Transitive trust via vouch chains with scoped trust levels
  • Encrypted messaging: E2E encrypted agent-to-agent communication
  • Artifact signing: Cryptographic signatures for outputs and tool results

Working Example

AIP already has a LangChain integration in aip_identity/integrations/langchain_tools.py:

from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from aip_identity.integrations.langchain_tools import get_aip_tools

# Get AIP tools as LangChain tools
tools = get_aip_tools()

# Initialize agent with identity capabilities
agent = initialize_agent(
    tools=tools,
    llm=ChatOpenAI(),
    agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
)

# Agent can now verify other agents before delegating
result = agent.run("Verify agent did:aip:abc123 and check their trust score before calling their API")

The integration provides tools for:

  • aip_register — register a new agent identity
  • aip_verify — verify another agent's identity
  • aip_vouch — vouch for a trusted agent
  • aip_trust_score — calculate trust between agents
  • aip_send_message — send encrypted messages

Why This Matters

  1. Multi-agent safety: Agents should verify who they're delegating to
  2. Audit trails: Cryptographic proof of which agent performed which action
  3. Access control: Tools can check agent identity before executing
  4. Reputation: Trust scores enable risk-based delegation decisions

Resources

Would love feedback on whether this kind of identity layer would be useful as a first-class LangChain feature or integration.

extent analysis

Problem Summary

Integrate with a decentralized agent identity layer to provide cryptographic identity verification, trust scoring, and encrypted messaging.

Root Cause Analysis

Lack of identity verification creates trust and accountability gaps in agent-to-agent communication.

Fix Plan

Integrate with AIP (Agent Identity Protocol) to provide cryptographic identity, trust verification, and encrypted messaging.

Step-by-Step Solution

  1. Install AIP library:

pip install aip-identity

2. **Import AIP tools in LangChain**:
   ```python
from aip_identity.integrations.langchain_tools import get_aip_tools
  1. Get AIP tools as LangChain tools:

tools = get_aip_tools()

4. **Initialize agent with identity capabilities**:
   ```python
agent = initialize_agent(
    tools=tools,
    llm=ChatOpenAI(),
    agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
)
  1. Use AIP tools for identity verification and messaging:

result = agent.run("Verify agent did:aip:abc123 and check their trust score before calling their API")


## Verification
Verify that the fix worked by checking the output of the `agent.run()` method, which should now include identity verification and trust scoring information.

## Extra Tips
- Use the `aip_register` tool to register a new agent identity.
- Use the `aip_verify` tool to verify another agent's identity.
- Use the `aip_vouch` tool to vouch for a trusted agent.
- Use the `aip_trust_score` tool to calculate trust between agents.
- Use the `aip_send_message` tool to send encrypted messages.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING