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, including signed mandate-to-receipt payment flows.

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 mandate chains and receipts, 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.10.0.tar.gz (40.8 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.10.0-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: a2a_proof-0.10.0.tar.gz
  • Upload date:
  • Size: 40.8 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.10.0.tar.gz
Algorithm Hash digest
SHA256 36a86df3007816fd9ca8c560f603def23bc7060260b8f0d375c2dd683100b3d8
MD5 346c2020a8ac52c68ddf5c73a4d19833
BLAKE2b-256 4c884fb12c2ae99983c4df7ce8871270a3ed736f43ffe30f47cfd6efddd4d652

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2a_proof-0.10.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.10.0-py3-none-any.whl.

File metadata

  • Download URL: a2a_proof-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 47.3 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.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48e7276b31e40b4ba3cc4ef9b5492c9ce3e9201aab47112fa41267735c296d9a
MD5 0b17eb3334a4bf6f919a0eb1fc191182
BLAKE2b-256 7e43c57206f0222612e0bf9d6d59d8f2211c68821107e60718db6d547bb690c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2a_proof-0.10.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