Metadata-Version: 2.4
Name: dedrift
Version: 0.0.2
Summary: Statistically rigorous behavioral drift detection for AI agents. Agents don't throw errors when they degrade — dedrift catches it.
Project-URL: Homepage, https://github.com/alimahmoudi/dedrift
Author-email: Ali Mahmoudi <alimahmoudidev26@gmail.com>
License-Expression: AGPL-3.0-only
License-File: LICENSE
Keywords: ai-agents,drift-detection,llm,monitoring,statistics
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: jinja2>=3.1
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.1
Requires-Dist: pydantic>=2.5
Requires-Dist: pyyaml>=6.0
Requires-Dist: scipy>=1.11
Requires-Dist: typer>=0.9
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: types-pyyaml; extra == 'dev'
Provides-Extra: embeddings
Requires-Dist: sentence-transformers>=2.3; extra == 'embeddings'
Provides-Extra: judge
Requires-Dist: anthropic>=0.40; extra == 'judge'
Requires-Dist: openai>=1.50; extra == 'judge'
Description-Content-Type: text/markdown

# dedrift

**Agents don't throw errors when they degrade. They keep confidently producing worse outputs. dedrift catches it.**

dedrift is an open-source Python package that detects silent behavioral drift in AI agents. It logs agent interactions, runs a frozen canary suite repeatedly, extracts behavioral signatures, and applies statistically rigorous drift detection with config-change attribution ("behavior shifted within 6h of the model version change").

## Why dedrift

Model updates, prompt edits, tool-schema changes, RAG index refreshes, and provider-side silent updates all shift agent behavior without throwing a single error. Existing monitoring catches crashes, not character changes.

dedrift's differentiation is statistical correctness:

- Every detector controls its documented false-alarm rate — validated by simulation tests in CI.
- All alerting passes through FDR control (Benjamini–Hochberg). No raw per-test p-values dressed up as alerts.
- Every alert requires both statistical significance and a configurable effect-size (materiality) threshold. Fewer, higher-confidence alerts.
- LLM outputs are stochastic: canaries run N times per cycle and we compare distributions, never single outputs.
- Dual baselines: every check runs against a rolling recent window (sudden breaks) and a frozen golden baseline (boiling-frog drift).
- Honest about power: small N means low detection power, and the docs show you the math instead of hiding it.

## Status

Pre-alpha. Phase 0 (scaffold, logging schema, storage, simulator) in progress. See `ROADMAP.md`.

## Install

```bash
pip install -e .          # core: zero ML dependencies
pip install -e ".[embeddings]"   # + semantic signatures (sentence-transformers)
pip install -e ".[judge]"        # + LLM-judge tier
pip install -e ".[dev]"          # development tooling
```

## Quickstart (target v0 walkthrough)

```bash
dedrift init                 # create a project
# ... log agent interactions, run canaries ...
dedrift check                # drift detection with FDR + materiality gating
dedrift report               # deterministic markdown report with attribution
```

A full simulated demo (synthetic agent, mid-log model swap, detection + attribution) ships with v0.1.0.

## dedrift Pro

Anytime-valid sequential inference (e-processes), conditional production-traffic drift, and importance weighting are part of a separate commercial tier and are not in this repository.

## License

AGPL-3.0-only. See `LICENSE`.
