Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

keeper-manifest-drift-watch

Drift-detection daemon for Keeper Manifest tenants.

Polls the live tenant on a schedule, compares to git-tracked manifests, and either:

  • Opens a GitHub Pull Request with a one-line fix proposal, or
  • Posts a structured Slack message with the diff summary, or
  • Files a ServiceNow ticket with the same payload.

The daemon never applies changes itself - it surfaces drift so a human (or another approved automation) can decide.

Canonical documentation: Drift Watch and Keeper Manifest Documentation.

Install

pip install keeper-manifest-drift-watch
# Or install in an isolated environment:
uv tool install keeper-manifest-drift-watch

The keeper-manifest main distribution ships the keeper-manifest drift-watch CLI verb, which auto-detects this package and dispatches to it.

Preview gate

The CLI is gated behind KEEPER_MANIFEST_PREVIEW=drift-watch so that the daemon's outbound side-effects (PRs, Slack posts, ServiceNow tickets) require explicit operator opt-in. A bare KEEPER_MANIFEST_PREVIEW=1 is not sufficient - the substring drift-watch must be present.

Programmatic use

from keeper_manifest_drift_watch.drift_watch import WatchConfig, watch_loop

cfg = WatchConfig(
    manifest_paths=["manifests/prod-pam.yaml"],
    poll_interval_seconds=300,
    github_repo="Keeper-Security/our-tenant-manifests",
    github_token="ghp_...",
    pr_base_branch="main",
    dry_run=False,
    state_file=None,           # or explicit path / KEEPER_MANIFEST_DRIFT_WATCH_STATE_FILE
    dedup_ttl_seconds=86400,   # or KEEPER_MANIFEST_DRIFT_WATCH_DEDUP_TTL_SECONDS
)
watch_loop(cfg)

Subprocess and state contract

watch_loop invokes keeper-manifest plan --json per manifest, validates "schema": "keeper-plan-result.v1" (plus the strict 5-key versionless legacy envelope), verifies integer summary/change-row/exit-code consistency before any side effects, and treats:

  • exit 0 → verified clean poll; clears active drift for that manifest and allows adaptive 1.5x clean backoff
  • exit 2 → validated drift detected; dispatches unsuppressed per-destination alerts/PRs
  • exit 4 / 5 / malformed JSON / inconsistent counts → unhealthy error; records healthy: false without backing off or erasing unresolved drift

Health and delivery fingerprints are persisted atomically (0600, O_NOFOLLOW, max 1 MiB) as "schema": "keeper-drift-watch-state.v1" at state_file (or --state-file / KEEPER_MANIFEST_DRIFT_WATCH_STATE_FILE; default $KEEPER_MANIFEST_DRIFT_WATCH_STATE_DIR → $XDG_STATE_HOME/keeper-manifest/drift-watch → ~/.keeper/drift-watch/state-<sha256>.json).

  • Per-destination deduplication and retry: Each enabled channel (slack, servicenow, github_pr) is marked only after successful delivery and suppressed for identical SHA-256 plan-intent fingerprints within dedup_ttl_seconds; failed channels retry on the next poll.
  • Redacted-secret hashing limit: Because plan --json redacts secret values (***REDACTED***), consumer-only hashing cannot distinguish two plans that differ exclusively inside redacted secret ciphertext when visible keys and metadata are identical.
  • Crash-duplicate bound: If the daemon crashes after an external send succeeds and before the local atomic rename commits keeper-drift-watch-state.v1, that destination may receive a duplicate notification on restart. Persisted state never enables auto_apply or bypasses --dry-run, --require-clean-git, or CLI FileLock enforcement.

Timeouts (defaults - env-overridable):

Operation Default Env override
keeper-manifest plan 120 s KEEPER_MANIFEST_PLAN_TIMEOUT_SECONDS
git fetch / git push 60 s (not env-overridable)
gh pr create 60 s (not env-overridable)
ServiceNow response read 1 MiB (not env-overridable)

License

MIT - see the parent repository.

Metadata

Release files for keeper-manifest-drift-watch 1.0.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keeper-manifest-drift-watch 1.0.0rc2
File Size Uploaded Provenance Actions
keeper_manifest_drift_watch-1.0.0rc2.tar.gz 17.2 kB With provenance Details for keeper_manifest_drift_watch-1.0.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for keeper-manifest-drift-watch 1.0.0rc2
File Interpreter ABI Platform Actions
keeper_manifest_drift_watch-1.0.0rc2-py3-none-any.whl Python 3 none any Details for keeper_manifest_drift_watch-1.0.0rc2-py3-none-any.whl

Total release size: 34.1 kB

Release files / keeper_manifest_drift_watch-1.0.0rc2.tar.gz

Download URL keeper_manifest_drift_watch-1.0.0rc2.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ccbcad96868e61225d0282d43708cfe27d03d1b7520aef0b6cde33df9f01a54a
BLAKE2b-256 checksum
How to use checksums
306ecd961cf16f6937f0d6a1e7cd325fa5e1c9a780c0b7617a0cec876082748a
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 Nov 24, 2026.

Transparency log

Release files / keeper_manifest_drift_watch-1.0.0rc2-py3-none-any.whl

Download URL keeper_manifest_drift_watch-1.0.0rc2-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87703754db5f551b66ca0092c32ff65bed333537e5b6b6db03e5d63024b92c2b
BLAKE2b-256 checksum
How to use checksums
7b5f32db93b75610d19cd0f0b7cd390c74fbce7eb557a7dee7c1ef6dc506ca74
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 Nov 24, 2026.

Transparency log

Security for keeper-manifest-drift-watch 1.0.0rc2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for keeper_manifest_drift_watch-1.0.0rc2.tar.gz

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 Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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