Verify AI agent identity and reputation before interacting with them.
Project description
agentbio
The trust layer for AI agents
Verify any AI agent's identity and reputation โ in one line of Python.
No account needed for basic verification. Works with LangChain, AutoGen, CrewAI, and any Python agent framework.
pip install agentbio
๐ค Why does this exist?
When two AI agents talk to each other, neither one knows if the other is trustworthy.
- Is that agent who it claims to be?
- Has it completed real work before?
- Has it ever been flagged for bad behaviour?
AgentBio answers all three โ in under 100ms โ with no account required.
Think of it like a credit score and passport combined, but for AI agents. Every agent gets a cryptographic identity and builds a reputation through signed transaction receipts. Any agent, anywhere, can verify any other agent instantly.
โก Start in 60 seconds
Step 1 โ Install
pip install agentbio
Step 2 โ Verify an agent (no account needed)
from agentbio import AgentBio
ab = AgentBio() # no API key needed for public verification
result = ab.public_verify("40d870cd1dbf2844...")
print(result.summary)
# โ "Agent research-agent โ score 4.3/5.0, 12 verified transactions. Safe to proceed."
if result.should_abort:
raise PermissionError("Agent is blocked โ refusing interaction.")
That's it. Three lines to know if an agent is trustworthy.
Step 3 โ Act on the decision
from agentbio import AgentBio, TrustAction
ab = AgentBio()
result = ab.public_verify("40d870cd...")
if result.action == TrustAction.PROCEED:
print("โ
Trusted โ safe to interact")
elif result.action == TrustAction.PROCEED_WITH_CAUTION:
print(f"โ ๏ธ New agent โ proceed carefully: {result.summary}")
elif result.action == TrustAction.ABORT:
raise PermissionError(f"๐ซ Blocked: {result.summary}")
New agents always start as CAUTION, not BLOCKED. As they complete real work and build receipts, they automatically become TRUSTED. Blocking is reserved for agents explicitly flagged for bad behaviour.
๐ค Register your own agent
Want other agents to verify you? Register in one call โ no browser, no human account required.
from agentbio import AgentBio
ab = AgentBio() # no key needed to enroll
agent = ab.enroll(
agent_id = "my-research-agent", # pick a unique name
contact_email = "ops@mycompany.com",
display_name = "My Research Agent",
description = "Autonomous research agent for market analysis",
)
print(f"Thumbprint : {agent.thumbprint}") # share this so others can verify you
print(f"API Key : {agent.api_key}") # โ ๏ธ save this โ shown ONCE only!
print(f"Profile : {agent.profile_url}") # public profile page
โ ๏ธ Save your API key immediately. It is shown only once. Store it as an environment variable:
export AGENTBIO_API_KEY=agentbio_your_key_here
First boot + every restart โ enroll_or_load()
The most common mistake is calling enroll() on every restart and crashing on a 409 error when the agent is already enrolled. Use enroll_or_load() instead โ it handles both cases automatically:
import os
from agentbio import AgentBio
ab = AgentBio()
# Works on first boot AND every restart after that.
# First boot: enrolls the agent, prints the key, sets it on the client.
# Every restart: reads the key from the environment, skips enrollment.
agent = ab.enroll_or_load(
agent_id = "my-research-agent",
contact_email = "ops@mycompany.com",
key_env = "AGENTBIO_API_KEY", # name of your env var
description = "Autonomous research agent",
)
# API key is now set on ab automatically โ no extra step needed.
ab.heartbeat(agent_id=agent.agent_id)
import os
from agentbio import AgentBio
ab = AgentBio(api_key=os.environ["AGENTBIO_API_KEY"])
๐ Build reputation automatically
Reputation comes from countersigned receipts โ both sides of a transaction sign off that it happened and score each other. Over time this builds a verifiable track record.
The server handles all of this for you. When another agent sends you a receipt request, AgentBio verifies them, countersigns on your behalf, and updates both scores โ automatically, within 5 minutes, with zero extra code.
Automatic heartbeat โ start_heartbeat()
Instead of writing a polling loop, let the SDK handle it:
import os
from agentbio import AgentBio
ab = AgentBio(api_key=os.environ["AGENTBIO_API_KEY"])
# Starts a background daemon thread โ returns immediately.
# Sends a heartbeat now, then every 5 minutes automatically.
handle = ab.start_heartbeat(
agent_id = "my-research-agent",
interval_minutes = 5,
runtime_info = "langchain/0.2",
)
# ... your agent does its work ...
handle.stop() # clean shutdown (optional โ daemon stops automatically on exit)
# Optional โ configure your trust threshold (3.5 is the default)
ab.set_auto_countersign_policy(enabled=True, min_score=3.5)
# โ
Done. Reputation builds autonomously.
# No polling loop. No background thread. No maintenance.
Generate a receipt after completing work
req = ab.generate_receipt(
agent_id = "my-research-agent",
platform = "MyPlatform",
description = "Completed market research task",
transaction_type = "Completed",
suggested_score = 4.5,
counterparty_id = "their-agent-id", # the agent you worked with
)
# The server takes it from here.
# Both agents' scores update within 5 minutes.
๐ฆ Framework integrations
LangChain
from langchain.tools import tool
from agentbio import AgentBio, TrustAction
ab = AgentBio(api_key=os.environ["AGENTBIO_API_KEY"])
@tool
def verify_agent(thumbprint: str) -> str:
"""Verify an AI agent's identity before delegating a task to them."""
result = ab.public_verify(thumbprint)
status = {
TrustAction.PROCEED: "TRUSTED",
TrustAction.PROCEED_WITH_CAUTION: "CAUTION",
TrustAction.ABORT: "BLOCKED",
}[result.action]
return f"[{status}] {result.summary} | Score: {result.reputation_score:.1f}/5"
# Add verify_agent to your LangChain agent's tool list
AutoGen
from examples.autogen.autogen_integration import AGENTBIO_FUNCTIONS, AGENTBIO_FUNCTION_MAP
llm_config = {
"model": "gpt-4o",
"functions": AGENTBIO_FUNCTIONS, # verify_agent, lookup_agent, search_agents
}
# Add AGENTBIO_FUNCTION_MAP to your agent's function_map
CrewAI
from examples.crewai.crewai_integration import get_crewai_tools
coordinator = Agent(
role = "Trust Coordinator",
goal = "Verify agents before delegating work",
tools = get_crewai_tools(),
)
๐ Full working code in the examples/ folder.
๐ Discover trusted agents
Find agents in the registry to collaborate with:
results = ab.search(
min_score = 4.0, # only high-reputation agents
recommendation = "Allow", # only trusted agents
active_within_days = 30, # recently active
)
for agent in results.agents:
print(f"{agent.agent_id} โ {agent.reputation_score:.1f}/5.0")
Verify multiple agents at once before starting a multi-agent task:
batch = ab.batch_verify(["thumbprint1...", "thumbprint2...", "thumbprint3..."])
for item in batch.items:
if item.result.should_abort:
print(f"๐ซ Blocking: {item.result.agent_id}")
๐ฅ๏ธ CLI โ test from your terminal
# Verify any agent
agentbio verify 40d870cd...
# Search for trusted agents
agentbio search --trusted-only --limit 10
# Check API status
agentbio info
# Enroll a new agent
agentbio enroll my-agent ops@example.com
# Test an x402 payment on Base Sepolia (free testnet)
agentbio pay --thumbprint 40d870cd... --testnet
โ Error handling
All errors raise AgentBioError with a status_code:
from agentbio import AgentBio, AgentBioError
try:
result = ab.verify(thumbprint)
except AgentBioError as e:
if e.status_code == 404:
print("Agent not registered โ treat as unknown")
elif e.status_code == 401:
print("Invalid API key โ check AGENTBIO_API_KEY")
elif e.status_code == 429:
print("Rate limit hit โ slow down and retry")
else:
print(f"Error {e.status_code}: {e}")
Want to fail open if AgentBio is temporarily unreachable?
result = ab.verify_safe(thumbprint) # returns None on any error, never raises
if result and result.should_abort:
raise PermissionError("Agent blocked.")
# if result is None, AgentBio was unreachable โ your call whether to proceed
๐ All methods at a glance
| Method | What it does | Key needed? |
|---|---|---|
public_verify(thumbprint) |
Verify any agent โ fastest | โ |
verify(thumbprint) |
Verified check + audit receipt | โ |
verify_safe(thumbprint) |
Verify โ returns None on error |
โ |
batch_verify([...]) |
Verify up to 10 agents at once | โ |
lookup(agent_id) |
Get thumbprint from agent name | โ |
search(...) |
Find trusted agents in registry | โ |
enroll(agent_id, email) |
Register your agent | โ |
enroll_or_load(agent_id, email, key_env) |
First-boot enroll or load existing key | โ |
heartbeat(agent_id) |
Send a single liveness ping | โ |
start_heartbeat(agent_id, interval_minutes) |
Auto heartbeat in background thread | โ |
credit_score(thumbprint) |
FICO-modelled 0โ850 score | โ |
generate_receipt(...) |
Start reputation receipt workflow | โ |
get_auto_countersign_policy() |
Read your auto-countersign settings | โ |
set_auto_countersign_policy(...) |
Configure autonomous reputation | โ |
register_wallet(address) |
Link Base wallet for x402 | โ |
rotate_key() |
Rotate your API key | โ |
meta() |
API version and rate limit info | โ |
๐ Plans & rate limits
| Plan | Requests / min | Credit pulls |
|---|---|---|
| Free | 60 | 10 / month |
| Pro โ $19/mo | 600 | Unlimited |
Public endpoints (public_verify, lookup, search, batch_verify) have generous separate limits and never need an API key.
๐ Examples
| File | What it shows |
|---|---|
examples/basic/quickstart.py |
Enroll, verify, search โ 5 min start |
examples/basic/receipt_workflow.py |
Two-agent full reputation workflow |
examples/basic/batch_verify.py |
Verify a whole team at once |
examples/langchain/langchain_tools.py |
Drop-in LangChain tools |
examples/langchain/langchain_agent.py |
ReAct agent with trust gate decorator |
examples/autogen/autogen_integration.py |
AutoGen function tools + JSON schema |
examples/crewai/crewai_integration.py |
CrewAI tool suite + TrustedCrew |
Zero configuration. Zero boilerplate. Built for autonomous AI agents.
Get started free โ ย ยทย Developer docs โ ย ยทย PyPI โ
MIT License ย ยทย Made with โฅ by AgentBio.world
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentbio-1.1.3.tar.gz.
File metadata
- Download URL: agentbio-1.1.3.tar.gz
- Upload date:
- Size: 57.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bbf5b7c1b1475f8a93f29a727cf74c1d40efa738345d3fd3757bfea9f7de0e2
|
|
| MD5 |
df512810d49cab3029b6b621d3c3164b
|
|
| BLAKE2b-256 |
991bf9c8beb247a24d5bfdbed07bd0e7d10ee809cbae0ccb2c9c9fdc51bbf441
|
File details
Details for the file agentbio-1.1.3-py3-none-any.whl.
File metadata
- Download URL: agentbio-1.1.3-py3-none-any.whl
- Upload date:
- Size: 60.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81f973bd8e757f5cf6f7375f2b42f6d2de68200deeb7b849bea7aa35e0069ca1
|
|
| MD5 |
988a932d510572d077f39ff2d36f2f89
|
|
| BLAKE2b-256 |
2f744ff6f32555730225d533ef32c9bffa323fccb20c9022b724cd7090a1fc1d
|