Government contracts have rules. Silent violations are expensive.
H166547 imposes over a dozen enforceable billing requirements. Without automated review, even a careful team misses things — and the City doesn't send warnings before withholding payment.
📋
Manual review bottleneck
AP staff spend 45–90 minutes per invoice cross-checking contract terms. Volume grows, headcount doesn't.
~$2,100 / month in staff time
⏱
14-day payment window violations
§4.4.1.2 requires subcontractor payment within 14 working days of City payment. One late cycle triggers audit exposure.
Potential payment withholding
🔎
Contextual rules need judgment
§11.8.1.1 prohibits internal meeting expenses. These hide in line-item descriptions — "Strategy Lunch," "Team Planning Day" — no rule engine catches them without reading the text.
Audit risk per invoice
📬
No audit trail by default
When the City disputes a payment, a clear record of what was checked and when — with contract section citations — is the difference between resolution and escalation.
Legal + admin exposure
2 How It Works
Seven steps. Fully automated. Under 60 seconds.
From invoice submission to a complete audit report with cited contract violations — no human required unless the engine flags it.
01 · INTAKE
📥
Receive Invoice
Webhook accepts payload. Invoice ID, vendor, total, dates, and PDF data ingested. Required fields validated before processing begins.
02 · EXTRACT
🔍
Parse & Normalize
ContractIQ extracts all fields from PDF. Data normalized and merged with submitted payload. Extraction status logged.
03 · HARD RULES
⚖️
Deterministic Audit
Six mathematical H166547 checks run in sequence — payment windows, insurance markup, PRISM deadlines, prevailing wage thresholds, and more.
04 · ContractIQ
🤖
Contextual Reasoning
ContractIQ reads line items and descriptions, flags internal meeting expenses, evaluates withholding justification quality, and assesses documentation completeness.
05 · CLASSIFY
🚦
Compliance Ruling
Hard rule and ContractIQ findings merged. Final status computed: GREEN (auto-approve), YELLOW (human review), or RED (reject).
06 · NOTIFY
📧
HTML Audit Report
For flagged invoices: a professional HTML audit report emailed with all findings, cited section numbers, evidence, and recommended action.
07 · RESPOND
✅
Structured Return
Complete audit report returned via webhook response — plugs into any downstream system: HubSpot, Airtable, your accounting platform.
3 Compliance Rules
Six hard rules. One ContractIQ reasoning layer. Every invoice.
The engine encodes H166547's enforceable billing requirements as deterministic code, then layers ContractIQ contextual judgment on top — catching what math alone misses.
Hard Rules — Deterministic Checks
R001
14-Day Subcontractor Payment Window
§4.4.1.2 · Working days calculated
Red
R002
Zero Markup on Insurance Reimbursement
§4.3.5 · Dollar-precise comparison
Red
R003
Withholding Justification Documentation
§4.4.1.3 · 4-part form required
Yellow
R004
PRISM Monthly Reporting by the 5th
§4.5.3 · Date-aware check
Yellow
R005
Prevailing Wage Certification
§4.20 · $25K construction / $15K repair
Red
R006
Competitive Bidding Documentation
§1.6 · Required bid docs attached
Yellow
ContractIQ Reasoning Layer
What math can't catch, ContractIQ reads.
After deterministic checks, ContractIQ reviews every line item description for contextual compliance issues. No rule can flag "Internal Strategy Lunch" — but ContractIQ reading the expense description can.
Internal meeting & subsistence expenses (§11.8.1.1) — reads expense text
Withholding justification quality — assesses 4-part standard completeness
Ambiguous expense categories — flags items requiring human judgment
Every violation cited. Every section referenced. Emailed automatically.
When an invoice is flagged RED or YELLOW, a professional audit report is emailed instantly — with every finding cross-referenced to the exact H166547 contract section.
This invoice contains three critical violations requiring immediate rejection under H166547. The §4.3.5 insurance markup of $50 is mathematically prohibited. The internal strategy lunch billed under §11.8.1.1 was identified by AI review of expense descriptions — this is non-reimbursable regardless of amount. Recommend vendor resubmit with corrected insurance line and documented evidence of client-facing nature of all subsistence expenses.
6 Impact
From hours to seconds. From exposure to evidence.
The engine replaces manual review for every invoice cycle — and adds a documented audit trail that didn't exist before.
<60s
Audit Time Per Invoice
Down from 45–90 minutes of manual review per submission
6
Hard Rules Automated
All enforceable H166547 billing requirements encoded and checked deterministically
100%
Coverage
Every invoice audited — no sampling, no backlogs, no exceptions
∞
Audit Trail
Every ruling documented with contract section citations — defensible record from day one
7 Go Live
Three steps to production.
The workflow is built, tested, and live. Going live requires one credential and one endpoint change.
Set the API Key
In n8n Settings → Variables, add your key. The engine uses ContractIQ for PDF extraction and ContractIQ compliance reasoning.
ANTHROPIC_API_KEY = sk-ant-…
Connect Your AP System
Point your invoicing tool or script to the webhook endpoint. Any system that can POST will work — QuickBooks, Airtable, manual submission.
POST /webhook/invoice-audit
Set Slack Alert Channel
Add SLACK_BOT_TOKEN and SLACK_CHANNEL_ERRORS variables. Critical failures notify your team instantly.
SLACK_CHANNEL_ERRORS = #cipher-errors
Expand to More Contracts
H166547 is the first ruleset. Additional City of San Diego contracts, or any government billing standard, can be encoded as a new rule base and loaded dynamically.