DEV Community

Cover image for Don’t Let AI Agents Write to Your Ledger Unsupervised. Use This Pattern Instead.
appse ai
appse ai

Posted on

Don’t Let AI Agents Write to Your Ledger Unsupervised. Use This Pattern Instead.

Would you let an AI agent write straight to your company’s general ledger?

Most finance teams would say no. They’re right. But the same teams are stuck with a slow close. In Ledge’s 2025 benchmark survey of 100 finance professionals, 50% said closing the books takes six or more business days.

The fix isn’t full autonomy. It’s a simple design pattern: propose, approve, post.

Why is the month-end close hard to automate?

The close is a data problem before it’s an accounting problem. A typical mid-market close pulls from four sources: AP invoices arriving as PDFs in email, bank files in MT940, BAI2 or CSV, Shopify, Amazon and EDI settlements on their own schedules, and intercompany balances across entities.

Every source has its own format, timing and quirks. Every handoff needs a person. That’s where the days go.

What is the propose-approve-post pattern?

It splits the close into three layers.

Propose: an agent does the rules-based work, such as matching, drafting and calculating.
Approve: a person reviews the proposal and its context.
Post: only approved entries are written to the ERP, and every step is logged.

The agent never skips the approval layer. That’s what makes the system auditable.

What does it look like in code?

Take bank reconciliation. Here’s a simplified illustration of confidence-based matching:

def match_score(bank_line, invoice):
score = 0.0
if abs(bank_line.amount - invoice.open_amount) < 0.01:
score += 0.5
if abs((bank_line.date - invoice.due_date).days) <= 5:
score += 0.2
if invoice.number in bank_line.reference:
score += 0.3
return score

def reconcile(bank_line, open_invoices, threshold=0.8):
best = max(open_invoices, key=lambda inv: match_score(bank_line, inv))
if match_score(bank_line, best) >= threshold:
return propose_match(bank_line, best) # queued for approval
return log_exception(bank_line) # sent to review with context

Notice what’s missing: there’s no post_to_erp() call. High-confidence matches become proposals. Low-confidence lines go to an exception log. Posting happens only after a person approves.

Which steps should stay human?

Draw the line by risk, not by effort.

Agents prepare: bank matches, accruals and prepayments, intercompany eliminations, FX revaluation, and first-pass variance notes.
Humans decide: period lock, material journal approval, write-offs, policy overrides, and close sign-off.

If a step is repeatable and verifiable, an agent can prepare it. If it needs judgment or accountability, it stays with a person.

Where should you start?

Start small and measure.

Step 1: Record a baseline for one entity: days to close, hours spent on bank reconciliation, unmatched items.
Step 2: Automate one workflow, usually bank reconciliation or AP intake, with the approval gate switched on.
Step 3: Run a full close cycle on live data before adding accruals, FX or VAT.

Build the agents on top of the ERP you already run, such as SAP Business One, NetSuite or Microsoft Dynamics 365 Business Central. A parallel system adds a data sync, and a data sync adds a failure point.

The takeaway

The safest AI in finance isn’t the most autonomous one. It’s the one that does the work and still waits for a yes.

Want the full rollout plan, from subledgers to VAT? Read the complete playbook on appse ai: https://appse.ai/blog/month-end-close-automation-ai-agents

Top comments (0)