Inspiration
Borrower-side corporate treasury teams still prepare debt-covenant compliance certificates manually. Every credit agreement has custom legal definitions of what counts as "Funded Debt" and "Consolidated EBITDA", test periods must match financial reporting dates, and amendments mid-life adjust thresholds. A single miscalculation or unverified add-back can trigger an event of default or lender sanctions.
We built Covenant Certificate to transform this risky, spreadsheet-driven ordeal into an auditable, evidence-first workflow — giving corporate controllers and CFOs complete confidence without ever delegating financial authority to a black-box LLM.
What it does
Covenant Certificate automates covenant compliance end-to-end while keeping the human firmly in control:
- Primary Document Intake: Treasury reviewers upload credit agreements and financial statements (SEC 10-Ks, 10-Qs) into immutable, SHA-256 hashed storage.
- Cited Rule Extraction & Parsing: Extracts covenant clauses (e.g., Section 6.14 Consolidated Net Leverage) and legal definitions with page-level citations.
- Deterministic Decimal Arithmetic: Calculates ratios using typed Python
Decimalarithmetic — no LLM hallucination and noeval. - Fail-Closed Governance: If an EBITDA add-back lacks proof or a financial statement covers the wrong fiscal period (e.g., 2023 filings for a 2024 test date), the system automatically halts at
NEEDS_REVIEWand blocks any compliance pass. - Human Controller Review: Allows treasury reviewers to resolve issues or formally request updated evidence with immutable rationale records.
- Officer-Locked Approval & Printable Workpaper: Generates an officer-reviewed draft workpaper (PDF with DRAFT watermark and full audit trail) binding officer identity, revision numbers, and cryptographic hashes.
How we built it
We architected a 5-tier enterprise stack prioritizing durability, observability, and auditability:
- Core Pipeline (LangGraph & Python): Built a 9-node stateful LangGraph workflow that orchestrates document resolution, definition compilation, evidence mapping, policy evaluation, and package assembly.
- Deterministic Calculator: Built in pure typed Python using the
decimalmodule to eliminate floating-point drift and guarantee mathematical honesty. - Backend Gateway (FastAPI): Implemented high-performance async REST routes with AG-UI protocol support for real-time agent streaming.
- Durability & Platform (Supabase & PostgreSQL): Backed by Supabase Postgres with 7 tracked migrations for revision tracking, LangGraph checkpoints, and a durable, fenced background worker queue.
- Modern Frontend (Next.js 16 & React 19): Powered by Next.js App Router, Turbopack, and CopilotKit v2 for docked chat and audited document intake, styled with bespoke, distraction-free CSS modules.
- AI & LLM Integration: Multi-model support via LangChain OpenAI adapters connecting to NVIDIA NIM (
nvidia/nemotron-3-super-120b-a12b) and Google Gemini (via LiteLLM proxy), with a fallback deterministic graph for offline resilience. - Observability: Integrated Neatlogs for distributed workflow tracing and span monitoring.
Challenges we ran into
- Fail-Closed Date & Evidence Boundaries: Ensuring the system never defaults missing values to zero or assumes a period pass required strict deterministic date-matching regex and fail-closed state machines.
- Real SEC Primary Sources: Parsing non-standard SEC exhibits (such as the Aon Term Loan Credit Agreement PDF and Form 10-K HTML tables) without losing precise section citations.
- Parallel Durability & Offline Fallbacks: Building a system that seamlessly runs in full enterprise PostgreSQL mode while providing instant in-memory offline mode for local development.
Accomplishments that we're proud of
- Zero False Passes: Verified across our evaluation harness that 0/8 blocked condition runs produce a compliant status and 0/15 runs pair a pass with open issues.
- Model as Worker, Never Judge: Succeeded in using LLMs strictly for proposal and tool-calling, while typed Python handles math, policy enforcement, and audit packaging.
- Instant 1-Click Workpapers: Delivering printable, boardroom-ready audit workpapers with cryptographic package hashes directly in the browser.
What we learned
- In high-stakes finance and treasury workflows, governance is the product. Strict verification, immutable audit records, and typed determinism build far more enterprise trust than generative autonomy alone.
What's next for Covenant Certificate
- Expanding coverage from Leverage Ratios to Fixed Charge and Interest Coverage covenant families.
- OCR pipeline support for scanned legacy loan documents.
- Multi-lender syndicate API connectors for secure, push-button draft packet delivery.
Built With
- copilotkit
- fastapi
- gemini
- langchain
- langgraph
- litellm
- neatlogs
- next.js
- nvidia-nim
- pdfplumber
- postgresql
- pydantic
- python
- react
- supabase
- tailwindcss
- three.js
- typescript
- uvicorn
Log in or sign up for Devpost to join the conversation.