Skip to main content

Document Integrity Layer

Detect LLM-induced document corruption before it ships.

What is this?

Document Integrity Layer is a Git pre-commit hook and web dashboard that catches document corruption introduced by AI assistants in real-time. It scans Word, PDF, and Markdown files for hallucinated citations, broken cross-references, malformed tables, and formatting inconsistencies—then generates audit trails proving exactly what changed and why. Built for developers and technical writers who delegate writing to Claude, ChatGPT, or similar tools and need verification that the AI didn't silently break your work.

Features

  • Git pre-commit scanning — Automatically checks staged documents before commits
  • Multi-format support — Analyzes .docx, .pdf, and .md files with semantic understanding
  • Corruption detection — Identifies hallucinated URLs, broken internal links, table structure corruption, and citation inconsistencies
  • Web dashboard — Visual history of all integrity checks across your repository
  • Audit trails — Export compliance-ready reports showing what changed and when
  • Slack/Discord alerts — Real-time notifications when corruption is detected
  • Custom rule configuration — Define project-specific validation rules in .dil.toml
  • Docker-ready — Run locally or containerized; no external dependencies required

Quick Start

Installation

pip install document-integrity-layer

Setup

Initialize in your repository:

dil init

This creates .dil.toml with default configuration. Install the Git hook:

dil install-hook

Configuration

Edit .dil.toml to customize detection rules:

[scanner]
check_citations = true
check_cross_references = true
check_table_integrity = true
check_formatting = true

[alerts]
slack_webhook = "https://hooks.slack.com/services/YOUR/WEBHOOK"

Usage

CLI

Run a one-time scan:

dil scan document.docx

Scan an entire directory:

dil scan ./docs --recursive

View integrity history:

dil history

Web Dashboard

Start the dashboard server:

dil server --port 8000

Navigate to http://localhost:8000 to explore:

  • Scan history across commits
  • Corruption reports with side-by-side diffs
  • Citation and link validation results
  • Custom audit exports

Pre-commit Hook

Once installed, the hook runs automatically:

git add my-document.docx
git commit -m "Update docs"
# → Pre-commit hook scans my-document.docx
# → Reports corruption if found
# → Blocks commit if severity threshold exceeded

Tech Stack

  • Python 3.9+ — Core language
  • Flask — Web dashboard and API
  • python-docx — DOCX parsing and analysis
  • PyPDF2 — PDF text extraction
  • Markdown — Native MD support
  • SQLite — Audit trail storage
  • Docker — Containerized deployment

License

MIT

Release files for document-integrity-layer 0.1.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 document-integrity-layer 0.1.0
File Size Uploaded
document_integrity_layer-0.1.0.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for document-integrity-layer 0.1.0
File Interpreter ABI Platform
document_integrity_layer-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.6 kB

Release files / document_integrity_layer-0.1.0.tar.gz

Download URL document_integrity_layer-0.1.0.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3caab38c50956ef5722a49250689a9891e1d2219c80b517f8087bb6a5bad89e9
BLAKE2b-256 checksum
How to use checksums
38c905a982cb9536b06186cdab20c995ff405cae01887e6164869eae722aeec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / document_integrity_layer-0.1.0-py3-none-any.whl

Download URL document_integrity_layer-0.1.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af19aa71e6b506277b75ec590f2d25e5c3d307600507335974d70cd8df62cef1
BLAKE2b-256 checksum
How to use checksums
759e7c16a17412e0956355f13633b1d5b80bc9b0e3ae7d90cb7bdaf5a2b68e99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.1.0 This release

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