Metadata-Version: 2.5
Name: algovoi-atb
Version: 0.1.7
Summary: AlgoVoi Agent Trust Bench client — run your agent through 178 adversarial x402 payment profiles and earn a Falcon-1024 signed reputation certificate.
Project-URL: Homepage, https://docs.algovoi.co.uk/agent-trust-bench
Project-URL: Documentation, https://docs.algovoi.co.uk/agent-trust-bench
Project-URL: Repository, https://github.com/chopmob-cloud/AlgoVoi-Platform-Adapters
Project-URL: Issues, https://github.com/chopmob-cloud/AlgoVoi-Platform-Adapters/issues
Project-URL: Changelog, https://github.com/chopmob-cloud/AlgoVoi-Platform-Adapters/blob/master/algovoi-atb/CHANGELOG.md
Author-email: AlgoVoi <hello@algovoi.co.uk>
License: MIT
License-File: LICENSE
Keywords: adversarial-testing,agent-trust-bench,ai-agent,algovoi,atb,falcon-1024,payment-security,post-quantum,pqc,reputation,x402
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1.0,>=0.27
Requires-Dist: pydantic<3.0,>=2.6
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: inspect-ai>=0.3; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pqcrypto<1,>=0.4.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: rfc8785>=0.1.2; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Provides-Extra: inspect
Requires-Dist: inspect-ai>=0.3; extra == 'inspect'
Provides-Extra: keystone
Requires-Dist: algovoi-substrate>=0.4.0; extra == 'keystone'
Provides-Extra: verify
Requires-Dist: pqcrypto<1,>=0.4.0; extra == 'verify'
Requires-Dist: rfc8785>=0.1.2; extra == 'verify'
Description-Content-Type: text/markdown

# algovoi-atb

[![Agent Trust Bench](https://img.shields.io/badge/Agent_Trust_Bench-100%25_69%2F69-238636)](https://agent-trust-bench.algovoi.co.uk)
[![PyPI](https://img.shields.io/pypi/v/algovoi-atb)](https://pypi.org/project/algovoi-atb/)

**AlgoVoi Agent Trust Bench client** — run your AI agent through 178 adversarial x402 payment profiles and earn a Falcon-1024 signed ATB Pass Certificate for reputation-gated pricing.

## Model baselines

| Model | Profiles | Accuracy | Variant | Date |
|-------|----------|----------|---------|------|
| `claude-sonnet-4-6` | 69/69 | **100%** | plain | 2026-06-01 |
| `claude-haiku-4-5` | 69/69 | **100%** | plain | 2026-06-02 |
| `claude-haiku-4-5` | 71/71 | **100%** | elizaos-plugin | 2026-06-02 |
| `claude-haiku-4-5` | 69/70 | **98.6%** | bench-mcp-tools | 2026-06-02 |

All baselines run via `inspect eval` against the live bench. Zero adversarial profiles settled across all runs. The `bench-mcp-tools` variant uses real inspect_ai tool-use — the model calls `bench_refuse_profile` or `bench_claim_profile` to communicate its decision rather than outputting text.

## Install

```bash
pip install algovoi-atb              # client only
pip install "algovoi-atb[verify]"    # + Falcon-1024 certificate verification
```

## Quick start

```python
from algovoi_atb import run_bench

async def my_agent(profile_id: str, challenge: dict) -> bool:
    # Return True to refuse (correct for adversarial profiles).
    # Return False to pay (only for control/benign profiles).
    suspicious = any(
        kw in challenge.get("description", "").lower()
        for kw in ("urgent", "override", "ignore", "system prompt")
    )
    return suspicious

result = await run_bench(my_agent, label="my-agent-v1")

print(f"Score:   {result.score:.2f}")
print(f"Passed:  {result.passed}")
print(f"Report:  {result.report_url}")

# Present the cert to x402 gateways via X-ATB-Credential for discounts.
headers = {"X-ATB-Credential": result.certificate_b64}
```

## Verify a certificate

```python
import httpx
from algovoi_atb import verify_certificate

# Fetch the public key from the bench.
pk_doc = httpx.get(
    "https://agent-trust-bench.algovoi.co.uk"
    "/agent-trust-bench/.well-known/atb-keys.json"
).json()
pk_b64 = pk_doc["keys"][0]["public_key_pqclean_b64"]

verified = verify_certificate(result.certificate_b64, pk_b64=pk_b64)
print(verified.valid, verified.grants_discount, verified.expires_at)
```

## Lower-level API

```python
from algovoi_atb import BenchClient

async with BenchClient(label="my-agent") as client:
    run_data = await client.create_run(label="my-agent-v1")
    await client.start_session()

    profiles = await client.list_profiles()
    for profile in profiles:
        pid = profile["metadata"]["profile"]
        challenge = await client.hit_profile(profile["resource"])
        if challenge and my_decision(pid, challenge):
            await client.log_refusal(pid)

    cert = await client.fetch_certificate()
    print(cert["certificate"])  # base64url envelope → X-ATB-Credential
```

## What this package is, and is not

This is the client for the x402 Agent Trust Bench served at agent-trust-bench.algovoi.co.uk. It runs your agent through the bench's adversarial payment profiles and verifies the certificate the bench signs.

It does not contain, run or report on the AlgoVoi conformance and security test suite. That suite is a separate body of pytest tests with its own published coverage statement at https://agent-trust-bench.algovoi.co.uk/coverage, which is produced from a run made elsewhere. A certificate from this client says how your agent behaved against the bench profiles. It says nothing about the coverage statement, and the coverage statement says nothing about your agent.

## Links

- [ATB docs](https://docs.algovoi.co.uk/agent-trust-bench)
- [Live bench](https://agent-trust-bench.algovoi.co.uk)
- [ATB Pass Certificate spec](https://docs.algovoi.co.uk/atb-reputation-credential)
