AVAILABLE NOW

LangChain

Cloud Identity integration for LangChain agents. Give your chains identity verification tools, sign outbound requests, and guard endpoints with trust-based middleware.

Install (Early Access)
$git clone https://github.com/citizenofthecloud/langchain.git
$pip install citizenofthecloud-langchain
Early access — clone from GitHub for the latest version. PyPI package coming soon.

Add identity to your LangChain agent

Drop Cloud Identity tools into any LangChain agent. Verify other agents, check trust scores, and sign outbound requests — all as native LangChain tools.

Give Your Agent ToolsPython
from langchain.agents import initialize_agent, AgentType from langchain_openai import ChatOpenAI from citizenofthecloud_langchain import ( VerifyAgentTool, LookupAgentTool, CheckTrustTool, ) # Create identity-aware tools tools = [ VerifyAgentTool(), LookupAgentTool(), CheckTrustTool(), ] llm = ChatOpenAI(model="gpt-4") agent = initialize_agent( tools, llm, agent=AgentType.OPENAI_FUNCTIONS, verbose=True, )
Auto-Sign Outbound RequestsPython
from citizenofthecloud_langchain import CloudIdentityHTTPClient # Reads CLOUD_ID and CLOUD_PRIVATE_KEY from env client = CloudIdentityHTTPClient.from_env() # Every request is automatically signed with X-Cloud-* headers response = client.get("https://api.example.com/data")
Guard an EndpointPython
from fastapi import FastAPI, Request from citizenofthecloud_langchain import cloud_guard_chain app = FastAPI() # Verify callers before they reach your chain @app.post("/invoke") async def invoke(request: Request): guard = cloud_guard_chain(minimum_trust=0.6) result = await guard.ainvoke({ "headers": dict(request.headers), }) if not result["verified"]: return {"error": "Identity verification failed"} return {"status": "ok", "agent": result["cloud_id"]}

Identity tools for LangChain

Each tool is a standard LangChain Tool — drop them into any agent that accepts tools. They handle registry calls and cryptographic verification under the hood.

Verification

VerifyAgentTool
Verify an agent’s identity using Cloud ID, timestamp, and Ed25519 signature

Lookup

LookupAgentTool
Look up an agent’s public profile and passport from the registry

Trust

CheckTrustTool
Check an agent’s trust score against an optional minimum threshold

Environment variables

Set these environment variables to enable request signing and server identity. Verification tools work without credentials.

VariableRequiredDescription
CLOUD_IDFor signingYour agent’s Cloud ID (cc-...). Required for signing outbound requests.
CLOUD_PRIVATE_KEYFor signingEd25519 private key in PEM format. Required alongside CLOUD_ID.

Ready to get started?

Clone the repo, register an agent, and add identity verification to your LangChain workflows.