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.

The official A2A TCK checks protocol conformance, A2A ITK checks interoperability between SDKs, and the A2A Inspector supports interactive debugging. a2a-proof adds repeatable contracts for the behavior of your deployed agent.

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.

What you can prove

Risk Contract
A prompt, model, or backend change alters an answer Text, structured data, JSON Schema, and file integrity assertions
An LLM succeeds only some of the time or gets slower Repeated trials, pass rates, parallel runs, and p50/p95 latency
A long-running task breaks after acceptance State trajectories, stream resumption, cancellation, persistence, and push delivery
Staging no longer behaves like production Agent Card preflight and deployment diff
Agent text leaks a secret or system prompt Global invariants and bounded failure evidence
An agent produces an invalid payment proof Signed AP2 mandate-chain and receipt verification

Quick start

uvx a2a-proof init https://agent.example.com

init reads the Agent Card and creates a2a-proof.yaml. Replace its smoke scenario with behavior your users depend on:

version: 1

agent:
  url: https://agent.example.com

defaults:
  trials: 5
  pass_rate: 0.8

scenarios:
  - name: billing dispute routing
    message: A customer says their card was charged twice for order 4815.
    latency:
      p95_seconds: 15
    expect:
      state: completed
      data:
        - path: /queue
          equals: billing-disputes
        - path: /priority
          matches: "(?i)^high$"
$ uvx a2a-proof run
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━┓
┃ Result ┃ Scenario                ┃ Trials ┃ Time ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━┩
│ PASS   │ billing dispute routing │    4/5 │ 3.2s │
└────────┴─────────────────────────┴────────┴──────┘

1 scenario passed in 3.2s

Run one scenario, save failure evidence, or compare the same contract against another deployment:

uvx a2a-proof run --scenario "billing dispute routing"
uvx a2a-proof run --format junit --output a2a-proof.xml --evidence evidence
uvx a2a-proof diff --against https://candidate-agent.example.com

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.

Contributions follow CONTRIBUTING.md. Licensed under the MIT License.

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.13.0.tar.gz (47.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.13.0-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: a2a_proof-0.13.0.tar.gz
  • Upload date:
  • Size: 47.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.13.0.tar.gz
Algorithm Hash digest
SHA256 71d4d09eb1479b4281f069e5a5dcbb320f9c78ef69d96482190197a5dc08b9fd
MD5 dffbd6e0d02f9deaa154d2105266c400
BLAKE2b-256 e6ca7724617cd3b537c3bb9c0c6fed4fa838b1251cf5005198b57cca57595cae

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: a2a_proof-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 55.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.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c92e6eeaff657cb8c736b8ab6cf2074300478e1fdd1b84d0cf874dd16752c00
MD5 1a172a30262cc3dad83ec0f901e5080a
BLAKE2b-256 efda2a82216c97cfc008953a44efaa816ae990fc4794457f17c171e0a53d214b

See more details on using hashes here.

Provenance

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