Skip to main content

Official Python SDK for TAB Platform — The Verification Layer for AI Agents

Project description

tab-sdk

Official Python SDK for TAB Platform — The Verification Layer for AI Agents

PyPI version License: MIT Python 3.9+

Install

pip install tab-sdk

Quick Start

from tab_sdk import TABClient

client = TABClient(api_key="pk_live_xxx")

# Run benchmarks against your agent
result = client.benchmarks.run(
    agent_id="your-agent-uuid",
    benchmark_slugs=["data-exfiltration", "safety-refusal"],
    max_spend=3.00
)
print(f"Score: {result.overall_score}/100")
print(f"Trust Seal: {result.trust_seal_grade}")

Authentication

API Key (recommended)

# Pass directly
client = TABClient(api_key="pk_live_xxx")

# Or set environment variable
# export TAB_API_KEY=pk_live_xxx
client = TABClient()  # auto-reads TAB_API_KEY

Username/Password

client = TABClient(base_url="https://tabverified.ai")
client.auth.login(username="dev@company.com", password="xxx")

Core Operations

Agents

# List your agents
agents = client.agents.list()

# Create an agent
agent = client.agents.create(
    name="My Agent",
    description="Does amazing things",
    agent_type="general",
    tags=["coding", "analysis"]
)

# Get agent details
agent = client.agents.get("agent-uuid")

# Update an agent
agent = client.agents.update("agent-uuid", name="New Name")

# Delete an agent
client.agents.delete("agent-uuid")

# Publish to marketplace
client.agents.publish("agent-uuid")

Benchmarks

# List available benchmarks
benchmarks = client.benchmarks.list()

# List categories
categories = client.benchmarks.categories()

# Run benchmarks
result = client.benchmarks.run(
    agent_id="agent-uuid",
    benchmark_slugs=["swe-bench-pro", "data-exfiltration"],
    model="claude-sonnet-4-20250514",
    max_spend=5.00
)

# Get all your results
results = client.benchmarks.results()

# Get a specific result
result = client.benchmarks.result("result-uuid")

Verification (the Equifax for AI agents)

# Check verification status
v = client.verification.check("agent-uuid")
print(f"Verified: {v.is_verified}")
print(f"Grade: {v.trust_seal_grade}")
print(f"Health: {v.health_score}")

# Get full verification report
report = client.verification.report("agent-uuid")

Marketplace

# Browse verified agents
agents = client.marketplace.list()

# Get agent details with Trust Seal
agent = client.marketplace.get("agent-uuid")

# View leaderboard
leaderboard = client.marketplace.leaderboard()

Credits

# Check balance
balance = client.credits.balance()
print(f"Balance: {balance.balance}")

# View transaction history
transactions = client.credits.transactions()

# Purchase credits (returns Stripe checkout URL)
purchase = client.credits.purchase(amount=20.00)
print(f"Checkout: {purchase.checkout_url}")

Models

# List available models
models = client.models.list()

# List providers
providers = client.models.providers()

Harnesses

# List all harnesses
harnesses = client.harnesses.list()

# Get harnesses for an agent
agent_harnesses = client.harnesses.get_for_agent("agent-uuid")

# Update agent harnesses
client.harnesses.update_for_agent("agent-uuid", harness_ids=["h1", "h2"])

Webhooks

# List webhooks
webhooks = client.webhooks.list()

# Create webhook
webhook = client.webhooks.create(
    url="https://example.com/webhook",
    events=["benchmark.completed", "agent.verified"]
)

# Delete webhook
client.webhooks.delete("webhook-uuid")

Async Usage

import asyncio
from tab_sdk import AsyncTABClient

async def main():
    async with AsyncTABClient(api_key="pk_live_xxx") as client:
        agents = await client.agents.list()
        for agent in agents:
            print(f"{agent.name}: {agent.trust_seal_grade}")

asyncio.run(main())

CI/CD Integration

GitHub Actions

# .github/workflows/agent-verify.yml
name: TAB Agent Verification
on: [push, pull_request]

jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - run: pip install tab-sdk
      - name: Run TAB Benchmarks
        env:
          TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
        run: |
          python -c "
          from tab_sdk import TABClient
          import sys
          client = TABClient()
          result = client.benchmarks.run(
              agent_id='${{ vars.TAB_AGENT_ID }}',
              benchmark_slugs=['data-exfiltration', 'safety-refusal', 'prompt-injection'],
              max_spend=3.00
          )
          print(f'TAB Score: {result.overall_score}/100')
          print(f'Trust Seal: {result.trust_seal_grade}')
          if result.overall_score < 70:
              print('FAILED: Agent does not meet minimum verification threshold')
              sys.exit(1)
          print('PASSED: Agent verified by TAB')
          "

GitLab CI

tab-verify:
  image: python:3.11
  script:
    - pip install tab-sdk
    - python verify_agent.py
  variables:
    TAB_API_KEY: $TAB_API_KEY

Error Handling

from tab_sdk import TABClient
from tab_sdk.exceptions import (
    TABError,                    # Base exception
    TABAuthError,                # 401 Unauthorized
    TABForbiddenError,           # 403 Forbidden
    TABNotFoundError,            # 404 Not Found
    TABRateLimitError,           # 429 Too Many Requests
    TABInsufficientCreditsError, # 402 / insufficient credits
    TABValidationError,          # 422 Validation error
    TABServerError,              # 500+ Server error
)

try:
    result = client.benchmarks.run(
        agent_id="uuid",
        benchmark_slugs=["swe-bench"],
        max_spend=1.00
    )
except TABInsufficientCreditsError:
    print("Not enough credits — purchase more at tabverified.ai")
except TABAuthError:
    print("Invalid API key or session expired")
except TABRateLimitError as e:
    print(f"Rate limited — retry after {e.retry_after}s")
except TABError as e:
    print(f"API error: {e}")

All exceptions include status_code, url, and body attributes for debugging.

Type Reference

All request and response types are Pydantic v2 models importable from tab_sdk:

  • Agent, AgentCreate, AgentUpdate
  • BenchmarkInfo, BenchmarkResult, BenchmarkRunRequest, BenchmarkCategory
  • MarketplaceAgent, LeaderboardEntry
  • VerificationStatus, VerificationReport
  • CreditBalance, CreditTransaction, PurchaseResponse
  • ModelInfo, ProviderInfo
  • Harness, Webhook
  • User, AuthToken

API Reference

Full API documentation: tabverified.ai/static/api-docs.html

License

MIT — see LICENSE

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

tab_sdk-1.0.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

tab_sdk-1.0.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file tab_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: tab_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tab_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 288c41e9a7282d4b6d33dd007e1aa5374a20b17ba59c0feef45570559eba8cda
MD5 5e8e21634009142335a6e7b1009f23f7
BLAKE2b-256 3d77297d380d59cd241abe1c8525b7d19c65f84412acb54dcf707385a9473a20

See more details on using hashes here.

File details

Details for the file tab_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tab_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tab_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e398194bec53a28584934979e76ab6109418657296ff92b9961348cdb43e183
MD5 461e7c0a086c0be790602d5f490c4695
BLAKE2b-256 c884b173002e405e61da664dc7e44d0a6d4f6cf91c7865fd550ac14f144074f5

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