🛡️ Fixtura
Deterministic Execution Recording, Replay, & Drift Testing for AI Agents — Turn Real Agent Runs into Replayable Test Fixtures.
🚀 Welcome to Fixtura! Fixtura gives your AI agents record & replay superpowers. Capture real agent behavior once, redact sensitive secrets automatically, and replay those traces deterministically in CI/CD — with zero live API costs and zero flaky external calls!
⚠️ Upgrading from 1.x? Imports moved.
2.0.0 puts everything under the
fixtura.namespace. Versions before 2.0 publishedrecorder,replay,security,tools,cli, andanalysisas top-level packages, so installing fixtura claimed six generic names on yoursys.pathand could shadow your owntools/orcli/package.Prefix your imports with
fixtura.:- from recorder.recorder import ExecutionRecorder + from fixtura.recorder.recorder import ExecutionRecorderAlso update module paths written as strings, such as
mock.patch("tools.base_tool.check"). The CLI, its subcommands, and the.traceformat are unchanged. Full table in CHANGELOG.md.Pinning
fixtura>=1.xwith no upper bound will resolve 2.0.0 and break — usefixtura>=1.1.1,<2if you are not ready to migrate.
✨ Features At A Glance — Why You'll Love Fixtura
- ⚡ Lightning Fast Offline Replays: Reproduce complex multi-step agent runs in milliseconds without calling live LLM models or touching real databases.
- 🔒 Ironclad Security & Gatekeeping: Capability tokens enforce granular read/write permissions at the tool execution boundary before side effects ever execute.
- 🧼 Automatic Secret Redaction: Built-in sanitizer scrubs planted API keys, passwords, and tokens before
.tracefiles are stored. - 🚨 Automated Fixture Drift Shield: Structural fingerprinting detects if a prompt or tool schema changed, preventing stale fixtures from giving false greens in CI.
- 📊 Boundary Coverage Radar: Instantly visualize tool coverage and boundary safety (permission denials, rate limits, errors).
- 🔌 100% Framework Agnostic: Plugs seamlessly underneath LangGraph, CrewAI, AutoGen, or custom agent loops in under 5 lines of code.
💡 What is Fixtura?
Fixtura is a framework-agnostic execution-assurance layer for AI agents. Sitting directly at the tool-execution boundary, Fixtura monitors an agent's tool calls, enforces real-time permission policies and rate limits, redacts secrets, records deterministic .trace files, and allows you to replay, diff, and grade those recordings offline without touching live systems.
┌────────────────┐
│ AI Agent │ (LangGraph / CrewAI / AutoGen / Custom)
└───────┬────────┘
│ executor.call("tool_name", args)
▼
┌───────────────────────────────┐
│ Fixtura Executor Seam │
├──────────────┬────────────────┤
│ Permission │ Rate Limiter │
│ Engine │ & Circuit Bkr │
└──────┬───────┴────────┬───────┘
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐
│ Real Tools │ │ Execution │ ───► saved .trace artifact
│ (FS/SQL/HTTP)│ │ Recorder │ (compressed & redacted)
└──────────────┘ └──────────────┘
🎯 Why Fixtura vs Production APM?
Most agent observability tools (Langfuse, Phoenix, Braintrust) focus on production monitoring and LLM latency metrics at scale. Fixtura takes a different approach: recorded execution traces as literal, replayable test fixtures.
| Metric | Production APM (Langfuse/Phoenix) | 🛡️ Fixtura Execution Assurance |
|---|---|---|
| Primary Goal | Telemetry, cost tracking, prompt latency | CI/CD regression testing & deterministic verification |
| Execution Control | Passive monitoring (read-only telemetry) | Active permission gatekeeper & circuit breaker |
| Replay Mechanism | Visual timeline inspection | Offline Passive & Verified Replay (zero live calls) |
| Regression Testing | LLM-as-a-judge scoring | Structural fingerprint drift detection (check-drift) |
| CI Integration | Post-hoc dashboards | Binary exit codes (0 PASS, 1 DRIFTED, 2 UNVERIFIED) |
🏗️ System Architecture & Dataflow
flowchart TD
classDef agent fill:#e1f5fe,stroke:#0288d1,stroke-width:2px,color:#01579b;
classDef seam fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#e65100;
classDef gate fill:#ffebee,stroke:#c62828,stroke-width:2px,color:#b71c1c;
classDef storage fill:#ede7f6,stroke:#512da8,stroke-width:2px,color:#311b92;
classDef engine fill:#e8f5e9,stroke:#388e3c,stroke-width:2px,color:#1b5e20;
subgraph "Agent Runtime Layer"
LLM["🤖 Agent Model / Orchestrator"]:::agent
end
subgraph "Fixtura Execution Seam"
Exec["⚡ FixturaExecutor (Injected Seam)"]:::seam
end
subgraph "Protection & Security Gatekeeper"
Perm["🔒 Permission Engine (Capability Token)"]:::gate
Limiter["⏱️ Rate Limiter & Circuit Breaker"]:::gate
Sanitizer["🧼 Secret Sanitizer (Redactor)"]:::gate
end
subgraph "Trace Artifacts"
Rec["REC Execution Recorder"]:::storage
TraceFile[("💾 .trace Artifact (Zstd Compressed)")]:::storage
end
subgraph "Verification & Replay Suite"
Replay["⏪ Passive Replay"]:::engine
Inspect["🔍 Step Inspector / UI"]:::engine
Drift["🚨 check-drift (Fingerprint Verifier)"]:::engine
Verify["✅ Verified Replay (Diff Engine)"]:::engine
Coverage["📊 Fixture Library Coverage"]:::engine
OpenEval["💯 OpenEval Adapter"]:::engine
end
LLM -->|"1. executor.call(tool, args)"| Exec
Exec -->|"2. Authorize"| Perm
Exec -->|"3. Quota check"| Limiter
Perm -->|"4. Sanitize input/output"| Sanitizer
Sanitizer -->|"5. Write event"| Rec
Rec -->|"6. Produce"| TraceFile
TraceFile --> Replay
TraceFile --> Inspect
TraceFile --> Drift
TraceFile --> Verify
TraceFile --> Coverage
TraceFile --> OpenEval
🚀 Quickstart (5 Minutes)
1. Installation
# Install from PyPI:
pip install fixtura
# Or install in editable mode from a local checkout:
git clone https://github.com/yash161004/fixtura-core.git
cd fixtura-core
pip install -e .
2. Run the Interactive Quickstart Script
python quickstart.py
The script automatically demonstrates the complete 6-stage pipeline:
- 🎬 Record: Captures a multi-step agent run to
quickstart_example.trace. - ⏪ Passive Replay: Reproduces the run offline with zero live calls.
- 🔍 Step Inspection: Interactively steps through each recorded event.
- 🚨 Drift Check: Verifies trace structural fingerprints against current tool schemas and policies.
- ✅ Verified Replay: Re-executes agent logic while substituting tool call responses.
- 📊 Coverage Analysis: Computes tool and boundary coverage across the fixture library.
🔌 Wiring Fixtura into Your Agent
Fixtura integrates into your existing agent loop with zero structural refactoring. Simply inject fixtura.executor where your agent executes tools:
import fixtura
# 1. Initialize executor in record or replay mode
executor = fixtura.executor(
mode="record", # Or mode="replay" for offline runs
trace="agent_run.trace",
tools=tool_registry,
capability_token=capability_token,
)
# 2. Call tools inline from inside your agent loop
result = executor.call("filesystem_tool", {"operation": "read", "path": "notes.txt"})
if result.denied:
print(f"🔒 Permission denied: {result.reason}")
else:
print(f"✅ Tool output: {result.value}")
Execution Modes:
- Record Mode (
mode="record"): Executes tools for real through the permission engine and rate limiter, sanitizing outputs and writing every event to.trace. - Replay Mode (
mode="replay"): Returns recorded outputs inline with zero live tool execution. No capability token or real tools needed.
⚡ Core Features & Capabilities
1. 🚨 Fixture Drift Detection (check-drift)
A test fixture is only useful if it matches current code. If you update a tool's Pydantic schema or edit a system prompt, a stale trace replaying green creates a false sense of security.
Fixtura traces carry a cryptographic fingerprint of tool schemas, prompt text, and policy rules. check-drift detects changes before replaying:
fixtura check-drift fixtures/checkout.trace --agent my_agent:spec
DRIFTED: fixtures/checkout.trace
agent: my_agent:spec
changed: tool schema changed: sqlite_tool
- Exit Codes:
0PASS,1DRIFTED,2UNVERIFIED (malformed/unimportable spec). - Note: Run from your project root or set
PYTHONPATH=.so Python can resolve your customAgentSpec.
2. ✅ Verified Replay (verify)
Verified Replay runs your agent's decision logic live while substituting tool call responses from the trace. It diffs generated tool requests against recorded tool requests while normalizing volatile fields (such as timestamps, UUIDs, and transient IDs).
fixtura verify fixtures/checkout.trace
3. 📊 Fixture Library Coverage (coverage)
Analyzes a corpus of trace files to report which registered tools have been tested, and whether boundary conditions (permission denials, errors, rate limits) have been exercised.
fixtura coverage fixtures/
Coverage over 4 trace(s), 12 recorded tool call(s)
TOOL CALLS OUTCOMES SEEN
--------------- ----- ----------------------------------------
filesystem_tool 4 allowed, denied
sqlite_tool 5 allowed, error
http_tool 3 denied, throttled
Tool coverage: 100.0% (registered tools appearing in any fixture)
Boundary coverage: 83.3% (registered tools seen failing, denied, or throttled)
4. 🔀 The 4 Replay Modes
matrix
title Replay Mode Spectrum
"Mode" : "Executes Tools?" : "Agent Runs?" : "Deterministic?"
"Passive Replay" : "No" : "No" : "Yes (100%)"
"Step Inspector" : "No" : "No" : "Yes (100%)"
"Verified Replay" : "No" : "Yes" : "Partial (Tool-level)"
"Live Branching" : "Yes" : "Yes" : "No (Live Run)"
| Mode | Command | Agent Runs? | Touches Live Systems? | Compares Output? |
|---|---|---|---|---|
| Passive Replay | fixtura replay <trace> |
No | No | No |
| Step Inspection | fixtura inspect <trace> |
No | No | No |
| Verified Replay | fixtura verify <trace> |
Yes | No | Yes |
| Live Branching | fixtura branch <parent> <out> <step> <prompt> |
Yes | Yes (Live) | No |
🛠️ CLI Reference Manual
| Command | Arguments | Description | Exit Code |
|---|---|---|---|
fixtura record |
<trace> |
Record an agent run to a .trace artifact using demo agent |
0 |
fixtura replay |
<trace> |
Passively replay a trace offline with zero live calls | 0 |
fixtura inspect |
<trace> |
Step through a trace interactively line-by-line | 0 |
fixtura view |
<trace> |
Print human-readable summary of recorded events | 0 |
fixtura html-view |
<trace> |
Generate standalone HTML trace visualizer (trace_viewer.html) |
0 |
fixtura check-drift |
<trace> [--agent module:attr] |
Verify if trace fingerprint matches current agent spec | 0 PASS / 1 DRIFTED / 2 UNVERIFIED |
fixtura verify |
<trace> [prompt] |
Run agent decision logic offline & diff tool calls | 0 PASS / 1 MISMATCH / 2 DRIFTED |
fixtura coverage |
<paths...> |
Report tool and boundary coverage across .trace files |
0 |
fixtura branch |
<parent> <out> <step> <prompt> |
Branch trace execution from a step (executes live) | 0 |
fixtura eval |
<trace> |
Score trace trajectory via OpenEval adapter | 0 |
🤖 Running Real Agent Loops
Fixtura includes a complete, provider-agnostic real agent loop in examples/real_agent.py. It works against any OpenAI-compatible LLM endpoint (Ollama, Groq, OpenRouter, Together, Gemini, OpenAI):
Free Local Execution (Ollama):
ollama pull qwen3:4b
ollama serve
python -m examples.real_agent run.trace
Hosted Provider Execution:
export FIXTURA_LLM_BASE_URL="https://api.groq.com/openai/v1"
export FIXTURA_LLM_MODEL="llama-3.3-70b-versatile"
export FIXTURA_LLM_API_KEY="your-api-key"
python -m examples.real_agent run.trace
💯 OpenEval Adapter (Optional)
Fixtura integrates with OpenEval for trajectory scoring. OpenEval is published on PyPI as openeval-core, so the eval extra installs it for you:
# Install Fixtura with the OpenEval adapter:
pip install 'fixtura[eval]'
# Score a trace trajectory:
fixtura eval quickstart_example.trace
Or add OpenEval to an existing install:
pip install 'openeval-core>=0.2.1'
Note on the distribution name. The adapter requires
openeval-core, notopeneval. The bareopenevalname on PyPI is an unrelated placeholder project that installs cleanly and does nothing. The native Fixtura adapter (openeval.adapters.fixtura) ships from openeval-core 0.2.1 onward; earlier releases do not contain it, which is why the extra pins>=0.2.1.
📚 Repository Documentation Index
| Document | Description |
|---|---|
| 📐 ARCHITECTURE.md | Detailed system design, trust boundaries, and scope decisions |
| 🛡️ THREAT_MODEL.md | Security model, prompt injection defenses, secret sanitization |
| 🗺️ ROADMAP.md | Milestone tracking, frozen scope table, and acceptance criteria |
| 🚦 PROJECT_STATUS.md | Comprehensive test suite matrix and component build status |
| 📋 CHANGELOG.md | Release notes and version history |
| 📄 TRACE_FORMAT_SPEC.md | Specification of the .trace binary format and JSON schema |
| 🔬 LIVE_RUN_FINDINGS.md | Empirical findings and fixes from live LLM model testing |
| 📜 DENIAL_MESSAGE_PROPOSAL.md | Security proposal on permission-denial message granularity |
🤝 Community & Contributions
We welcome feedback, issues, and contributions from developer teams building reliable AI agents!
- ⭐ Star the repo if Fixtura helps you catch agent regressions in CI!
- 💬 Open an Issue for suggestions, bug reports, or feature ideas.
- 📜 See LICENSE for MIT licensing details.
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file fixtura-2.0.0.tar.gz.
File metadata
- Download URL: fixtura-2.0.0.tar.gz
- Upload date:
- Size: 47.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f0d0b4899a0b95fb9e90aa372a6c215f9f22d759c90f27c8dbec7fad28d7b65
|
|
| MD5 |
e046be1cece4138da895f9e8d18721e7
|
|
| BLAKE2b-256 |
d501afd35c3aa7ffa5fc29d0f8aa6677557bc75e8bec42dbd17257d88013c8a8
|
Provenance
The following attestation bundles were made for fixtura-2.0.0.tar.gz:
Publisher:
publish.yml on yash161004/fixtura-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fixtura-2.0.0.tar.gz -
Subject digest:
6f0d0b4899a0b95fb9e90aa372a6c215f9f22d759c90f27c8dbec7fad28d7b65 - Sigstore transparency entry: 2279419834
- Sigstore integration time:
-
Permalink:
yash161004/fixtura-core@febf15a710ea99eefb95353ba9adfeea89c9bf7a -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/yash161004
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@febf15a710ea99eefb95353ba9adfeea89c9bf7a -
Trigger Event:
push
-
Statement type:
File details
Details for the file fixtura-2.0.0-py3-none-any.whl.
File metadata
- Download URL: fixtura-2.0.0-py3-none-any.whl
- Upload date:
- Size: 54.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7b847941249dbdcc63699d296bb96ed9963feda96eefc8269b16b4b465e086f
|
|
| MD5 |
a4c75092dfce05f64a027707aa0ca6d5
|
|
| BLAKE2b-256 |
9e56ad2ba40034cd6c9c776747be2dc99a61e5d6ddcd69861483357cca5f1a8f
|
Provenance
The following attestation bundles were made for fixtura-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on yash161004/fixtura-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fixtura-2.0.0-py3-none-any.whl -
Subject digest:
a7b847941249dbdcc63699d296bb96ed9963feda96eefc8269b16b4b465e086f - Sigstore transparency entry: 2279419847
- Sigstore integration time:
-
Permalink:
yash161004/fixtura-core@febf15a710ea99eefb95353ba9adfeea89c9bf7a -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/yash161004
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@febf15a710ea99eefb95353ba9adfeea89c9bf7a -
Trigger Event:
push
-
Statement type: