The pitch for AI bookkeeping is simple: an agent reads the receipt, codes the expense, posts the entry. The worry is just as simple: what happens when it gets one wrong, and who finds out?
Prompts do not answer that worry. Prompts are suggestions. The only answer that holds up is a ledger that refuses bad entries on its own, in the database, no matter who or what is posting. Cosbase's kernel enforces nine such rules. Here they are, in the order an accountant would care about them.
1. Every entry balances
Debits equal credits, in base currency, or the entry is rejected before it exists. Foreign-currency lines carry their rate and are converted at post time, so a multi-currency invoice still balances to the cent.
2. Every line hits an active account
No posting to an account that was deactivated, misspelled or invented on the spot. An agent that wants a new account asks for one, and that request is visible.
3. Entries land in open periods
A hard-closed month is a wall. A soft-closed month is a gate: a post from anyone below the controller is staged for the controller to approve, which is how a late invoice gets in without re-opening the books.
4. Posted entries are never updated or deleted
This one is enforced by database triggers and grants, not application code. The tables that hold journal entries, lines, the audit log and period snapshots cannot be changed or truncated, even by a bug in our own server. The only field that ever changes on an entry is the pointer to its reversal, exactly once.
5. Entry numbers are gapless and monotonic
If entry forty-two exists, forty-one exists and forty-three is next. There is no way to slip an entry in between or to leave a hole that hides a deletion.
6. The hash chain is intact
Every entry carries a hash of its contents and of the previous entry's hash. Change one byte anywhere in history and every later hash stops matching. The chain is verified nightly, on demand, and before any kernel upgrade.
7. Closed-period balances never change
When a period is hard-closed, nothing posts into it again, and its trial balance is snapshotted. Every verification run recomputes the closed period's balances and compares them with the snapshot: a difference is reported as a break, not smoothed over.
8. Every entry says where it came from
Each entry names its source and a reference in it. An invoice's entry says txns and the invoice. A hand entry says manual and whatever the person typed. Only the system that produces a kind of entry stamps its source; a direct post is always manual, so nothing can pass itself off as an invoice.
9. Reversals are computed by the kernel
Undoing an entry is not editing it. You ask the kernel to reverse it, and the kernel writes the exact mirror, sides swapped, linked both ways. The original stays, the reversal stays, and the net is zero.
Why this matters more with agents than with people
A person who codes an expense wrong usually codes it wrong once. An agent that misreads a pattern can do it fifty times before anyone looks. Rules enforced in the database turn that from a cleanup project into a non-event: the fifty bad posts never happened, and the fifty rejections are in the audit log with the prompt that caused them.
The same rules make the agent more useful, not less. Because the ledger is trustworthy, an agent can be given a poster role and left to do routine work. The thresholds that route unusual entries to a human are the company's own approval rules, and they apply to agents and people alike.
What this looks like in practice
Connect an agent, tell it to log a receipt, and watch. Below the company's threshold and with evidence attached, it posts. Above the threshold, or with low confidence, the entry waits in the inbox with the agent's reasoning. Either way, the entry that lands is balanced, numbered, hashed and sourced, and no one, including the agent, can quietly change it later.
That is what we mean by a ledger an AI can be trusted with: not a smarter prompt, a stricter database. See the rules in the open or request a demo.