Skip to main content

Black-box contract tests for A2A agents

Project description

a2a-proof

CI Coverage Release PyPI Python

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, including offline inspection.
  • 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2a_proof-0.9.0.tar.gz (37.5 kB view details)

Uploaded Source

Built Distribution

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

a2a_proof-0.9.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file a2a_proof-0.9.0.tar.gz.

File metadata

  • Download URL: a2a_proof-0.9.0.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for a2a_proof-0.9.0.tar.gz
Algorithm Hash digest
SHA256 e7c287ec7c62f810ad01a94245c59241505fc6721c4d19c32a127dd8ac7eb5e0
MD5 7c64d666744b2bf143fd2851a25633b8
BLAKE2b-256 5de20a6f8252f04aee2c05e1022241f94301daca6fbee274e3b875327ee5dc13

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2a_proof-0.9.0.tar.gz:

Publisher: release.yml on aspix2k/a2a-proof

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file a2a_proof-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: a2a_proof-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for a2a_proof-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0691c05bf15e22245186c66a7af30bf3777875812909ae60d5adb65c6351b15
MD5 6fb973abdf1c7818d4f20511921b688b
BLAKE2b-256 dbb9595fe2b6bb4ba243faa677b25a299d8522775ab991104963c6c7c41662ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2a_proof-0.9.0-py3-none-any.whl:

Publisher: release.yml on aspix2k/a2a-proof

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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