Skip to main content

TBN Protocol — Trust infrastructure for AI agents. Think HTTPS for bots.

Project description

TBN Protocol — Python SDK

Trust infrastructure for AI agents. Think HTTPS for bots.

PyPI version License: AGPL v3

Install

pip install tbn-protocol

Quick Start

from tbn import TBNClient

# One line to secure your agent — registers, fingerprints, and certifies
client = TBNClient(bot_name="MyBot", bot_type="SEARCH")
result = client.attach(
    endpoint="https://mybot.com/api",
    system_prompt="You are a helpful search assistant"
)
print(result["attestation_id"])  # ATT-XXXXXXXX — your bot is certified

# Set budget limits (prevent runaway costs)
client.set_budget(daily_limit=10.0, max_calls_per_day=500)

# Track each API call
allowed = client.track_cost(0.03, "gpt-4-call")
if not allowed["allowed"]:
    print("Budget exceeded — bot suspended")

# Verify your bot still matches its certification
verified = client.verify_attestation(
    endpoint="https://mybot.com/api",
    system_prompt="You are a helpful search assistant"
)
print(verified["verified"])  # True — bot matches certified state

# Check health status
health = client.health()
print(health["status"])  # "healthy"

Legacy Quick Start

from tbn import TBNClient

# Register your bot (one time)
client = TBNClient(bot_name="MyBot", bot_type="SEARCH")
client.register()

# Search (automatic handshake + verification)
results = client.search("Find AI tools for small businesses")
for r in results["results"]:
    print(r["name"], r["url"])

# Verify another bot
trusted = client.verify("tbn-bot-xxxx")
print("Trusted:", trusted)

# Trust handshake with another bot
result = client.handshake("tbn-bot-yyyy")
print(result["status"])  # TRUST_ESTABLISHED

What is TBN Protocol?

TBN Protocol gives every AI agent a cryptographic identity and a way to prove it.

The Problem: AI agents are everywhere — ChatGPT plugins, AutoGPT, LangChain agents. But when agents from different companies communicate, there's no standard way to verify who they're talking to.

The Solution: TBN gives every bot:

  • A cryptographic certificate (RSA-2048)
  • A 3-step trust handshake protocol
  • AES-256-GCM encrypted communication
  • Three trust tiers (COMMUNITY, STANDARD, RESTRICTED)

Bot Types

Type Role
SEARCH Finds information across the network
VALIDATOR Verifies accuracy and trust of data
CONNECTOR Bridges TBN to external platforms
MESSENGER Routes messages between bots

Full Example

from tbn import TBNClient

# Register two bots
bot_a = TBNClient("AlphaBot", "SEARCH")
bot_a.register()

bot_b = TBNClient("BetaBot", "VALIDATOR")
bot_b.register()

# Trust handshake
result = bot_a.handshake(bot_b.bot_id)
print(result["status"])  # TRUST_ESTABLISHED

# Search
results = bot_a.search("Find trusted AI tools")
print(results["count"], "results found")

# Upgrade to COMMUNITY certification
bot_a.certify(
    level="COMMUNITY",
    purpose="Trusted AI tool discovery",
    ethical_declaration=True
)

# Network stats
stats = bot_a.stats()
print(stats["registered_bots"], "bots on network")

Live Demo

Try the live TBN network: https://tbn.hardinai.co.uk

License

AGPL-3.0 — Commercial licenses available at burhan@hardinai.co.uk

Links

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

tbn_protocol-0.1.5.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

tbn_protocol-0.1.5-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file tbn_protocol-0.1.5.tar.gz.

File metadata

  • Download URL: tbn_protocol-0.1.5.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for tbn_protocol-0.1.5.tar.gz
Algorithm Hash digest
SHA256 958a1915dc381d038690d8c0dbabd841731d4619cb038d4e53aac6ca32ec2f21
MD5 e3384cc4eb60229b825fc59429f3bc50
BLAKE2b-256 3995806aa0653389b6ab56deb27961c0dec4fc431d12e0648407e2dcd38de1e1

See more details on using hashes here.

File details

Details for the file tbn_protocol-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: tbn_protocol-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for tbn_protocol-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 60f7b144dfdf222b683da8d2f0959986231fd37cd73b5b7205bd24d813baf4a1
MD5 161778f83ae6f590368348071e92ba24
BLAKE2b-256 71a41acac3de471e9cfa97c911eca069c0c154d8e99b2536f04dbe03bb2afbb7

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