AI Bookkeeping for Nonprofits: Restricted and Unrestricted Funds

Coding Liquids tutorial cover featuring Sagnik Bhattacharya for AI Bookkeeping for Nonprofits: Restricted and Unrestricted Funds.
Coding Liquids tutorial cover featuring Sagnik Bhattacharya for AI Bookkeeping for Nonprofits: Restricted and Unrestricted Funds.

A nonprofit can use AI to suggest fund coding by giving it the fund list, written coding rules and the donor or grant terms, then asking it to propose a fund, category and reason for each bank line. An accountant reviews every suggestion that touches a restricted fund. The AI suggests and logs; it never decides or posts.

The catch is that an AI coder only knows the restrictions you write down. Give it a bank line reading "D027 donation for the roof" with no rules file and it will happily call the money unrestricted income, or restricted to the wrong fund. The sample ledger below shows where the AI helps, where it guesses and what your reviewer must check.

Follow me on Instagram@sagnikteaches

What the fund split means for the person coding

An unrestricted fund can be spent on anything that furthers the organisation's purpose. A restricted fund holds money given for a specific purpose, project or period, and it must be spent that way and tracked separately. Some organisations also hold designated funds, which the board has set aside from unrestricted money; that is a board decision, not a donor restriction, and it can be reversed. The accounting terms differ between regions and frameworks, so use the names your accountant uses and keep a one-page glossary in your coding rules.

Connect on LinkedInSagnik Bhattacharya

The difficulty is rarely the concept. It is the volume of ambiguous lines. "Hall hire 180.00" might be a general running cost, or a cost of the funded youth project, or both. A person who knows the grants can code it in five seconds. An AI that has been given the grants can usually do it as well, and an AI that has not will guess confidently. Hence the rules file below.

Subscribe on YouTube@sagnikteaches

Step 1: write the fund list and the coding rules

Create a one-page document that is the only source the AI may use. It contains the fund list, the chart of accounts, and rules written in plain sentences. Here is a filled-in example for a small charity with three funds. The funds and rules are illustrative.

FUNDS
GEN  = General (unrestricted)
YTH  = Youth Project (restricted: donor grant, 1 Apr to 31 Mar, youth sessions only)
BLD  = Building Appeal (restricted: roof repair only, no running costs)

CATEGORIES
Rent and hall hire; Utilities; Salaries; Sessional workers; Equipment; Repairs;
Insurance; Printing and postage; Fundraising costs; Bank charges; Donations in; Grants in

RULES
1. Income: a grant or donation is coded to the fund named in the donor's letter.
   If the bank line gives no purpose, code GEN and set flag = CHECK.
2. Youth sessions costs (sessional workers, equipment for sessions) -> YTH,
   only between 1 Apr and 31 Mar.
3. Hall hire: 60% YTH, 40% GEN (allocation key agreed with the trustees).
4. Roof contractor, scaffolding, surveyor -> BLD. Nothing else is BLD.
5. Insurance, bank charges, accountancy -> GEN.
6. Never code a spend to a restricted fund if its balance would go below zero;
   flag = OVERSPEND instead.
7. If two rules could apply, or no rule applies, flag = CHECK. Never guess.

Rule 7 is the most important one. The aim is for the AI to say "I don't know" often, because every confident wrong answer about a restricted fund is a risk for the organisation.

Step 2: export and clean the bank lines

Export the month's bank transactions as a CSV with date, description, amount and reference. Before pasting anything into an AI tool:

  • Remove account numbers and any bank routing or branch codes.
  • Replace donor and payee personal names with a code, for example D001, held in a separate key sheet.
  • Use a business or team plan that does not train on your content by default, such as Claude Team or ChatGPT Business, both of which advertise nonprofit pricing; check your own eligibility on the vendor pages because the rules differ.

If your policy does not allow financial data in any chat tool, the alternative is a rules-only method: the AI helps you write and test the rules on a handful of invented lines, and you apply them with spreadsheet formulas or the bank rules in your accounting software. You lose some flexibility and keep all the control. See how to write an AI policy for a small charity for wording.

