Skip to main content

Behavior contracts for AI agents — tested in your PR, enforced at runtime.

Project description

shadow-diff

Find the exact change that broke your AI agent.

Shadow is a CI-native regression-forensics tool for LLM agents. One command on the PR — shadow diagnose-pr — answers:

  1. Did agent behavior change?
  2. How many traces are affected?
  3. Which exact prompt / model / tool / config change caused it?
  4. With what confidence (ATE + bootstrap CI + E-value when run with --backend live)?
  5. What fix should verify-fix confirm before merge?

The PyPI distribution is shadow-diff. The Python import path is shadow. The CLI is shadow.

Install

pip install shadow-diff

Requires Python 3.11+. Pre-built wheels ship for Linux x86_64, macOS arm64, and Windows x86_64; other platforms build from source (Rust required).

Optional extras:

pip install 'shadow-diff[anthropic]'   # if your agent uses Claude
pip install 'shadow-diff[openai]'      # if your agent uses GPT
pip install 'shadow-diff[embeddings]'  # paraphrase-robust semantic diff
pip install 'shadow-diff[all]'         # everything

60-second tour

shadow demo                  # nine-axis diff on bundled fixtures, no API key
shadow quickstart            # writable copy of a runnable scenario

Then run diff against the writable scenario:

cd shadow-quickstart
shadow diff fixtures/baseline.agentlog fixtures/candidate.agentlog

For the full diagnose-pr flow against your own agent, see docs/features/causal-pr-diagnosis.md and the runnable refund-causal-diagnosis demo.

Record your own agent

from shadow.sdk import Session

with Session(output_path="trace.agentlog"):
    # Your existing Anthropic / OpenAI code, unchanged.
    client.messages.create(model="claude-sonnet-4-6", messages=[...])

Shadow auto-instruments the Anthropic and OpenAI SDKs and writes content-addressed .agentlog files. Secrets are redacted by default. Or skip the code change entirely:

shadow record -o trace.agentlog -- python your_agent.py

Daily workflow — Shadow as pytest for agent behavior

shadow inspect trace.agentlog                  # debug a single trace
shadow scan baseline_traces/                   # block secret leaks
shadow baseline create baseline_traces/        # pin the gold standard
shadow gate-pr ...                             # gate every PR

Full docs

The canonical README, the .agentlog spec, runnable examples, and the comparison against adjacent agent-eval and runtime-governance tools all live at https://github.com/manav8498/Shadow.

License

Apache-2.0. See LICENSE-APACHE in this distribution. The .agentlog spec is independently published under Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shadow_diff-3.2.0.tar.gz (574.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

shadow_diff-3.2.0-cp311-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.11+Windows x86-64

shadow_diff-3.2.0-cp311-abi3-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ x86-64

shadow_diff-3.2.0-cp311-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file shadow_diff-3.2.0.tar.gz.

File metadata

  • Download URL: shadow_diff-3.2.0.tar.gz
  • Upload date:
  • Size: 574.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shadow_diff-3.2.0.tar.gz
Algorithm Hash digest
SHA256 304251ba9a71e2f50b16e39ec5b26ffb82c2e4b172d32d553cec65e6a3b2210a
MD5 ed8a04387e095ec10009c248699f9440
BLAKE2b-256 373285ea429a6aefb09167c0fec126b32268856f9e160e0a06e3cbc50a1e91ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.2.0.tar.gz:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shadow_diff-3.2.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: shadow_diff-3.2.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shadow_diff-3.2.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 18cdb2d3c122ddde7cff9d8701c5786f9c9efc611055c8862a4eae272ed7fbef
MD5 13a24eb674a73c942ceaef620b143bb8
BLAKE2b-256 799ea5621170807227bbf93915e98d004c12f2d445c1a567282f36514c2264e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.2.0-cp311-abi3-win_amd64.whl:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shadow_diff-3.2.0-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.2.0-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 094a6cabfdc04bb97a5de37f60cb8402278424b4585e4da52d0e4272b5dfcf3c
MD5 21d05baa797865dd5347a9cc26d60464
BLAKE2b-256 24c44913a42596e3ff9dc3b1ddf135a62a32ef1c707bbbb6568acb638a6975df

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.2.0-cp311-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shadow_diff-3.2.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.2.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1b5e746a9c041dc2004e5b9d221176da89b5255ab9e33e2e3945661be930bf74
MD5 d3c47d2dec290f39da666173d8ee4ea9
BLAKE2b-256 c1362c0bc0ef6950e4bf645b61cad1a93dafc9f19868fc7c2c1b4908a0a54e7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.2.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on manav8498/Shadow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page