Skip to main content

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

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

attest_ai-0.9.0.tar.gz (438.3 kB view details)

Uploaded Source

Built Distribution

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

attest_ai-0.9.0-py3-none-any.whl (75.4 kB view details)

Uploaded Python 3

File details

Details for the file attest_ai-0.9.0.tar.gz.

File metadata

  • Download URL: attest_ai-0.9.0.tar.gz
  • Upload date:
  • Size: 438.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for attest_ai-0.9.0.tar.gz
Algorithm Hash digest
SHA256 4297ba11b487e33985df95e0dbfa2409dfc07e78949de97d0880630654422b75
MD5 4503948aaa2ce5d67eb4064153c54a51
BLAKE2b-256 713f156b702ddd6c80a8193afd983c8688004a53c5c5764ad4b8fb3b8d724ff3

See more details on using hashes here.

File details

Details for the file attest_ai-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: attest_ai-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 75.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for attest_ai-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7788fe7c48fb12bf3b2fbd44fe3c51217438db3ec50b55a59b8ed8f969cbada5
MD5 b46f53f55233c56821e4c608f2f2a9d0
BLAKE2b-256 cf644f7bd9edaa7fb2a353b651fd8e9174bdb508cce893707dae77ed6ad83f69

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