WTWilly Tai
Case studyAI Governance & AssuranceLive demo · real clauses, synthetic borrower

The covenant certificate that will not sign through a breach.

Covenant compliance against a bespoke credit agreement is usually one analyst's spreadsheet, rekeyed monthly, drifting quietly from the negotiated definitions until an auditor or a refinancing lender recomputes it. Covenant Sentinel is the governed alternative. The model extracts each defined term once from a real credit agreement with verbatim clause citations and abstains where the document defines nothing, a named treasurer confirms and freezes the definitions, and from then on deterministic code recomputes every ratio from every monthly trial balance and drafts the certificate by substituting computed values. When a disputed add-back is excluded, the Sign button dies with the breaching clause quoted on screen.

3.310x → 3.530x
one add-back moves the answer
$2,400,000 of restructuring against a <3.50x covenant. Synthetic TBs, real clause.
4 months
early warning of the crossing
Both projections put the breach at 2026-10, computed at the June close.
5 + 3
clauses frozen, terms abstained
Verbatim quotes with hashes; what the document does not define is said out loud.
~3 ms
24 TBs × 8 combinations
The full recompute, client-side, on every toggle. Measured in the app.

Clauses quoted verbatim from a Manitowoc credit agreement amendment on SEC EDGAR · borrower and trial balances synthetic, seeded · deterministic engine → identical ratios and hashes on every run.

01 · The exposure

A personal attestation, computed in a spreadsheet nobody re-reads against the contract.

A compliance certificate is a personal certification, typically by the CFO or another responsible officer, that the covenant calculations are correct, and lenders can treat an incorrect certificate as a default in its own right. The calculation behind it runs against negotiated legal definitions: a Consolidated EBITDA with a bespoke add-back list, leverage and coverage ratios defined in the agreement, thresholds that step quarter by quarter. In most mid-market treasuries all of that lives in Excel, transcribed once from a 150-page agreement at signing and rekeyed from the trial balance every month.

The failure mode is drift, and it is well documented in the covenant data. Lincoln International's Senior Debt Index, which values several thousand private companies quarterly, reported covenant defaults rising for three consecutive quarters to 3.4% in Q2 2025, against a seven-year average of 4.4%, with covenant breaches rather than missed payments dominating the default count (Lincoln SDI, Q2 2025, Q3 2025). A technical breach that surfaces late does not stay technical: it arrives during the audit or a refinancing, on a certificate the CFO signed personally, and it can drag waiver negotiations and going-concern discussions in with it.

02 · Why "let the model read the agreement monthly" fails

The agreement is read once in a decade. The arithmetic runs every month. Those are different jobs.

The tempting AI fix is to hand the model the agreement and the trial balance every month and ask whether the company is compliant. That design is wrong on both sides of the boundary. On the reading side, a model that re-reads the contract monthly can re-interpret it monthly, which reintroduces exactly the drift the control was meant to kill, only faster and with more confidence. On the computing side, a leverage ratio is division. A system that can produce different EBITDA figures from identical inputs is not a compliance control; a re-run that does not reproduce the certificate is itself an audit finding.

There is also a subtler trap: the agreement you have is never complete. The exhibit this demo uses is an amendment that restates the definitions and covenants, but the base agreement's text is not in the filing. A model that answers anyway is guessing about a legal document. The correct output for "Consolidated EBITDA" in this exhibit is "not defined in this document", and an unconstrained model is the one system that will never say it. So the design splits the work: the model locates and quotes, once, under confirmation; code computes, forever, under hashes.

03 · The trust boundary, applied

Extract once with citations. Confirm once with a name. Then deterministic forever.

Phase 1 runs once, at signing. The extraction stub locates each defined term in the real agreement text and must quote the clause verbatim with its section reference; the extraction script refuses to ship any quote it cannot literally find at a recorded character offset. Terms the document does not define are surfaced as abstentions with their occurrence counts. The treasurer confirms each extracted term, supplies the missing definitions manually (marked manual, never presented as extracted), and the confirmation freezes everything to the ledger with clause hashes. Phase 2 runs every month, and no model appears anywhere in it: code maps TB accounts to the frozen definitions, recomputes the three ratio covenants across all 24 months, projects the trajectory two ways, enforces the negotiated add-back cap, and drafts the certificate by substituting computed values into the template.

PHASE 1 · ONCE, AT SIGNING PHASE 2 · EVERY MONTH, DETERMINISTIC ONLY Real agreementSEC EDGAR exhibit Model, locate onlyverbatim quote + sectionabstains: not found Treasurerconfirms · gate 1freezes + clause hash 24 monthly TBssynthetic · hashed Covenant enginefrozen defs → ratios + headroomcap check · linear + seasonaltrajectory to breach Certificate draftcomputed values only Sign gatebreach or thin headroom:DO NOT SIGN, clause quoted CFO signsgate 2 · screen statehashed at signature Append-only, hash-chained ledgerfrozen definitions (clause hashes) · 24 TB hashes · every computation run · every abstention, block and signature · replayable
fig.1 · extract once under a human gate, then a deterministic loop that ends in a gate that can refuse

The clauses are real. The demo extracts from Amendment No. 3 to Manitowoc's Amended and Restated Credit Agreement (SEC EDGAR, January 2010): the Consolidated EBIT definition with its negotiated add-back list, the three ratio covenant schedules of Sections 6.07, 6.08 and 6.21, and the Section 5.01(c) certificate requirement. Clause (h) of the EBIT definition caps post-2010 non-recurring cash restructuring add-backs at $15,000,000 in aggregate, which is precisely the kind of negotiated detail a spreadsheet forgets and code cannot: the engine tracks cumulative claims against the cap on every run, whatever anyone decides to call "non-recurring".

