Skip to main content

PromptDrift

CI PyPI Python License: MIT

Git-native AI behavior change detection.

Change a prompt. PromptDrift automatically shows what changed in AI behavior, what broke, what improved, and whether the change is safe to merge.

PromptDrift turns your real application traffic and prompt changes into automatic regression coverage with Impact Radius analysis, without requiring manual authoring of dozens of YAML tests.

application / prompt / traffic
          ↓
      discovery
          ↓
   scenario library
          ↓
   baseline behavior
          ↓
 prompt change detected
          ↓
 replay + evaluation
          ↓
 regression analysis
          ↓
 GitHub PR / CLI report

3-Minute Quick Start

pip install promptdrift-ci
promptdrift init

PromptDrift scans your repository context and sets up starter files.

1. Log example interactions

promptdrift capture --input "How do I cancel my order?" --output "You can cancel within 24 hours."

(Note: PromptDrift currently logs interactions via explicit CLI input. Automatic SDK/proxy capture is planned for a future release.)

2. Turn captures into candidate regression scenarios

promptdrift learn

3. Review and promote scenarios to the active suite

promptdrift scenarios
promptdrift suggest cancellation_how_do_i_cancel
promptdrift promote cancellation_how_do_i_cancel

4. Create your baseline

promptdrift baseline

5. Run Git-aware check

promptdrift check

Impact Radius & Behavioral Change Report

When you modify your prompt templates and run promptdrift check:

PromptDrift Impact Report
Behavior changed in 8 / 43 scenarios.

  ✓ 5 improved
  ⚪ 35 unchanged
  💬 17 changed but valid
  ✗ 3 regressed

Impact radius: 18.6%
Latency change: +7.2%
Cost change:    +11.3%

Affected Categories:
  Refunds          5 affected
  Cancellation     2 affected
  Escalation       1 affected

Regressions:
  ✗ refund_request
    Required policy condition failed: 30 days window missing.
  ✗ cancellation_001
    JSON schema failed: 'order_id' is a required property.

Define Explicit Behavioral Contracts (Advanced Mode)

You can always define explicit behavioral contracts in promptdrift.yaml:

version: 2

project:
  name: support-bot

provider:
  type: openai
  model: gpt-4.1-mini
  api_key_env: OPENAI_API_KEY

tests:
  - id: refund_request
    prompt: prompts/support.txt
    variables:
      policy: Refunds are available within 30 days.
      question: Can I get a refund for my order?
    assertions:
      - type: contains
        value: 30 days
      - type: not_contains
        value: guaranteed
      - type: max_length
        value: 600

Built-in Deterministic Assertions

exact_match · contains · not_contains · regex · not_regex · json_valid · json_schema · min_length · max_length · max_tokens · latency_ms · cost_usd


GitHub Action & PR Workflow

name: PromptDrift Check

on:
  pull_request:
    paths:
      - "prompts/**"
      - "promptdrift.yaml"

permissions:
  contents: read
  pull-requests: write

jobs:
  promptdrift:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: tanveer-arch/promptdrift/action@main  # Change to @v1 upon stable release
        with:
          config: promptdrift.yaml
          comment: 'true'
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Complete CLI Command Suite

Command Description
promptdrift init Zero-config setup detecting Git context and prompts
promptdrift capture Log application interactions into local storage
promptdrift learn Cluster captured interactions into regression candidates
promptdrift scenarios List and inspect the local scenario library
promptdrift suggest Suggest deterministic contracts for discovered scenarios
promptdrift promote Promote candidate scenarios into committed regression tests
promptdrift check Git-aware scenario execution and Impact Radius report
promptdrift accept Accept intentional behavior updates as the new baseline
promptdrift test Run behavioral contracts suite (backward compatible)
promptdrift baseline Capture canonical version-controlled baseline
promptdrift diff Compare current behavior against baseline
promptdrift report Generate offline HTML report
promptdrift purge Clear all local capture data
promptdrift doctor Validate config, prerequisites, and privacy status
promptdrift version Print version

Privacy by Default

  • No telemetry, tracking, or cloud accounts
  • Prompts are evaluated against the provider you configure
  • Captured traffic remains local in SQLite and is excluded from Git by default
  • Baseline files store hashes and metrics, never raw user inputs or prompt secrets
  • Clean wipe available at any time via promptdrift purge

License

Released under the MIT License.

Release files for promptdrift-ci 0.2.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 promptdrift-ci 0.2.0
File Size Uploaded
promptdrift_ci-0.2.0.tar.gz 57.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for promptdrift-ci 0.2.0
File Interpreter ABI Platform
promptdrift_ci-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 98.8 kB

Release files / promptdrift_ci-0.2.0.tar.gz

Download URL promptdrift_ci-0.2.0.tar.gz
Size 57.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d9832ac5671660de61f6311e73ad666ce7397b27cdc4c8127f54bde23546a6ed
BLAKE2b-256 checksum
How to use checksums
3904475621363d47db530bfd4963c633e923de0a0fb2d471a0fb5509d73b17f1
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 19, 2026.

Transparency log

Release files / promptdrift_ci-0.2.0-py3-none-any.whl

Download URL promptdrift_ci-0.2.0-py3-none-any.whl
Size 41.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4e8f41962653b78ccf9a25043c47bb509ddfe35db1159d13b109f7abafef6a9
BLAKE2b-256 checksum
How to use checksums
0d56937429d0377014c231e01eb1d0fece8a3eff49c3c30ad26a96d63df8466b
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 19, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.1

2 release files

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