Black-box contract tests for A2A agents
Project description
a2a-proof
Black-box contract tests for A2A agents.
a2a-proof discovers a deployed agent, sends real A2A requests, and checks its observable
behavior. It needs no access to the agent's source code, framework, prompts, or model provider.
Why
The official A2A TCK checks protocol conformance, and the
A2A Inspector supports interactive debugging.
a2a-proof adds repeatable behavior and lifecycle contracts for local development and CI.
It targets A2A 1.0 over JSON-RPC, HTTP+JSON, and gRPC. The SDK compatibility layer also supports AP2 v0.2.0 agents that expose A2A 0.3 JSON-RPC.
Quick start
uvx a2a-proof init https://agent.example.com
uvx a2a-proof run
init reads the Agent Card and creates a2a-proof.yaml. Add the behavior you depend on:
version: 1
agent:
url: https://agent.example.com
scenarios:
- name: capital of France
message: What is the capital of France?
expect:
state: completed
max_seconds: 10
text:
contains: Paris
$ a2a-proof run
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━┓
┃ Result ┃ Scenario ┃ Trials ┃ Time ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━┩
│ PASS │ capital of France │ 1/1 │ 1.2s │
└────────┴───────────────────┴────────┴──────┘
1 scenario passed in 1.2s
What it covers
- Text, structured data, and file parts.
- Single-turn, multi-turn, repeated, and parallel trials.
- Agent Card, state trajectory, latency, and global leak invariants.
- Task cancellation and persistence through real A2A lifecycle operations.
- Signed AP2 payment and checkout mandate chains.
- Baseline-to-candidate deployment comparison.
- Terminal, JSON, JUnit, and bounded evidence output.
Compare the same contract against a candidate deployment:
a2a-proof diff --against https://candidate-agent.example.com
The diff reports regressions, improvements, changed results, and unchanged results. It compares contract outcomes rather than raw model text; the candidate result controls the exit status.
Documentation
- Writing contracts
- Assertions
- Task lifecycle
- AP2 mandate contracts
- Running in development and CI
- Configuration schema
The schema provides completion and inline validation in YAML-aware editors. init links it
automatically.
Safety
Agent responses and file metadata are treated as untrusted input. Requests, response parts, regular expressions, embedded schemas, evidence, and local file access are bounded. Redirects, credential-bearing URLs, external schema references, and cross-origin interfaces are rejected by default. Remote file URLs are never fetched or written to reports.
See SECURITY.md for private vulnerability reports.
Development
Requires Python 3.11+ and uv.
uv sync --all-groups
uv run ruff format --check .
uv run ruff check .
uv run ty check
uv run python scripts/generate_schema.py --check
uv run pytest --cov=a2a_proof
uv run mutmut run --max-children 1
The test suite includes real JSON-RPC, HTTP+JSON, and gRPC exchanges. See CONTRIBUTING.md for the contribution workflow.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file a2a_proof-0.8.0.tar.gz.
File metadata
- Download URL: a2a_proof-0.8.0.tar.gz
- Upload date:
- Size: 34.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b57320a26283aa75b230783fdfb980bd55c178502b986c294a0fb56766f81b1d
|
|
| MD5 |
291cc57e620c65f47dd0187e8414ddc9
|
|
| BLAKE2b-256 |
4f1f75b93816b2da9debb6a7e9a58574dac0f4ee163f64a1cce39518fe05ae95
|
Provenance
The following attestation bundles were made for a2a_proof-0.8.0.tar.gz:
Publisher:
release.yml on aspix2k/a2a-proof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2a_proof-0.8.0.tar.gz -
Subject digest:
b57320a26283aa75b230783fdfb980bd55c178502b986c294a0fb56766f81b1d - Sigstore transparency entry: 2203398115
- Sigstore integration time:
-
Permalink:
aspix2k/a2a-proof@824078eaa6b541be55f2111e9e02b092e2292e93 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/aspix2k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@824078eaa6b541be55f2111e9e02b092e2292e93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file a2a_proof-0.8.0-py3-none-any.whl.
File metadata
- Download URL: a2a_proof-0.8.0-py3-none-any.whl
- Upload date:
- Size: 41.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43958fe9f9b17ae469a570fd7becf62d382cf162145c154bd1352c7fb25863fa
|
|
| MD5 |
ba2b7609f9e369a5f0004cf74ced4b74
|
|
| BLAKE2b-256 |
50e0c8ab49b2e4797306baab0fae9f4fca038e387f798421e010cd5514a3d4a6
|
Provenance
The following attestation bundles were made for a2a_proof-0.8.0-py3-none-any.whl:
Publisher:
release.yml on aspix2k/a2a-proof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2a_proof-0.8.0-py3-none-any.whl -
Subject digest:
43958fe9f9b17ae469a570fd7becf62d382cf162145c154bd1352c7fb25863fa - Sigstore transparency entry: 2203398125
- Sigstore integration time:
-
Permalink:
aspix2k/a2a-proof@824078eaa6b541be55f2111e9e02b092e2292e93 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/aspix2k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@824078eaa6b541be55f2111e9e02b092e2292e93 -
Trigger Event:
push
-
Statement type: