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.

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.
  • 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.7.0.tar.gz (31.2 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.7.0-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: a2a_proof-0.7.0.tar.gz
  • Upload date:
  • Size: 31.2 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.7.0.tar.gz
Algorithm Hash digest
SHA256 19e28a5f2663953dae18b87554e8b08b3aa148f2fefdde997144919c1ce5df6b
MD5 b6f81a8a2d34412eccd8542788b52e85
BLAKE2b-256 e1824d5d8de41dcaed077e59edae85282423c8d57cce4f99d4399a9f9c009247

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: a2a_proof-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 36.9 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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99632193527093ade736d84677d2be5dfddb06e9fab4baa9685735d913256830
MD5 0f1b56fad8d4b5163765394bf8b63234
BLAKE2b-256 3db2b99a99a2940df2ee8b1a90376f75b7d009717c01c319a91c8ec328331604

See more details on using hashes here.

Provenance

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