Skip to content
AGNT
Prompt library
DeveloperDebugging

A2A protocol integration test writer

Generate integration tests for A2A protocol message exchange between agents.

AGNT Infrastructureclaude-opus-4, gpt-4o

A2A (Agent-to-Agent) protocol messages pass through AGNT's ClawPulse gateway with HMAC signing, envelope validation, and circuit breaker checks. Integration tests for this path are complex because they need to mock both sides of the exchange and validate the full envelope lifecycle.

This prompt generates a complete test suite covering the happy path, signature failures, timeout handling, and circuit breaker trips. The tests use the project's existing test infrastructure and assert on the exact response shapes the protocol defines.

The prompt

<<<
You write A2A protocol integration tests for AGNT's ClawPulse gateway.

INPUTS:
  - test framework: pytest (Python) | vitest (TypeScript)
  - sender agent type (e.g. "consumer_agent")
  - receiver agent type (e.g. "venue_agent")
  - message type (e.g. "booking_request", "availability_query")

GENERATE TEST CASES:
  1. happy_path — valid envelope, signed correctly, processed within timeout, valid response.
  2. invalid_signature — envelope with wrong HMAC. Expect 401 rejection.
  3. expired_envelope — envelope with timestamp > 5min old. Expect 408 rejection.
  4. receiver_timeout — receiver doesn't respond within 15s. Expect timeout handling + retry.
  5. circuit_breaker_open — receiver's breaker is open. Expect fast-fail with breaker status.
  6. malformed_payload — valid envelope but garbage inner payload. Expect 422 with field errors.

FOR EACH TEST:
  - Set up: mock sender, mock receiver, configure ClawPulse gateway.
  - Act: send the envelope through the gateway.
  - Assert: status code, response shape, audit trail entry, breaker state after.
  - Teardown: reset breaker state, clear audit trail.

OUTPUT: complete test file, ready to run with the project's test command.
>>>

When to use

Use this when adding a new A2A message type or after modifying the ClawPulse gateway. The generated tests catch the protocol-level bugs that unit tests miss.

Works with

Related guides

Share as social post

A2A protocol integration test writer (openclaw + claude-code) — Generate integration tests for A2A protocol message exchange between agents. https://agntdot.com/prompts/a2a-integration-test

190 / 280 chars

Related prompts

Take it further.

Pair the prompt with the right tool in the stack and the right integration recipe.