04 · The decision function

The gate is a comparison against a frozen threshold, so it is written as one.

Here is the deterministic core from the shipped engine: the covenant state check that drives the badges, the watermark and the Sign button, and the clause (h) cap check that runs regardless of classification. Compliance under Section 6.08 means strictly below the threshold, because the covenant text says "less than", and the tolerance band is the sign gate's own margin, stated on screen:

// clause (h): the aggregate cap is enforced in code, whatever anyone calls
// "non-recurring". Returns the add-back actually allowed for this window.
function capAllowed(claimWindow, claimedBefore) {
  return Math.min(claimWindow, Math.max(0, CAP_H - claimedBefore));
}

function covState(c, val) {                    // c.thr frozen from the clause
  var breached = c.dir === "max" ? val >= c.thr : val <= c.thr;
  var head = c.dir === "max" ? c.thr - val : val - c.thr;
  return { breached: breached, headroom: head,
           inTolerance: !breached && head < c.tol };
}
// the Sign button is enabled only when gate.reasons is empty:
// any covenant breached OR inside tolerance appends a reason, and the
// first reason's clause is quoted verbatim next to the dead button.
EBITDA, debt and interest are summed from TB accounts over the trailing twelve months per the frozen definitions. The model appears nowhere in this file's phase 2 path.
05 · One dispute, worked end to end

$2,400,000 of "non-recurring" restructuring is the difference between a certificate and a default.

The synthetic borrower carries $127,500,000 of debt against LTM EBITDA that erodes every month. In March 2026 it recorded a $2,400,000 restructuring charge, the third restructuring in as many years, and treasury proposes adding it back under clause (h). The demo's headroom switch makes the dispute a physical object:

ReadingConsolidated EBITDA (LTM)Total leverageAgainst <3.50xThe certificate
Add-back on (treasury's view)$38,520,0003.310x0.190x headroomsignable, trajectory warning on the record
Add-back off (the strict reading)$36,120,0003.530xbreachedwatermarked DO NOT SIGN, §6.08 quoted, button dead

The forward view is computed twice from the same frozen definitions: a linear projection (OLS over the last six LTM points) and a seasonal one (same month prior year plus the mean YoY delta), with debt held flat. Both cross the 3.50x line at the 2026-10 LTM point, four months after the June close the visitor is standing on. The quarterly consequence is the point of the demo: the September 30 test is projected at 3.459x, compliant but with 0.041x of headroom, thin enough that the sign gate would already refuse it; by December 31 the projection is 3.622x, breached. A spreadsheet whose add-backs had drifted would have signed both. The engine shows the crossing in June, quantifies what the September certificate would be signed against, and will not draft its way past December at all.

Every figure argues its own case. Each number on the certificate is a button: Consolidated EBITDA opens the verbatim EBIT clause (hash-verified against the extraction) plus the TB account sums behind it, cap consumption included ($11,150,000 claimed before + $2,400,000 now = $13,550,000 of the $15,000,000 cap). The three terms the exhibit does not define, including Consolidated EBITDA itself, are shown as abstentions with their occurrence counts, and the treasurer's manual definitions are labelled manual. What the document does not say is displayed as loudly as what it does.
06 · What is real, what is constructed, what is out of scope

The clauses are real. The breach is engineered. The discipline transfers.

The computed results, from the engine, every run: total leverage 3.310x with the disputed add-back and 3.530x without it, against the frozen <3.50x threshold; interest coverage 3.535x against >3.00x; senior secured leverage 2.064x against <3.00x; projected breach at 2026-10 on both projection methods, four months ahead of the close being certified; the full 24-month recompute across all eight add-back combinations in single-digit milliseconds, timed live in the page. The ledger replays to identical hashes, and the Tamper button demonstrates the chain locating its own corruption.

The limits, stated flatly. This is one real agreement, and bespoke private-credit definitions vary far more than any single document can show. The exhibit is an amendment; the base agreement's definitions are genuinely absent, which the app handles by abstaining and logging manual definitions rather than by pretending. The GAAP-to-covenant bridge is simplified (a handful of add-backs, no pro-forma adjustments, no equity cure mechanics even though the real document has cure rights), debt is held flat, and the trial balances are synthetic and labelled, shaped so the dispute changes the answer. Clause extraction here is a deterministic stub standing in for a model, so the run reproduces exactly; in production the extraction is a first draft for the treasurer's confirmation rather than legal interpretation, and the app says so on screen. What transfers is the architecture: quote-or-abstain extraction, a named confirmation that freezes terms, computation that cannot drift, and a certificate that can refuse its own signature.

07 · See it run

Flip the add-back. Watch the Sign button die.

The switch is the first thing you can click. Turn the restructuring add-back off and the gauge crosses the covenant line, the certificate watermarks itself, and Section 6.08 is quoted next to the disabled button. Click any certificate figure for its clause and TB lines, sign as the CFO while it is still legal, then tamper with the ledger and watch the chain break at the exact entry.

Open the live demo →Runs entirely in your browser · real clauses from SEC EDGAR · synthetic trial balances · identical results every run

The certificate is a control, so I built it like one.

I have spent enough years around attestations to know that the dangerous ones are signed by careful people holding a schedule that quietly stopped meaning what the contract means. The fix is to read the contract once, in the open, with every quote anchored and every gap admitted, and then to keep interpretation away from the arithmetic permanently. That is what this demo does, and the part I would defend in front of any audit committee is the button that refuses: a certificate that cannot be drafted into compliance is worth more than any dashboard of covenant ratios. If your covenant model is a spreadsheet with a history of "interpretations", the extract-once, deterministic-forever pattern is directly liftable.