Step 3: a sample ledger, coded

This is a month of ten illustrative lines and what the AI returns when given the rules above.

#Bank lineAmountSuggested fundCategoryFlagReason
1Grant payment ref YOUTH GRANT Q2+3,000.00YTHGrants inReference names the youth grant
2D014 standing order+25.00GENDonations inNo purpose given
3D027 donation "for the roof"+200.00BLDDonations inCHECKPurpose stated; confirm with donor letter
4Hall hire, March-180.00Split 108.00 YTH, 72.00 GENRent and hall hireRule 3
5Sessional worker invoice-240.00YTHSessional workersRule 2; within grant dates
6Sessional worker invoice, 3 April-240.00YTHSessional workersCHECKGrant period starts 1 April; confirm service dates
7Roofing contractor-1,500.00BLDRepairsOVERSPENDBalance would go below zero
8Public liability insurance-95.00GENInsuranceRule 5
9Stationery supplier-34.50GENPrinting and postageCHECKNo rule; may be YTH if for sessions
10Bank charge-6.00GENBank chargesRule 5

Three lines teach the lesson. Line 3 is income with a stated purpose in a free-text reference: the AI proposed BLD, but a person must confirm against the donor's letter before it counts as restricted. Line 6 is a date edge, an invoice just after the grant period opens, where the service date matters more than the invoice date. Line 7 is an overspend that a pure categoriser would code without a pause; your rule 6 makes the AI stop. Lines 1, 5, 8 and 10 are routine, and review time is better spent on lines 3, 6, 7 and 9.

Step 4: the prompt that produces that table

You are helping the treasurer of a small nonprofit suggest fund coding.
Use ONLY the RULES, FUNDS and CATEGORIES below. Do not use outside knowledge
about what a charity "usually" does.

For every bank line return a CSV row:
line_no, suggested_fund, split (if any), category, flag (blank, CHECK or OVERSPEND), reason (max 15 words).

If a rule is missing or two rules conflict, flag CHECK and say which.
Never invent a donor purpose. Never post or approve anything: these are suggestions.

[paste the rules file]

Current fund balances (start of month): GEN 4,120.00; YTH 2,950.00; BLD 1,200.00

Bank lines:
[paste the cleaned CSV]

Passing the opening fund balances is what lets the AI test rule 6. Ask it to also return the closing balance of each fund so you can compare it with the accounting software. If the AI's sums do not agree with yours, trust yours, and read that as a sign that arithmetic should be done in a spreadsheet, not in a chat window.

Step 5: the accountant's review

Import the suggestions into a sheet beside the bank lines and let your accountant or auditor review according to a clear scope. A workable scope is every line with a flag, every line touching a restricted fund, every line over an amount the trustees choose, and a random sample of ten unflagged general-fund lines. The review column has three states: Agree, Changed and Query. Changed lines are the AI's mistakes, so count them. If more than about one in ten reviewed lines is changed after a month or two, the rules file needs work, not the review.

In the accounting software, apply the fund by whatever tagging feature your plan has. QuickBooks Online offers class tracking on some plans and Xero offers tracking categories; check the plan you hold, because availability and limits depend on it. A nonprofit's QuickBooks plan also may or may not include Intuit's AI features, and per the vendor those features cannot currently be switched off individually, so check what is enabled. Whichever tool you use, the sheet remains the audit record.

Step 6: the audit trail

An auditor wants to see how a number was reached. Keep these in one folder per month:

  1. The bank export as received, unedited.
  2. The version sent to the AI, with the redaction key kept elsewhere.
  3. The rules file with a version number and date.
  4. The AI's suggestions exactly as returned.
  5. The reviewer's column: Agree, Changed or Query, the final fund, initials and date.
  6. The donor letters, grant agreements and trustee minutes that the rules cite.

