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.1

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.1
File Size Uploaded
agentidem-1.0.1.tar.gz 31.2 kB Details

Built distribution (wheel)

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

Total release size: 63.5 kB

Release files / agentidem-1.0.1.tar.gz

Download URL agentidem-1.0.1.tar.gz
Size 31.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0645ec22465f454e7b7a4c5ebc05d9049850782c40c298920c0c8cda5a16df0f
BLAKE2b-256 checksum
How to use checksums
f00df7e87be0858406b572302655a9363c5e73360315847a3c1285bbf2c8cdd5
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 30, 2026.

Transparency log

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

Download URL agentidem-1.0.1-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd4a34f5ddb9fea208c392a159d6d8693c62b664521bac38b06ea49b4ca41578
BLAKE2b-256 checksum
How to use checksums
7775067ce240e92c8f8ca6292310b50a419ca127224b8093054431187f523bdc
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 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

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