Skip to main content

Verify AI agent identity and reputation before interacting with them.

Project description

agentbio

The trust layer for AI agents

PyPI Python License Live

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 building โœ“
get_auto_dispute_policy() Read your auto-dispute settings โœ“
set_auto_dispute_policy(enabled) Enable/disable automatic dispute filing โœ“
get_succession_policy(agent_id) Read an agent's auto-succession policy โœ“
set_succession_policy(agent_id, ...) Configure autonomous succession on offline โœ“
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.

Get your free 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

agentbio-1.1.5.tar.gz (56.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentbio-1.1.5-py3-none-any.whl (60.6 kB view details)

Uploaded Python 3

File details

Details for the file agentbio-1.1.5.tar.gz.

File metadata

  • Download URL: agentbio-1.1.5.tar.gz
  • Upload date:
  • Size: 56.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for agentbio-1.1.5.tar.gz
Algorithm Hash digest
SHA256 7f6dbecd8b9905a6ebedd4b30a78c42b2fe0c56b6afbfbb5a0975e25a28ff356
MD5 88abfb0b9b870f7cae27d34062f9908f
BLAKE2b-256 0762338a6823c91b4516eaec4efcaa1268de39cadb76642487c2d4711202f002

See more details on using hashes here.

File details

Details for the file agentbio-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: agentbio-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 60.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for agentbio-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6b5ab8efb77e21ac60a6e849fcd2c8b09043219f3a871903f7cafba896d1db8e
MD5 4a7e48f505689b34ce42f261f89bd655
BLAKE2b-256 770a9d4732b37d259f96486b431a8bf819465478740e1d5af01031d34c08170c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page