Skip to main content

Maida

Don't let broken agent changes merge.

PyPI version Python versions Tests License Docs

The Maida timeline viewer showing a demo support agent run flagged with a loop warning: seven tool calls where the baseline had three, with search_kb repeated five times

A real run, caught. The agent returned a normal answer -- and looped search_kb five times to get there.


Your agent still returns the right answer -- but now it calls 3x the tools. A retry loop that wasn't there last week. A new tool the baseline has never seen. Output evals pass. Review sees a green diff. It ships.

Maida is the pre-merge behavioral regression gate for AI agents. It compares agent execution traces against checked-in baselines and blocks PRs when structural behavior regresses.

🔒 No cloud or account required. No usage collection by default. Traces stay on your machine or CI runner. Optional usage counts require explicit consent and a configured collector; no collector is configured by default.

Start with one useful check

This checkout targets v0.6.0, supporting Python 3.12–3.14. Use the explicit version pin below; see the changelog for changes and migration from 0.5.x.

uv tool install "maida-ai==0.6.0"
maida demo --regression

Expect a FAIL verdict and a PR-comment preview: the simulated agent still answers, but loops and calls an unexpected tool. The demo command exits 0 after successfully showing the failing gate; an actual failed gate exits 1. No clone, API keys, or account are needed for this rehearsal.

Protect one coding-agent task →

Start with a one-minute task in your repository, such as finding its test command, and get a report on that actual execution. Allow 10–15 minutes for capture setup and the first check. Review a small baseline and policy when that result is useful; deliberate failure, repair, and CI come next. This is a setup target, not a measured activation claim.

Building a Python tool-calling agent? Use the secondary Python walkthrough, including installation into the project environment.

What the gate checks

Maida compares the observed execution against your checked-in policy and baseline: tool use, loops, stop conditions, structural counts, and configured cost or latency limits. It does not establish answer correctness or behavior outside the captured evidence. Keep your correctness tests alongside it.

Read the verdict: PASS, FAIL, or INCONCLUSIVE. Exit 0 includes INCONCLUSIVE; consumers must not treat process success as approval.

Investigate a failed check

Use maida view to inspect the local timeline and maida diff --baseline .maida/baselines/agent.json to understand the structural change. Repair an unintended regression; review the evidence and reason before accepting an intentional baseline change.

Add the PR gate

After the local pass → deliberate failure → repair loop works, follow the Action setup and protection requirements. Use the init reference for your installed version. The workflow needs a real entrypoint, dependencies, a reviewed baseline, and an immutable Action pin.

A generated workflow is setup, not evidence of merge enforcement. Verify required checks on the actual PR head, trusted base policy, workflow protection, and the fresh result after acceptance before relying on that boundary.

🔌 Integrations

Maida is framework-agnostic at its core -- the SDK works with any Python code. Adapters are optional and import-to-enable; the core package works without any of them installed.

Integration Install Guide
🦜 LangChain / LangGraph maida-ai[langchain] Guide
🤖 OpenAI Agents SDK maida-ai[openai] Guide
🛶 CrewAI unsupported after v0.5.3 Guide
📊 Langfuse import built in Guide
🖥️ Claude Code capture built in Guide
🧾 Any emitter (no SDK) built in Emitter guide

Systems that write native traces directly can check them with maida validate-trace before handing them to the gate -- no SDK required.

Langfuse tells you what happened; Maida tells you whether it changed.

📚 Documentation

Full documentation lives at maida.ai/docs.

🚀 Getting started Install, first trace, first baseline
🛡️ Regression testing The end-to-end gate workflow
⌨️ CLI reference Every command, option, and exit code
🐍 SDK reference @trace, recorders, contexts
📜 Policy reference .maida/policy.yaml, policy v2
🚧 Guardrails Stop runaway runs mid-flight
🔍 Viewer The local timeline UI
🗄️ Trace format The versioned data contract
⚙️ Configuration Env vars, YAML precedence, redaction
🏗️ Architecture Schema, storage, loop detection

Step-by-step notebooks live in maida-ai/maida-tutorials -- all runnable without API keys.

🔒 Privacy and local-first guarantees

Redaction is on by default: values for keys matching api_key, token, authorization, cookie, secret, and password are scrubbed before anything is written to disk, and large fields are truncated.

Runs are plain files you can inspect or delete:

~/.maida/runs/<trace_id>/
├── meta.json     # run metadata (status, counts, timing)
└── spans.jsonl   # append-only OpenTelemetry span records

No prompt, response, tool payload, secret, or environment variable leaves your machine or CI runner unless you explicitly configure it. Set MAIDA_DATA_DIR to move storage elsewhere.

📖 Configuration reference

🧪 Development

git clone https://github.com/maida-ai/maida.git
cd maida
uv venv && uv sync && uv pip install -e .
uv run pytest
No uv? Use pip instead.
python -m venv .venv && source .venv/bin/activate
pip install -e .
pytest

Contributions welcome -- see CONTRIBUTING.md and SECURITY.md.

📄 License

Apache License 2.0. See LICENSE.


If Maida catches a regression for you, a ⭐ helps other teams find it.

Metadata

Release files for maida-ai 0.6.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 maida-ai 0.6.0
File Size Uploaded
maida_ai-0.6.0.tar.gz 857.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for maida-ai 0.6.0
File Interpreter ABI Platform
maida_ai-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / maida_ai-0.6.0.tar.gz

Download URL maida_ai-0.6.0.tar.gz
Size 857.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a4912d42650376b4b025676bd1e0ecc9ff50ee07e8c72904c540f1ce08735654
BLAKE2b-256 checksum
How to use checksums
8bb2e682fbb02f2d74181ad1f0e11d2328ab2d4409f1f9aad4f9b3c7684585ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / maida_ai-0.6.0-py3-none-any.whl

Download URL maida_ai-0.6.0-py3-none-any.whl
Size 213.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ba62fdd2e56158d55280dc96573c65d2ab4410f0ecf088eb56e4353db2701dd
BLAKE2b-256 checksum
How to use checksums
60bb4f070732c2aea1653d6a077977f0c31341f330f8d7aaadb8f63029e37778
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

0.6.1

2 release files

This release

0.6.0 This release

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

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