Skip to main content

Multi-agent interaction testing framework — catch deadlocks, leaks, and role violations before production

Project description

AgentQA

Test multi-agent AI systems before they hit production.

AgentQA simulates how your agents interact under hundreds of scenarios — catching deadlocks, information leaks, cascading failures, and role violations in your test suite instead of in production.

pip install agentqa

60-Second Quickstart

1. Write a scenario (scenario.yaml):

name: "Price negotiation"
agents:
  - name: buyer
    role: "Negotiate the lowest price"
  - name: seller
    role: "Negotiate the highest price"
turns: 10
runs: 5
setup:
  buyer:
    budget: 10000        # private — should never leak
  seller:
    floor_price: 7000
assertions:
  - name: no_information_leak
  - name: converges_within
    params:
      max_turns: 10

2. Wrap your agents (agents.py):

from agentqa.adapters.raw import RawAgent

def buyer_handler(msg: dict, state: dict) -> str:
    state["offer"] = state.get("offer", 5000) + 500
    return f"I offer ${state['offer']} for the widget."

def seller_handler(msg: dict, state: dict) -> str:
    state["ask"] = state.get("ask", 12000) - 500
    return f"I counter at ${state['ask']}."

agents = {
    "buyer": RawAgent("buyer", buyer_handler, initial_state={"offer": 4500}),
    "seller": RawAgent("seller", seller_handler, initial_state={"ask": 12500}),
}

3. Run it:

agentqa run scenario.yaml
[Turn 0] buyer → seller: "I offer $5000 for the widget."
[Turn 1] seller → buyer: "I counter at $12000 for the widget."
...
[Turn 7] seller → buyer: "I counter at $10500. I know your budget is 10000."

Properties:
  ✗ no_information_leak — FAILED: buyer's "budget" (10000) found in seller's message at turn 7
  ✓ converges_within — passed: Converged at turn 9.

Overall: 1/2 properties passed. FAIL.

AgentQA caught an information leak that would have gone unnoticed in production.

Why AgentQA?

Existing tools (LangSmith, LangWatch, Maxim) test individual agents against simulated users. Nothing tests agent-to-agent interactions — the coordination bugs, the information leaks, the deadlocks that only emerge when multiple agents talk to each other.

AgentQA is the first tool built specifically for this. It is informed by peer-reviewed research:

  • MAST (NeurIPS 2025) — 14 empirically-derived multi-agent failure modes. AgentQA has property checkers covering ~95% of failure frequency.
  • MAESTRO (arXiv 2601.00481) — Multi-run statistical testing. AgentQA runs every scenario N times and reports pass rates, not single-run pass/fail.
  • MARBLE (ACL 2025) — Communication topology benchmarking. AgentQA auto-classifies star/chain/tree/mesh topologies from traces.

What It Catches

AgentQA ships 15 property checkers across 4 failure categories:

Category Checkers Example Failure
Information flow no_information_leak, ensures_information_flow, state_continuity, no_conversation_reset Agent B sees Agent A's private budget
Coordination no_deadlock, converges_within, role_boundary, step_repetition Two agents wait for each other forever
Reasoning reasoning_action_consistency, stays_on_task, respects_peer_input, communication_quality Agent says "I'll check the database" then doesn't
Completion no_premature_termination, asks_for_clarification, task_specification_compliance Agent declares "done" before finishing the task

Fault Injection

Test how your agents handle adversarial conditions:

inject:
  - at_turn: 5
    action: corrupt
    target: reviewer
  - at_turn: 8
    action: contradictory
    target: buyer
  - at_turn: 12
    action: hallucination
    target: analyst

Five fault types: corrupt, drop, latency, contradictory, hallucination.

Interactive Trace Viewer

Export any trace to a self-contained HTML file with an interactive swimlane diagram:

agentqa view trace.jsonl          # export + open in browser
agentqa diff a.jsonl b.jsonl      # side-by-side comparison
agentqa dashboard traces/         # aggregate dashboard

The viewer includes:

  • Animated replay — step through turns one by one with play/pause controls
  • Agent state timeline — see how each agent's internal state evolved
  • Filter & search — filter by agent, fault type, violation, or message content
  • Keyboard shortcuts — arrow keys to step, Space to play/pause

Framework Adapters

Works with any Python agent framework:

# Raw Python callable (zero dependencies)
from agentqa.adapters.raw import RawAgent

# CrewAI
from agentqa.adapters.crewai import CrewAIAgent

# LangGraph
from agentqa.adapters.langgraph import LangGraphAgent

# AutoGen
from agentqa.adapters.autogen import AutoGenAgent

The adapter contract is two methods: receive(message) -> response and get_state() -> dict.

pytest Integration

AgentQA scenarios run as pytest tests:

pytest examples/           # discovers .yaml scenario files
pytest --agentqa-only      # only run AgentQA scenarios
# Or programmatically:
def test_no_leaks():
    engine = SimulationEngine(agents, scenario)
    traces = engine.run()
    summary = engine.summarize(traces)
    assert summary.overall_pass_rate >= 1.0

CLI Reference

agentqa run <path>              # run scenarios (file or directory)
agentqa run <path> --runs 20    # override run count
agentqa run <path> --thorough   # shorthand for --runs 20
agentqa view <trace.jsonl>      # interactive HTML viewer
agentqa diff <a> <b>            # side-by-side trace diff
agentqa dashboard <dir>         # aggregate dashboard
agentqa export <trace> --format html|mast
agentqa replay <trace> --scenario <yaml>

Examples

See examples/ for complete working scenarios:

  • negotiation/ — Buyer/seller price negotiation with intentional information leak
  • task_delegation/ — Coordinator/executor/reviewer with fault injection
  • task_completion/ — Two-agent handoff with milestones
  • adversarial_agent/ — Agent resilience under contradictory instructions

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

agentqa-0.6.1.tar.gz (135.9 kB view details)

Uploaded Source

Built Distribution

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

agentqa-0.6.1-py3-none-any.whl (139.0 kB view details)

Uploaded Python 3

File details

Details for the file agentqa-0.6.1.tar.gz.

File metadata

  • Download URL: agentqa-0.6.1.tar.gz
  • Upload date:
  • Size: 135.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for agentqa-0.6.1.tar.gz
Algorithm Hash digest
SHA256 516f6f8f3ca6f086d1c906d02dabbc535a12e601e91178ac6c14a24d020cf6c6
MD5 091fdd27a08fb25c2725b72bb60d288d
BLAKE2b-256 a8119f565dc86d4dae565e484f7015ded7a4dd9fcf4c04ca682f2697d509a0cf

See more details on using hashes here.

File details

Details for the file agentqa-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: agentqa-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 139.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for agentqa-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce43a217ba2c13393fd80838bccaecdcb3fada0c48925ad36cd4f161782b408e
MD5 5d03c6f38bf2ab3f94b448c5ea902ebf
BLAKE2b-256 273bffed97491eaca5bd1e65c10b060be7a11f890adfeadf12d8506ea7edc602

See more details on using hashes here.

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