Redline

Deterministic compliance document linter. Every flag traces to a regulation paragraph. Zero LLM cost at runtime. DLP-safe.

$ pip install redline-compliance
65 rules 8 regulations 49 tests passing MIT license

The problem: Compliance teams review documents manually at $200-$500/hour. Inconsistent. Slow.

The LLM trap: Uploading 200 internal policy docs to ChatGPT violates your DLP policy. LLM output is non-deterministic and produces no audit trail.

The solution: Generate deterministic rules from regulations once. Run them in milliseconds on every document. Each flag is auditor-verifiable.

How It Works

# Step 1: LLM reads regulation once
redline generate soc2-criteria.md --id SOC2

# Step 2: Rules run deterministically forever
redline lint policies/security-policy.md

# Output: traceable findings
ERROR line 47: "adequate controls" -> SOC2 CC6.1
ERROR line 83: "as soon as practical" -> SOC2 CC7.4
WARN  line 112: "trusted vendors" -> SOC2 CC9.2

Audit Trail

Every finding chains from document to regulation paragraph. An auditor can verify the rule exists, it maps to the correct section, and the token matched. No black box.

Finding: "adequate controls" flagged at line 47
Rule: FinCompliance.SOC2VagueAccessControls
Requirement: SOC2-CC6-01
Regulation: SOC 2 Trust Services Criteria, CC6.1
Authority: AICPA
Severity: error
Source: deterministic (confidence: 1.0)

Regulatory Coverage

Regulation Rules Domain Authority
SOC2 Trust Services10Security / GRCAICPA
GDPR10Data ProtectionEU
HIPAA Security Rule10HealthcareHHS
ISO 2700110Information SecurityISO/IEC
BSA/AML6Financial CrimeFinCEN
SEC Marketing Rule6Investment AdvisorsSEC
FINRA Communications5Broker-DealersFINRA
SOX Section 4045Internal ControlsPCAOB

Plus common quality rules: plain language, passive voice, sentence length, date formats, defined term consistency.

Why Not Just Use an LLM?

DLP Risk

Uploading internal policies to ChatGPT violates data loss prevention policies. Redline runs locally.

No Audit Trail

LLM output is a blob of text. Redline traces every flag to a specific regulation paragraph. Auditors can verify.

Non-Deterministic

Same document, different LLM output each time. Redline produces identical results every run. CI-friendly.

65 rules. 8 regulations. Zero runtime cost.

Open-source under MIT. Rule generation pipeline included.

GitHub PyPI