When a rule changes, increase the version and note why. If a trustee asks "why was this amount in the Youth fund", you can answer from the folder in two minutes.

Shared costs and releases from restriction

Two situations need extra care. The first is shared costs: rent, utilities and a part-time manager's pay often serve several funds. The allocation key (60/40 above) must be agreed and documented, ideally by the trustees, and reviewed once a year. The AI can apply a key but should not choose one. A realistic mistake: an assistant applied the 60/40 key to the hall hire in a month when the youth sessions were suspended, so the restricted fund was charged for rooms it did not use. The fix was a rule that the key applies only in months where sessions ran, with a CHECK flag otherwise.

The second is release from restriction. When a restricted purpose has been met, a person moves the amount to unrestricted. The AI can suggest the candidates, for example "the roof appeal's spend now equals the fund; the amount left over is 312.00, check the donor terms", but the decision and the journal belong to the accountant and the trustees.

Four ledger situations the sample did not cover

Real months throw up lines that the neat table avoids. These four are worth adding to your rules file after the first month, each with the rule you might write.

A refund. A supplier refunds 60.00 for a cancelled workshop booking. The cost was originally coded to YTH, so the refund must go back to YTH, not to GEN where the bank line happens to land. Rule: "A refund or credit note is coded to the fund of the original cost; if the original cannot be found, flag CHECK." The AI cannot see the original unless you give it the earlier month's coded lines, so for refunds add a lookup column in the sheet.

An event with mixed income. A summer fair brings in 1,420.00 of ticket and cake-stall income, and one donor hands over 150.00 "for the building". Rule: "Event takings are GEN unless the event was run for a named restricted purpose; individual gifts with a stated purpose are coded to that purpose." The AI should split the 150.00 out as a CHECK line, because a note on an envelope is weaker evidence than a donor letter.

Payroll across funds. A part-time coordinator spends about 40% of her contracted hours on the funded project. The allocation should rest on timesheets or a trustee-approved estimate, never on the AI's reading of her job title. Rule: "Salary lines are split by the percentages on the allocation sheet dated within the last twelve months; flag CHECK if the sheet is older." This also catches the case where the sheet was never updated after a change in her hours.

In-kind and matched funding. If a funder requires a match, such as a promise to add 20% from your own resources, the AI can keep a running tally but must not decide what counts as match. Rule: "Match is tracked on a separate sheet; never code a spend to a fund because it might count as match."

Checks that catch a coding error before the accountant does

Add three cheap arithmetic checks to the monthly routine. None needs AI.

  1. Funds add up to the bank. The closing balances of all funds, added together, equal the bank balance plus any cheques or transfers not yet cleared. If they do not, something was coded to no fund or twice.
  2. No restricted fund below zero. Sort the fund balances; any negative number on a restricted fund is investigated that day.
  3. Restricted income equals restricted letters. Total the income coded to restricted funds and compare it with the list of donor letters and grant agreements received that month. A gap in either direction is a coding or a paperwork problem.

Run them in that order, because a failure in the first usually explains the other two. Put the three results at the top of the review sheet so the accountant sees them before the line detail.

A short worked sum with the sample ledger: opening balances GEN 4,120.00, YTH 2,950.00, BLD 1,200.00 give 8,270.00. Month movements before review are +3,000.00 into YTH, +25.00 into GEN, +200.00 into BLD, hall hire out 108.00 from YTH and 72.00 from GEN, two sessional invoices of 240.00 each from YTH (line 6 still awaiting a date check), insurance 95.00 and bank charge 6.00 and stationery 34.50 from GEN, and the roof invoice 1,500.00 held back as OVERSPEND. If the roof invoice were coded anyway, BLD would show 1,200.00 + 200.00 - 1,500.00 = -100.00, which is exactly what check 2 would reveal. Held back for a person to decide, BLD stands at 1,400.00 and the trustees can choose to cover the shortfall from GEN with a recorded decision, or pay the contractor later.

Making the rules file better each month

