Python LLM Agent Record/Replay Test Fixtures
Run deterministic, offline regression tests for LLM agents and tool-using applications. This Python library records normalized model and tool-boundary events as local JSON fixtures, redacts common credentials before storage, and replays a trace without contacting a provider. A missing fixture raises an error; there is no live-call fallback.
Install from source
Requires Python 3.11 or newer. Clone the repository and install the local package:
git clone https://github.com/buxerr/agent-replay-fixtures.git
cd agent-replay-fixtures
python -m pip install .
Record and replay a trace
Each event has a kind and payload. Common kinds include model.request, model.response, tool.call, tool.result, and stream.chunk.
from agent_replay import ReplayTransport, TraceRecorder
request = {"model": "example", "messages": [{"role": "user", "content": "Hi"}]}
events = [{"kind": "model.response", "payload": {"text": "Hello"}}]
fixtures = "tests/fixtures"
TraceRecorder(fixtures).record(request, events)
session = ReplayTransport(fixtures).open(request)
response = session.next_event("model.response")
assert response["payload"]["text"] == "Hello"
session.assert_exhausted()
TraceRecorder.record writes an immutable fixture addressed by the SHA-256 of the redacted request. ReplayTransport.open matches that request and returns a ReplaySession. An event-kind mismatch does not advance the trace.
Redaction and fixture safety
The default redactor recognizes credential-shaped object fields, common bearer strings, and several provider token formats. Add field names with SecretRedactor(extra_fields={"customer_secret"}). Review generated fixtures before committing them: custom credentials may use formats the default rules do not recognize, and redaction is not encryption.
Run the unit suite with python -m unittest discover -s tests -v.
Scope and limitations
The package provides fixture storage, redaction, integrity checks, and deterministic replay primitives. It does not include SDK adapters, provider-specific stream normalization, fixture curation, or encrypted fixture storage. Connect it to the model and tool boundaries in your own test harness.
License
MIT. See LICENSE.
Metadata
Release files for agent-replay-fixtures 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_replay_fixtures-0.1.0.tar.gz | 7.9 kB | With provenance | Details for agent_replay_fixtures-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_replay_fixtures-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for agent_replay_fixtures-0.1.0-py3-none-any.whl |
Total release size: 15.1 kB
Release files / agent_replay_fixtures-0.1.0.tar.gz
| Download URL | agent_replay_fixtures-0.1.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0695cc95b80457453d459a00bfd585e9e9a64ddd523d33f690f2b099b3172134
|
|
BLAKE2b-256 checksum How to use checksums |
12327d44ea180d589978a38af6a245ddbb856b757724fed4df6c210a1cf3ded3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / agent_replay_fixtures-0.1.0-py3-none-any.whl
| Download URL | agent_replay_fixtures-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6aeedfe8957dea2dce042ca4b9c414613801f130dab25a5afdb6965cf18ba135
|
|
BLAKE2b-256 checksum How to use checksums |
01fbc72ad6c75779a0cfea380342317e26cdf5ed6f88bece7607af032c3c4779
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for agent-replay-fixtures 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_replay_fixtures-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.