Skip to main content

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

Metadata

Release files for attest-ai 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attest-ai 0.9.0
File Size Uploaded
attest_ai-0.9.0.tar.gz 438.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for attest-ai 0.9.0
File Interpreter ABI Platform
attest_ai-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 513.7 kB

Release files / attest_ai-0.9.0.tar.gz

Download URL attest_ai-0.9.0.tar.gz
Size 438.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4297ba11b487e33985df95e0dbfa2409dfc07e78949de97d0880630654422b75
BLAKE2b-256 checksum
How to use checksums
713f156b702ddd6c80a8193afd983c8688004a53c5c5764ad4b8fb3b8d724ff3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / attest_ai-0.9.0-py3-none-any.whl

Download URL attest_ai-0.9.0-py3-none-any.whl
Size 75.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7788fe7c48fb12bf3b2fbd44fe3c51217438db3ec50b55a59b8ed8f969cbada5
BLAKE2b-256 checksum
How to use checksums
cf644f7bd9edaa7fb2a353b651fd8e9174bdb508cce893707dae77ed6ad83f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page