The review column is also your training material. After each month, read the Changed lines and ask what rule would have prevented each one. Often it is a single sentence. If the AI keeps coding the stationery supplier to GEN and your reviewer keeps changing it to YTH during term time, add "stationery bought in term time for sessions is YTH unless the bill says otherwise". Keep a short change log at the foot of the rules file with the date, the line changed and why.

Resist stuffing the file with every exception. A rules file that runs past two pages becomes hard to read for the trustees who must approve it and for the AI, which is more likely to miss a rule in a long list. If you find yourself writing a dozen exceptions to one rule, the underlying treatment probably needs a trustee decision rather than another line of prompt.

Questions to ask before buying anything

Software vendors will pitch AI categorisation to nonprofits. Before paying, ask whether the tool can hold a restricted-fund balance and warn on overspend, whether it keeps the original bank text beside its suggestion, whether suggestions can be exported with a reviewer's name and date, and what it does with your data. Ask for a trial on one real month. A tool that cannot show you why it chose a fund is a tool you cannot defend to an auditor. If a vendor cannot answer in writing, the spreadsheet method above is a perfectly respectable alternative. For more on buying questions of this kind, see rolling out AI in a bookkeeping practice without losing control.

Vague donor wording, stale rules and other slips

  • The donor's wording is vague. "For the children" could mean the youth project or the whole organisation. Ask the donor; do not let the AI interpret.
  • The rules go stale. A new grant starts and nobody updates the file, so its income lands in GEN. Add a calendar reminder for the rules review whenever a grant agreement is signed.
  • Over-trust. After three clean months the reviewer starts nodding. Keep the random sample.
  • Privacy slips. A donor's name appears in a bank reference. Redact before pasting, and check what your provider does with the data.

A small charity's month, with timings

Illustrative: a charity with three funds and about 140 bank lines a month. The treasurer spends 20 minutes exporting and redacting, the AI returns suggestions in a couple of minutes, the treasurer spends 25 minutes reading flags and spot-checking, and the accountant spends 30 minutes on the review sample and the flagged lines. Before this process, the treasurer spent about two hours coding by hand and the accountant found the errors at year end. The saving is not mainly time but timing: errors are caught monthly while donors' letters are still in the inbox. These timings depend on your volume and your rules, so time your own first month.

For the wider decision on what to hand to software at all, what still needs an accountant is the sensible companion, and the receipt capture and categorisation setup covers the step before fund coding. If you would like to talk through your own fund list, that is the kind of problem my AI implementation consultation covers, via the contact page.

Fund coding with AI: questions from treasurers

Can AI move money between restricted and unrestricted funds?

It should not. Releases from restriction, transfers and reclassifications need a human decision backed by the donor's terms or a board minute. The AI can flag candidates, such as spending that matches a grant purpose, and draft the journal note for your accountant to approve and post.

Is it safe to paste a bank export into a chat tool?

Only after removing account numbers and personal details, and only in a plan that does not train on your content, such as a business or team plan. Replace donor names with IDs. If your policy forbids uploading financial data at all, use the rules-only method described below.

Do I need fund accounting software?

Not for a small organisation. A tagging feature such as classes or tracking categories in mainstream accounting software, or a spreadsheet with a fund column, can work. Check which plan includes tagging. Larger or grant-heavy organisations may want dedicated fund accounting software.

How often should the accountant review AI coding?

Monthly at first, on a sample plus every exception, then quarterly once the error rate is steady. Review all transactions over an agreed amount and every one that touches a restricted fund, whatever the AI's confidence.

Further reads

Sources: Anthropic and OpenAI nonprofit programme pages, Xero and QuickBooks help centres, Intuit AI pages (October 2026). This is practical guidance, not accounting or legal advice.

Want fund coding set up so your accountant trusts it?

On a 1:1 call we would walk through your fund list and last month's bank export, decide which transactions the AI may suggest and which stay with a person, and set up the review log.

Book a 1:1 call with me