Every AI agent framework tutorial starts the same way: set up your LLM, define your tools, run your agent. Nobody asks: "How does another agent know this is really your agent?"
That's the problem. We're building agents that can execute trades, send emails, access databases, and collaborate with other agents — but they have no verifiable identity. Any agent can claim to be any other agent. There's no signature, no proof, no way to verify.
I've been working on AIP (Agent Identity Protocol) to fix this. Today I want to show you how to add cryptographic identity to any Python agent in one line of code.
The One-Liner
from aip_identity.integrations.auto import ensure_identity
client = ensure_identity("my-agent", platform="langchain")
That's it. Your agent now has:
- A DID (Decentralized Identifier) — a globally unique, permanent identity
- An Ed25519 keypair — for signing data and verifying authenticity
- Registration on the AIP network — discoverable by other agents
- Credentials saved locally — survives restarts, never leaves your machine
First run: generates keys, registers with the AIP service, saves credentials to ~/.aip/credentials.json.
Every subsequent run: loads existing identity instantly. Zero config.
What Can You Actually Do With It?
Sign your agent's outputs
client = ensure_identity("report-generator", platform="internal")
report = generate_quarterly_report()
signature = client.sign(report.encode())
# Now anyone can verify this report came from YOUR agent
# Not a spoofed copy, not a modified version — the original
Verify another agent before trusting it
# Don't just trust a DID claim — cryptographically verify
is_real = client.verify("did:aip:abc123...")
if is_real:
process_their_request()
Send encrypted messages between agents
client.send_message(
"did:aip:other_agent_did",
"Quarterly report ready for review."
)
# SealedBox encryption — only the recipient can decrypt
Check trust before collaborating
trust = client.get_trust("did:aip:abc123...")
if trust["trust_score"] > 0:
# This agent has been vouched for by others in the network
collaborate(agent)
Framework Integration
AIP works with any Python agent framework. Here's how it looks in practice:
LangChain
from aip_identity.integrations.langchain_tools import get_aip_tools
tools = get_aip_tools() # Returns LangChain-compatible tools
agent = create_react_agent(llm, tools + your_other_tools)
# Your agent can now sign, verify, and check trust via tool calls
CrewAI
from aip_identity.integrations.langchain_tools import get_aip_tools
researcher = Agent(
role="Verified Researcher",
tools=get_aip_tools(), # CrewAI uses LangChain tools natively
goal="Research with cryptographic proof of authorship"
)
AutoGen / Any Framework
from aip_identity.integrations.auto import ensure_identity
client = ensure_identity("my-autogen-agent", platform="autogen")
# Use client.sign(), client.verify(), etc. directly
Why This Matters Now
The agent ecosystem is growing fast. MCP servers, tool-using agents, multi-agent systems — they all share a fundamental problem: no identity layer.
When Agent A calls Agent B's MCP server:
- How does B know it's really A?
- How does A know B's response wasn't tampered with?
- If something goes wrong, who's accountable?
These aren't hypothetical problems. As agents get access to more capabilities (financial transactions, code execution, data access), identity becomes a prerequisite for security.
Try It
pip install aip-identity
from aip_identity.integrations.auto import ensure_identity
client = ensure_identity("hello-world", platform="test")
print(f"Your agent's DID: {client.did}")
print(f"Public key: {client.public_key}")
That's 3 lines from pip install to a cryptographic identity.
Resources:
- GitHub — Source, examples, and integration templates
- Tutorial: Zero to Trusted Agent — Step-by-step guide
- API Explorer — See the live trust graph
- PyPI — ~60-70 installs/day
What identity problems are you hitting with your agents? I'd love to hear about your use cases.
Top comments (0)