Automate Financial Reporting: The Court Report I Generate in Minutes
How I automate financial reporting for a court-mandated monthly operating report: query the GL, draft the narrative with AI, tie to the bank to the cent.
By Mike Hodgen
The Week That Disappeared Every Month
One of the companies I run has to file a detailed financial report to an oversight body every month. Strict five-day window. Miss it and there are real consequences, the kind you don't explain away with a nice email.
The package isn't one document. It's eight tied-out artifacts plus a sworn narrative: an operating P&L, a balance sheet, an income and deposits exhibit, a disbursements exhibit, bank reconciliations, a cash summary, and a written narrative describing the month's activity. Every number has to tie. Every exhibit has to agree with every other exhibit. And someone has to sign it, under oath, saying it's true.
The manual version of this was brutal. Pull the general ledger. Hand-build each exhibit in a spreadsheet. Re-key categorized transactions into the income and disbursement formats. Write the narrative from memory and notes. Then spend hours chasing the one number that doesn't tie, because something got dropped or transposed somewhere in the copy-paste.
It ate roughly a full week of skilled accounting time. Every single month. On a deadline that does not move.
The pain wasn't the difficulty of any one task. It was the recurrence and the legal weight. The same hard, careful work, redone from scratch, twelve times a year, with no margin for a mistake.
So when I decided to automate financial reporting for this, I knew the real question wasn't "can a script build a spreadsheet." It was harder: can you actually automate something you have to legally stand behind?
That doubt is the right instinct. If you're a CEO who's been burned by an AI vendor promising magic, you should be skeptical of anyone who says "AI will write your compliance report." Most of the time they're wrong. Here's how I made it work anyway, and where I deliberately kept the machine away from the numbers.
Why You Can't Automate Reporting If Your Books Live in a Black Box
Here's the prerequisite nobody selling AI tools wants to talk about. You cannot automate financial reporting on top of a ledger you can't query.
The GL has to be queryable
Every exhibit in this package is just a different shape of the same underlying data. The income exhibit and the disbursements exhibit are both derived from the same categorized bank transactions and their offsetting accounts. The P&L and balance sheet are rollups of the same ledger entries. None of them are independent. They're all views of one source.
That only works if the source is structured and queryable. The general ledger for this company is in-house. I built it as the Postgres ledger I built, a proper double-entry system where every transaction is a row I can query directly.
Categorized transactions are the raw material
The raw material for everything downstream is clean, categorized transactions. Each bank transaction has a category and an offsetting account. That categorization is what lets the income exhibit pull "deposits of type X" and the disbursements exhibit pull "payments of type Y" and have them both reconcile back to the same ledger.
If your books live inside a closed accounting app where the data only comes out as a formatted PDF, your first job isn't AI. It's getting clean, queryable, categorized transaction data out of that black box.
I'll be honest: this is the real work. This is the boring plumbing that makes everything above it possible, and it's exactly why most compliance reporting stays manual. People want the magic report generator. They skip the part where the books have to be queryable first. Then they wonder why nothing automates.
How I Query the General Ledger Into Eight Exhibits
Once the ledger is queryable, each artifact stops being a manual build and becomes a query. The same GL, reshaped into the format that specific exhibit requires.
One Queryable Ledger, Eight Views
P&L and balance sheet from account rollups
The operating P&L and the balance sheet are account-level rollups. The code groups ledger entries by account, sums them across the period, and arranges them into the required statement structure. This is general ledger reporting done as data transformation, not manual re-entry.
There's no spreadsheet. There's a query that produces revenue accounts, expense accounts, asset accounts, and liability accounts in the exact layout the oversight body wants to see.
Income and disbursement detail from categorized transactions
The income and deposits exhibit and the disbursements exhibit are built from the categorized bank transactions and their offsetting accounts. Because both pull from the same ledger, they reconcile to the same source automatically. There's no version where the income exhibit and the P&L disagree, because they're the same numbers queried two ways.
The thing I care about most: no number is invented or estimated. Every figure on every exhibit traces back to a specific ledger entry. The code does the math, deterministically. Run it twice on the same data and you get the same answer to the cent.
The exhibit formats themselves are defined as configuration. So when the oversight body adds a new required schedule, I'm not rebuilding the pipeline. I'm writing a new query against the same ledger and adding it to the config. A new exhibit is a new view of existing data, not a new project.
That's the whole shift. The manual version treated each exhibit as a separate hand-built document. The automated version treats all eight as different shapes of one queryable source.
Where the AI Is Allowed to Touch the Report (And Where It Isn't)
This is the part that answers the buyer doubt directly. Can AI safely produce a report you legally stand behind? Yes, but only if you're disciplined about where it's allowed near the work.
Where AI Is Allowed vs Where Code Computes
AI drafts the narrative, not the numbers
In this pipeline, the Claude agent drafts exactly one thing: the narrative exhibit. The prose summary describing the month's activity. It reads the activity, understands what happened, and writes a clear paragraph or two explaining it in plain language.
It never computes a balance. It never produces a financial figure that gets filed. Not one number on any exhibit comes from the model.
This is the line I draw on every system I build: let the model judge, let the code compute. The AI is good at reading context and writing readable prose. It is not good at being trusted with totals, and I treat it that way on purpose. The model is great at finding problems, terrible at being trusted with totals, so I let it draft language and keep it far away from anything that has to add up.
The reconciled-cash override
There's one deliberate override worth explaining. The cash figure in the report is forced to the reconciled bank balance, not the raw GL cash balance.
Why? Because for cash, the bank is the source of truth. The GL might show a cash number that hasn't accounted for a transaction still clearing, or a timing difference. The bank statement is the ground truth that gets sworn to. So the pipeline overrides GL cash with the reconciled bank figure.
That's a human policy decision encoded into the code. It's not the AI deciding cash should be different. It's me deciding, once, that cash always ties to the bank, and the pipeline enforcing that rule every month.
The architecture is the answer to the doubt. AI writes words. Code computes numbers. Policy decisions like the cash override are encoded explicitly, not inferred. Nothing the model produces gets filed as a financial fact.
Tied to the Bank, to the Cent, Before Anything Gets Filed
Here's the mechanism that makes me comfortable signing this. Before the package publishes, the generator validates every figure against the bank to the cent.
Validation gate, not a suggestion
This is a hard gate, not a warning. If the numbers don't tie to the reconciled bank figure, the pipeline stops. It does not file. It does not produce a package with a note saying "please check this." It refuses to proceed.
The Validation Gate: Warning vs Hard Gate
That distinction matters. A warning is something a tired person ignores at 11pm. A gate is something the machine enforces whether anyone's watching or not.
Nothing publishes until it balances
Think about what this means legally. A sworn report you have to stand behind needs to be provably correct. A deterministic tie-out to the bank gives you exactly that proof. The package that publishes has, by definition, already reconciled to the cent against the source of truth.
The AI-drafted narrative still gets reviewed by a human before filing. A person reads the prose, confirms it accurately describes the month, and signs. That's the right division of labor: the machine guarantees the numbers, the human owns the words and the signature.
Here's the point I want every skeptical CEO to sit with. This automation is safer than the manual process, not riskier.
The manual version relied on a skilled person catching a transposition error in a spreadsheet at the end of a long week. Humans are good, but they're not perfect at that, especially under deadline. The machine catches the discrepancy every single time, or it refuses to proceed. There's no tired-at-11pm failure mode.
When people worry that automating a compliance report is dangerous, they're usually comparing it to an imaginary perfect manual process. The real manual process had errors too. The difference is the automated one can't file a mistake.
Publishing the Package: From Query to Drive Folder
Once the package validates, the generator assembles all eight exhibits plus the narrative and publishes the complete package to the correct year and month folder in Drive. Automatically.
The Full Reporting Pipeline: GL to Validated Package
No copy-paste. No manual file naming. No "oh no, I saved it in the wrong folder" mistake that costs an hour to untangle. The right files land in the right place, named correctly, every time.
Here's the full pipeline in one breath: query the GL into each exhibit's required shape, draft the narrative with the AI agent, apply the reconciled-cash override, validate every figure against the bank to the cent, and publish the assembled package to Drive. If validation fails anywhere, it halts before publishing.
The whole thing runs in minutes.
That's the part that still feels strange to say out loud, given it used to be a week. This is monthly operating report automation that produces compliance-grade output. Not a rough draft someone has to spend a day fixing. The package that comes out the other end is the package that gets filed, after a human reviews the narrative and signs.
The numbers are already right because they can't publish if they're wrong. The format is already correct because it's defined in config. The file is already in the right place because the code put it there.
What This Actually Frees Up
A full week of skilled accounting time, recovered every single month, with fewer errors than the manual process ever produced.
Manual vs Automated Reporting: Time and Risk
The deadline stopped being a fire drill. The five-day window used to dominate the start of every month. Now the report generates, a human reviews the narrative, and it files. The stress of "will it tie in time" is gone, because tying is the precondition for it existing at all.
I track this kind of thing carefully, because "AI saved us time" is a useless claim without numbers behind it. That's why I keep a record of how I track what AI actually saves across every system I build. Vague time savings don't survive a board meeting. Specific recovered hours do.
Let me be honest about the limits. This works because the books are clean and queryable, and because a human still reviews the narrative and signs the filing. I didn't remove the human from the legally important decision. I removed the human from the error-prone re-keying and the late-night number chasing.
If your books are stuck in a closed app, the ledger work comes first. There's no shortcut around that.
The takeaway for a CEO or COO is simple. Any recurring compliance report your team builds by hand is a candidate for this exact pattern: ledger to exhibits to validated package, with AI handling the prose and code guaranteeing the totals. Monthly operating reports, regulatory filings, board packages, anything that has to be exactly right on a schedule.
If your team loses days every month to a report that can't have a single number wrong, that's precisely the kind of thing I build.
Want to explore what AI could do for your business?
Book a free 30-minute strategy call. No pitch deck, no sales team, just a real conversation about your operations and where AI actually fits.
Get AI insights for business leaders
Practical AI strategy from someone who built the systems — not just studied them. No spam, no fluff.
Ready to automate your growth?
Book a free 30-minute strategy call with Hodgen.AI.
Book a Strategy Call