Skip to main content

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

Project description

shadow-diff

Catch AI-agent regressions before they hit production.

Shadow is a PR-native diff tool for LLM agents — it records your agent's calls, replays them under a new config, and tells you what changed across nine behavioural dimensions.

Install

The PyPI distribution name is shadow-diff (the bare shadow name on PyPI is an unrelated project). The Python import path is shadow, and the CLI is shadow.

pip install shadow-diff

# With Anthropic support:
pip install 'shadow-diff[anthropic]'

# With OpenAI support:
pip install 'shadow-diff[openai]'

# With both + embeddings:
pip install 'shadow-diff[anthropic,openai,embeddings]'

Requires Python 3.11 or newer.

Quickstart

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 automatically patches the Anthropic and OpenAI SDKs to capture every request/response. Secrets are redacted by default.

Then in CI:

shadow replay new-config.yaml --baseline trace.agentlog
shadow diff trace.agentlog candidate.agentlog
shadow bisect old-config.yaml new-config.yaml --traces trace.agentlog

Full docs

The canonical README, examples, the .agentlog spec, and the project roadmap live at https://github.com/manav8498/Shadow.

License

Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE in this distribution, or the project repository.

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.0.7.tar.gz (497.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.0.7-cp311-abi3-win_amd64.whl (934.0 kB view details)

Uploaded CPython 3.11+Windows x86-64

shadow_diff-3.0.7-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.0.7-cp311-abi3-macosx_11_0_arm64.whl (994.1 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: shadow_diff-3.0.7.tar.gz
  • Upload date:
  • Size: 497.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.0.7.tar.gz
Algorithm Hash digest
SHA256 b2059b8ec5f16ad54268b24fef5ff81b549051432e4bba44b8d2bedc5075dc2e
MD5 fb0419e7ddca7f9b2f737bd28caeab31
BLAKE2b-256 5ccd733fe800cc7a8fb386e0ce9195f59ab326fce385cacfa7c3ebab3487d232

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.7.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.0.7-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: shadow_diff-3.0.7-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 934.0 kB
  • 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.0.7-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1cf18dbb5ff4c174dc4601bd9d5b7f74c717ccf45e36922b2e2ba28b50eab8b5
MD5 ff0c7182cb7ba8ee3aa024627af6af87
BLAKE2b-256 372efd155dcc277c2f7e334158aebc1bd35d1444b6caa9bc71876123f8ee98d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.7-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.0.7-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.0.7-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c67416c0173f72f6de494c73d284807071748e5fc5939fce21a67f15b3c03cb8
MD5 426079f249a42ae118c841484aaea236
BLAKE2b-256 1d24ea4833ea303bf8b47a4d235b2fc499fe6ba7357a8adcec47678f9e43c8f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.7-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.0.7-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for shadow_diff-3.0.7-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2fcc76c0b696c117539ed640e8db6f1f9809215bdc0f5ff93e09c53957d3a62b
MD5 e8a22cce66ca33cee5cbdbab91414d45
BLAKE2b-256 231a6be6993fe72924df5098737c9ff249c6ae1359f70927b01f7a2a313aee52

See more details on using hashes here.

Provenance

The following attestation bundles were made for shadow_diff-3.0.7-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