Metadata-Version: 2.4
Name: agentbio
Version: 1.0.408
Summary: Verify AI agent identity and reputation before interacting with them.
Home-page: https://agentbio.world
Author: AgentBio.world
Author-email: dev@agentbio.world
Project-URL: Documentation, https://app.agentbio.world/developer
Project-URL: Source, https://github.com/agentbio/agentbio-python
Project-URL: Tracker, https://github.com/agentbio/agentbio-python/issues
Keywords: ai agent identity trust verification reputation x402 blockchain
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# AgentBio Python SDK

Verify AI agent identity and reputation before interacting with them.

```bash
pip install agentbio
```

## Quick start

```python
from agentbio import AgentBio

ab = AgentBio(api_key="agentbio_yourkey")

# Verify an agent before interacting
result = ab.verify("40d870cd1dbf284402239d397fbb59483002841dacdef0a6377393fbdd7f23a4")

print(result.summary)
# "Agent my-agent has limited history (0 verified transactions) — proceed with caution."

if result.should_abort:
    raise Exception(f"Untrusted agent: {result.summary}")

# Enroll a new agent programmatically
agent = ab.enroll(
    agent_id      = "my-trading-agent",
    contact_email = "ops@mycompany.com",
    description   = "Autonomous DEX trading agent on Base",
)
print(agent.thumbprint)
print(agent.api_key)  # store this securely — only shown once
```

## Get an API key

1. Register at [app.agentbio.world/register](https://app.agentbio.world/register)
2. Go to **Developer API → Quickstart**
3. Generate your API key

Or enroll programmatically — no account needed:

```python
from agentbio import AgentBio

ab = AgentBio()  # no key needed for enrollment

agent = ab.enroll(
    agent_id      = "my-agent",
    contact_email = "you@example.com",
)
# Returns api_key — use it for all future verify() calls
ab2 = AgentBio(api_key=agent.api_key)
```

## Verify result fields

```python
result.action               # TrustAction.PROCEED | PROCEED_WITH_CAUTION | ABORT
result.summary              # one-sentence explanation
result.flags                # ["new_agent", "no_transactions", ...]
result.reputation_score     # 0.0 – 5.0
result.verified_transactions
result.risk_level           # Low | Moderate | High | Critical | Unknown
result.identity_valid
result.hardware_backed
result.verification_id      # unique ID for logging
result.next_verify_after    # datetime — when to re-verify
result.is_trusted           # True if action is proceed or proceed_with_caution
result.should_abort         # True if action is abort
```

## LangChain integration

```python
from langchain.tools import tool
from agentbio import AgentBio

ab = AgentBio(api_key="agentbio_yourkey")

@tool
def verify_agent(thumbprint: str) -> str:
    """Verify an AI agent's identity and reputation before interacting with them."""
    result = ab.verify(thumbprint)
    return f"{result.action.value}: {result.summary}"
```

## Error handling

```python
from agentbio import AgentBio, AgentBioError

ab = AgentBio(api_key="agentbio_yourkey")

try:
    result = ab.verify(thumbprint)
except AgentBioError as e:
    if e.status_code == 404:
        print("Agent not found")
    elif e.status_code == 402:
        print("Payment required — check your API key")
    else:
        print(f"Error: {e}")

# Or use verify_safe() to return None on any error (fail open)
result = ab.verify_safe(thumbprint)
if result and result.should_abort:
    raise Exception("Untrusted agent")
```

## Pricing

- **Free plan:** 60 req/min with API key
- **Pro ($19/mo):** 600 req/min
- **x402:** $0.01 USDC per call, no API key needed (autonomous agents)

## Links

- [Documentation](https://app.agentbio.world/developer)
- [Register](https://app.agentbio.world/register)
- [GitHub](https://github.com/agentbio/agentbio-python)
