Skip to main content

AgentIdem

Reliability testing for state-changing AI agents.

Agents retry. Side effects do not rewind.

AgentIdem tests whether an agent behaves safely when execution is retried, interrupted, duplicated, or partially observed.


Installation

Requires Python 3.11 or newer.

pip install agentidem

Verify the CLI:

agentidem version

Expected output:

v1.0.0

CLI

AgentIdem v1 provides four commands:

agentidem test
agentidem record
agentidem replay
agentidem version

agentidem test

Test an agent for retry and side effect safety.

agentidem test module.path:function

Example:

agentidem test examples.cli_agents:unsafe_agent

AgentIdem automatically detects synchronous and asynchronous targets.

JSON output

agentidem test examples.cli_agents:unsafe_agent --json

Save a report

agentidem test examples.cli_agents:unsafe_agent --out report.json

You can use both together:

agentidem test examples.cli_agents:unsafe_agent \
  --json \
  --out report.json

Exit codes

Exit code Meaning
0 All tested scenarios were safe
1 At least one scenario was unsafe
2 Target loading or baseline execution failed

agentidem record

Run an agent once and save its execution trace.

agentidem record module.path:function --out trace.json

Example:

agentidem record examples.cli_agents:unsafe_agent --out trace.json

The trace includes the target, operations, arguments, results, errors, statuses, and observation state.

If the target fails, AgentIdem still writes the partial trace and exits with code 2.


agentidem replay

Re-run a recorded target and compare it with the saved trace.

agentidem replay trace.json

Matching replay:

REPLAY MATCH: examples.cli_agents:unsafe_agent

Mismatching replay:

REPLAY MISMATCH: examples.cli_agents:unsafe_agent

Exit codes

Exit code Meaning
0 Replay matched
1 Replay differed
2 Trace or target could not be loaded

Replay ignores nondeterministic trace IDs and timestamps.


agentidem version

Show the AgentIdem CLI version.

agentidem version

Output:

v1.0.0

Target format

CLI targets use:

module.path:function

Example:

my-project/
├── agents/
│   ├── __init__.py
│   └── refund.py
└── ...

With:

# agents/refund.py

def run() -> None:
    ...

Run:

agentidem test agents.refund:run

For v1, CLI targets should be zero-argument functions.

If your agent requires arguments, create a small wrapper:

from myapp.agent import process_order


def run() -> str:
    return process_order(
        order_id="ord_42",
        amount=100,
    )

Then run:

agentidem test myapp.agent_test:run

Development

Install development dependencies:

pip install -e ".[dev]"

Run the test suite:

pytest -v

License

Licensed under Apache License 2.0. See LICENSE.

Metadata

Release files for agentidem 1.0.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 agentidem 1.0.0
File Size Uploaded
agentidem-1.0.0.tar.gz 31.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentidem 1.0.0
File Interpreter ABI Platform
agentidem-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.5 kB

Release files / agentidem-1.0.0.tar.gz

Download URL agentidem-1.0.0.tar.gz
Size 31.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e9808c918f219d2fd7729d0ea5fd1ac217d4512397de44cc3d3b01c347602c83
BLAKE2b-256 checksum
How to use checksums
7f70327b7415569c13c3934794f5a2789c0c952ea90481a0501e485ebe35ab56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 29, 2026.

Transparency log

Release files / agentidem-1.0.0-py3-none-any.whl

Download URL agentidem-1.0.0-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
270f466d64e95bc099fa0a90b58a5ed1cae9825e9836aa63ff279fd5fb6b35e5
BLAKE2b-256 checksum
How to use checksums
002d71b8237d0959fe992141ead12b26e227049c3be9063bf9edebbb1aa662fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

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