The IRS isn’t sending the same auditors your grandfather dealt with. As of 2024, the IRS had initiated 68 AI projects, and with a 25% workforce reduction in the past year, they’re leaning harder on machine learning to identify returns worth examining.
Is your Beancount ledger ready to prove your numbers if the algorithm flags you?
How the IRS is Using AI Today
Let me break down what’s actually happening behind the scenes:
The Discriminant Function System (DIF)
The IRS has enhanced their Discriminant Function System with AI. This algorithm scores your return against a massive database of other returns, looking for statistical outliers. Returns with higher DIF scores get flagged for potential audit.
What triggers a high DIF score:
- Deductions that are unusual for your income level
- Expenses that deviate significantly from industry norms
- Income patterns that don’t match third-party reporting (W-2s, 1099s)
- Round numbers that suggest estimation rather than actual records
The Large Partnership Compliance (LPC) Model
For complex returns, the IRS developed machine learning models that flagged 82 high-risk partnership returns in Tax Year 2021 alone—compared to nearly zero audits of this segment in prior years. This is just the beginning.
Who’s Being Targeted
According to recent IRS guidance, AI is identifying:
- High Schedule C losses or underreported self-employment income
- Large charitable deductions disproportionate to reported income
- Cryptocurrency transactions without corresponding 1099s or capital gains
- Round-number deductions suggesting estimation
- EITC claims that lack supporting documentation
Why Beancount Users Have an Advantage
Here’s the thing: plain text accounting is inherently audit-friendly. If you’re doing it right, your ledger IS your audit trail. But there’s a difference between “having records” and “being audit-ready.”
The Three-Year Foundation
The IRS can generally audit returns filed within the last three years. But that extends to six years if you underreport income by more than 25%, and forever if fraud is suspected.
My recommendation: Keep your Beancount ledger forever. It’s just text files—storage is free.
; Record retention policy embedded in your ledger
2025-01-01 note Assets:Records "
=== RECORD RETENTION POLICY ===
MINIMUM RETENTION:
Tax returns: 7 years
Supporting documents: 7 years
Property basis records: Life of asset + 7 years
Investment cost basis: Life of holding + 7 years
BEANCOUNT FILES:
Never delete - storage is cheap
Archive annually: ledger-YYYY.beancount
Keep importers and scripts: Reproduce any report
BACKUP STRATEGY:
Local: ~/Documents/Finances/
Cloud: Encrypted backup to [service]
Offline: Annual export to cold storage
"
Building an Audit-Ready Ledger
Here’s my systematic approach to ensuring every transaction can withstand scrutiny:
1. Link Every Transaction to Documentation
; The minimum audit-ready transaction
2025-01-15 * "Office Depot" "Office supplies for home office"
Expenses:Business:Supplies 156.78 USD
Assets:Checking:Chase -156.78 USD
receipt: "receipts/2025/01/office-depot-2025-01-15.pdf"
business_purpose: "Printer paper, toner for client invoicing"
deduction_category: "Schedule C Line 22"
; Compare to an audit-risky transaction
2025-01-15 * "Office Depot" "Supplies"
Expenses:Business:Supplies 156.78 USD
Assets:Checking:Chase -156.78 USD
; No receipt? No purpose? This is a red flag in an audit.
2. Document Business Purpose
For every business expense, answer the question “Why is this deductible?” in your metadata:
2025-02-10 * "Delta Airlines" "Flight to Chicago"
Expenses:Business:Travel:Airfare 485.00 USD
Assets:Checking:Chase -485.00 USD
receipt: "receipts/2025/02/delta-confirmation.pdf"
business_purpose: "Client meeting with ABC Corp - contract negotiation"
client: "ABC Corporation"
meeting_date: "2025-02-11"
personal_component: "None - returned same day"
3. Track Cost Basis Meticulously
Investment cost basis errors are audit magnets. The IRS receives your 1099-B and compares it to your return:
; Every purchase creates a tax lot
2025-03-15 * "Vanguard" "Buy VTI"
Assets:Investments:Vanguard:VTI 50 VTI {225.50 USD}
Assets:Checking:Vanguard -11,275.00 USD
acquisition_date: 2025-03-15
lot_id: "VTI-2025-03-15"
; Every sale references the lot
2025-09-20 * "Vanguard" "Sell VTI"
Assets:Investments:Vanguard:VTI -20 VTI {225.50 USD} @ 240.00 USD
Assets:Checking:Vanguard 4,800.00 USD
Income:CapitalGains:ShortTerm -290.00 USD
form_8949: "Part I - Short term"
proceeds: 4800.00
cost_basis: 4510.00
gain_loss: 290.00
4. Reconcile to Third-Party Documents
The IRS cross-references your return against everything they receive: W-2s, 1099s, K-1s. Your ledger should reconcile perfectly:
2025-01-31 note Income:Salary "
=== W-2 RECONCILIATION - EMPLOYER INC ===
W-2 Box 1 (Wages): $125,000.00
Beancount total: $125,000.00 ✓
W-2 Box 2 (Federal Withholding): $22,500.00
Beancount total: $22,500.00 ✓
W-2 Box 12 Code D (401k): $23,000.00
Beancount total: $23,000.00 ✓
RECONCILED: 2025-02-01
Document: tax-docs/2025/w2-employer-inc.pdf
"
The Audit Response Folder
I maintain a folder structure specifically designed for audit response:
2025-01-01 note Assets:Records "
=== AUDIT RESPONSE FOLDER STRUCTURE ===
audit-ready/
├── returns/
│ ├── 2024-federal-1040.pdf
│ ├── 2024-state-return.pdf
│ └── prior-years/
├── income-verification/
│ ├── w2s/
│ ├── 1099s/
│ ├── k1s/
│ └── bank-statements/
├── deduction-support/
│ ├── charitable/
│ ├── business-expenses/
│ ├── medical/
│ └── property-taxes/
├── basis-documentation/
│ ├── real-estate/
│ ├── investments/
│ └── business-assets/
└── beancount-exports/
├── income-summary.txt
├── expense-by-category.txt
└── investment-transactions.txt
Run bean-query exports annually for quick reference.
"
Questions for Discussion
-
What’s your receipt storage system? Paper, scanned, or app-based?
-
How do you handle cash transactions that don’t have automatic documentation?
-
Anyone been through an audit? What documentation made the difference?
-
Are you tracking business vs personal allocation for things like phones, internet, or vehicles?
The IRS’s AI doesn’t care about your intentions—it only sees patterns in data. Your job is to make sure the patterns in your ledger tell an accurate, verifiable story.