AgentSpec is a testing framework for non-deterministic AI behavior. Write tests in YAML, catch regressions before they ship, and see exactly what changed.
contains_any, contains_all, regex — assertions that handle the variability of AI responses without flaky tests.
Assert on tool_called, max_latency_ms, max_tokens — verify not just what the agent said, but what it did.
Check if responses are semantically on-topic, even when the exact words differ. No API calls needed.
Extract and verify specific fields from JSON agent outputs. Perfect for structured API responses.
Exit codes, JUnit XML, JSON output. GitHub Action included. Drop into any CI pipeline.
No cloud, no account, no telemetry. Tests run on your machine, in your CI, on your terms.
# agentspec.yaml name: "support agent" tests: - name: "handles expired token" input: "my token expired" expect: contains: "refresh token" not_contains: "I don't know" max_latency_ms: 5000 - name: "routes billing question" input: "I want a refund" expect: contains_any: ["billing", "refund", "support"] tool_called: "transfer_to_billing"
• Exact string matching
• No tool_called assertion
• No latency/token gates
• No semantic similarity
• No AI behavior diffs
• Built for deterministic code
• Non-deterministic matching
• tool_called, max_latency_ms, max_tokens
• Semantic similarity built-in
• JSON path extraction
• Behavior diff reports (soon)
• Built for AI agents