Test framework for AI agents
Project description
attest-ai
Test framework for AI agents. Deterministic assertions (schema validation, cost constraints, trace ordering, content matching) over agent execution traces.
Install
pip install attest-ai
With LLM provider support:
pip install attest-ai[openai] # OpenAI
pip install attest-ai[anthropic] # Anthropic
pip install attest-ai[gemini] # Google Gemini
pip install attest-ai[ollama] # Ollama (local)
pip install attest-ai[all] # All providers
Quick start
import attest
from attest import expect
result = attest.AgentResult(
trace=trace, # captured from your agent
assertion_results=[],
)
# Layer 1: Schema validation
expect(result).output_matches_schema({"type": "object", "required": ["refund_id"]})
# Layer 2: Cost & performance constraints
expect(result).cost_under(0.05)
expect(result).latency_under(5000)
# Layer 3: Trace structure
expect(result).tools_called_in_order(["lookup_order", "process_refund"])
expect(result).no_tool_loops(max_iterations=3)
# Layer 4: Content assertions
expect(result).output_contains("refund")
expect(result).output_not_contains("sorry")
Pytest integration
Attest registers as a pytest plugin automatically:
pytest tests/ --attest-engine=/path/to/attest-engine
Links
- Repository
- Contributing
- License (Apache-2.0)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
attest_ai-0.3.0.tar.gz
(340.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
attest_ai-0.3.0-py3-none-any.whl
(44.2 kB
view details)
File details
Details for the file attest_ai-0.3.0.tar.gz.
File metadata
- Download URL: attest_ai-0.3.0.tar.gz
- Upload date:
- Size: 340.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a53d57c58e7d442b31f0cb73e06657a4a99ba3bf0495e2c70a798877d9dbb2d5
|
|
| MD5 |
04cd4bdafbe05de67923907e1ae7a07d
|
|
| BLAKE2b-256 |
f4bb4445b703e19b69235a0bb106712cf93346dc67e013598f64e102fcdd600a
|
File details
Details for the file attest_ai-0.3.0-py3-none-any.whl.
File metadata
- Download URL: attest_ai-0.3.0-py3-none-any.whl
- Upload date:
- Size: 44.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eedc7b93f80f43c8f8457ed00f2cb76fe21ea8d3fb91bb3e8c73c3b4eb9a1203
|
|
| MD5 |
040f8373a2fc98de3fb7e5ab7eb3ccf4
|
|
| BLAKE2b-256 |
172b1f99da9ef96c90b4077b1a69a02a25b9ad8da44b16ac9b7a91e516d4ab43
|