IRS AI-Powered Audits are Here: Is Your Beancount Ledger Audit-Ready?

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

  1. What’s your receipt storage system? Paper, scanned, or app-based?

  2. How do you handle cash transactions that don’t have automatic documentation?

  3. Anyone been through an audit? What documentation made the difference?

  4. 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.

This is exactly the kind of post that keeps me in this community. As someone who’s been through an IRS examination, let me add some hard-won wisdom.

My Correspondence Audit Experience

Two years ago, I received a CP2000 notice—an automated mismatch between my return and the 1099s the IRS had on file. The issue? A brokerage had reported proceeds from a stock sale, but my return showed a different cost basis.

Here’s what saved me: my Beancount ledger had the complete lot history.

; What the IRS saw:
; 1099-B: Proceeds $15,000, Cost Basis $0 (unknown)
; Their proposed adjustment: $15,000 additional income

; What my ledger showed:
2018-05-15 * "Fidelity" "Buy AAPL"
  Assets:Investments:Fidelity:AAPL              50 AAPL {142.00 USD}
  Assets:Checking:Fidelity                  -7,100.00 USD

2023-08-20 * "Fidelity" "Sell AAPL"
  Assets:Investments:Fidelity:AAPL             -50 AAPL {142.00 USD} @ 300.00 USD
  Assets:Checking:Fidelity                   15,000.00 USD
  Income:CapitalGains:LongTerm               -7,900.00 USD
  ; Actual gain: $7,900, not $15,000

I responded with a printout of my Beancount transactions, the original purchase confirmation, and a note explaining the lot identification method I used. Case closed in 60 days, no additional tax owed.

The Documentation That Actually Matters

From that experience, I learned what auditors really want:

Contemporaneous Records

Records created at the time of the transaction carry more weight than reconstructions. This is why I enter expenses in Beancount within 24-48 hours:

; Contemporaneous entry with timestamp metadata
2025-01-20 * "Client Dinner" "Dinner with prospective client"
  Expenses:Business:Meals                       145.00 USD
  Liabilities:CreditCard:Amex                  -145.00 USD
  entered: 2025-01-20T22:15:00
  receipt: "receipts/2025/01/restaurant-2025-01-20.pdf"
  attendees: "John Smith (ABC Corp), Jane Doe (potential client)"
  business_discussed: "Proposal for Q2 project"

Third-Party Verification

Your word alone isn’t enough. The IRS loves third-party confirmation:

2025-01-15 note Expenses:Charitable "
=== CHARITABLE DONATION VERIFICATION ===

Donation to Local Food Bank: $500
Date: 2025-01-15

THIRD-PARTY DOCUMENTATION:
  [x] Acknowledgment letter from charity (required for $250+)
  [x] 501(c)(3) confirmation
  [x] No goods/services received (or FMV if received)

Document stored: charitable/food-bank-acknowledgment-2025.pdf
"

The $75 Rule

IRS doesn’t require receipts for expenses under $75 (except lodging). But I track everything anyway because:

  • Small expenses add up to deduction patterns
  • AI looks at aggregate behavior, not individual transactions
  • Having receipts when not required shows credibility

What I Changed After the Audit

1. Annual Third-Party Reconciliation

Every January, I reconcile my Beancount totals to all third-party documents before filing:

2025-02-01 note Income "
=== ANNUAL INCOME RECONCILIATION ===

Source: W-2 Employer (EIN: XX-XXXXXXX)
  W-2 Box 1: $125,000.00
  Beancount: $125,000.00 ✓

Source: 1099-INT Chase Bank
  1099-INT Box 1: $856.42
  Beancount: $856.42 ✓

Source: 1099-DIV Vanguard
  Ordinary dividends: $3,245.00
  Beancount: $3,245.00 ✓
  Qualified dividends: $2,890.00
  Beancount: $2,890.00 ✓

Source: 1099-B Fidelity
  Proceeds: $45,000.00
  Beancount: $45,000.00 ✓
  Cost basis: $38,500.00
  Beancount: $38,500.00 ✓

ALL RECONCILED - READY TO FILE
"

2. Audit Trail Metadata

I added standard metadata to every transaction that might be questioned:

2025-01-15 * "Amazon" "Business purchase"
  Expenses:Business:Equipment                   299.00 USD
  Liabilities:CreditCard:Chase                 -299.00 USD
  receipt: "receipts/2025/01/amazon-order-123.pdf"
  business_purpose: "External monitor for client work"
  personal_use_percent: 0
  depreciation_method: "Section 179 - full deduction"

The peace of mind is worth the extra 30 seconds per transaction.

As a tax professional who has represented clients in audits, I want to add some specifics about what the IRS actually examines and how your Beancount setup can help—or hurt—your case.

The Audit Selection Reality

Let me be direct: the IRS audit rate for individuals is under 0.5%. But that number is misleading because:

  • High-income returns ($500k+) are audited at 1.5%+
  • Complex Schedule C filers face higher scrutiny
  • Returns with specific “red flags” get selected regardless of income

The new AI systems are designed to increase audit efficiency, not necessarily audit volume. They’re trying to find the returns most likely to yield additional tax.

Red Flags That Trigger AI Review

Based on IRS guidance and my experience, here’s what the algorithms look for:

2025-01-15 note Expenses "
=== IRS AI RED FLAGS TO AVOID ===

HIGH RISK PATTERNS:
  1. Schedule C losses for 3+ consecutive years
     - Triggers hobby loss rules
     - Document profit motive

  2. Deductions > industry norms
     - Travel expenses 40% of gross receipts?
     - Meals at 25% of income?
     - AI compares you to similar filers

  3. Round numbers
     - $5,000 exactly for office supplies
     - $10,000 charitable donation
     - Real expenses have cents

  4. Missing 1099 income
     - IRS has copies before you file
     - Omission = automatic flag

  5. Home office deduction on high income
     - Not inherently wrong
     - But heavily scrutinized

  6. Cash businesses with low gross profit margin
     - Restaurants, retail, services
     - Unreported income patterns
"

Substantiation Requirements by Category

Different deductions have different proof requirements. Here’s my reference guide:

Travel and Entertainment

2025-03-10 note Expenses:Business:Travel "
=== TRAVEL SUBSTANTIATION (IRC §274) ===

REQUIRED ELEMENTS:
  1. Amount of expense
  2. Date and place
  3. Business purpose
  4. Business relationship (if entertainment)

EXAMPLE - Fully Documented:
  Date: 2025-03-10
  Location: Chicago, IL (client site)
  Amount: $1,245.00 (hotel + meals + taxi)
  Purpose: On-site project implementation
  Client: ABC Corporation
  Receipts: travel/2025-03-chicago/

CONTEMPORANEOUS REQUIREMENT:
  Records must be created at or near time of expense
  Reconstruction from memory is not sufficient
"

Charitable Contributions

2025-01-20 note Expenses:Charitable "
=== CHARITABLE SUBSTANTIATION REQUIREMENTS ===

CASH DONATIONS:
  Under $250: Bank record or receipt
  $250+: Written acknowledgment from charity
  $500+: Form 8283 required

NON-CASH DONATIONS:
  Under $250: Receipt with description
  $250-$500: Acknowledgment letter
  $500-$5,000: Form 8283 Section A
  Over $5,000: Qualified appraisal required

VEHICLE DONATIONS:
  Over $500: Form 1098-C from charity
  Deduction = LOWER of FMV or sale price

DOCUMENTATION IN BEANCOUNT:
  2025-01-15 * 'Goodwill' 'Non-cash donation'
    Expenses:Charitable:NonCash             450.00 USD
    Assets:Personal:Household             -450.00 USD
    form_8283: 'Required - Section A'
    items_donated: 'Clothing, household items - see list'
    fmv_method: 'Thrift store comparable pricing'
    acquisition_cost: '1,200.00'
    condition: 'Good'
"

Home Office

2025-01-01 note Expenses:Business:HomeOffice "
=== HOME OFFICE DEDUCTION SUPPORT ===

EXCLUSIVE USE TEST:
  Office space: 150 sq ft
  Total home: 1,500 sq ft
  Business percentage: 10%

REGULAR USE TEST:
  Used daily for: Client calls, invoicing, project work
  Alternative workspace: None

CALCULATION METHOD: Actual Expenses
  Mortgage interest: $12,000 × 10% = $1,200
  Property taxes: $4,000 × 10% = $400
  Utilities: $2,400 × 10% = $240
  Insurance: $1,200 × 10% = $120
  Repairs (office specific): $500 × 100% = $500
  TOTAL: $2,460

DOCUMENTATION:
  Floor plan with office highlighted: office-floorplan.pdf
  Utility bills: utilities/2025/
  Mortgage statement: mortgage/2025-annual.pdf
  Photos of dedicated workspace: office-photos/
"

My Beancount Audit Prep Query

I run this query annually before filing:

; Find transactions missing documentation
SELECT
  date, account, payee, narration,
  COALESCE(meta('receipt'), 'MISSING') as receipt,
  COALESCE(meta('business_purpose'), 'MISSING') as purpose
WHERE
  account ~ 'Expenses:Business'
  AND meta('receipt') IS NULL
ORDER BY date

Any transaction that shows up needs documentation added before I file.

The Professional Recommendation

For anyone with business income, substantial investments, or itemized deductions: treat your Beancount ledger like it will be examined. Because statistically, at some point in your life, it might be.

Great thread. I want to address Fred’s question about receipt storage, because this is where a lot of people’s audit preparation falls apart.

My Receipt Capture Workflow

I’ve tried paper files, scanner apps, and email forwards. Here’s what actually works for me:

The 24-Hour Rule

Every receipt gets photographed within 24 hours. Period. If I lose a receipt, I note it in my Beancount entry:

; Receipt captured
2025-01-20 * "Staples" "Office supplies"
  Expenses:Business:Supplies                     45.67 USD
  Assets:Checking:Chase                         -45.67 USD
  receipt: "receipts/2025/01/staples-2025-01-20.jpg"
  captured_date: 2025-01-20

; Receipt lost - document anyway
2025-01-22 * "Parking" "Client meeting parking"
  Expenses:Business:Travel:Parking               15.00 USD
  Assets:Cash                                   -15.00 USD
  receipt: "LOST"
  receipt_note: "Parking garage receipt faded/lost before capture"
  credit_card_statement: "Chase statement shows $15 at Downtown Parking"
  business_purpose: "Client meeting at ABC Corp"

Folder Structure That Makes Sense

receipts/
├── 2025/
│   ├── 01/
│   │   ├── staples-2025-01-20.jpg
│   │   ├── delta-confirmation-2025-01-15.pdf
│   │   └── amazon-order-123-2025-01-18.pdf
│   ├── 02/
│   └── ...
├── 2024/
│   └── [archived]
└── index.txt  # Quick reference to receipt paths

I name files with vendor and date so I can find them without opening.

Credit Card Statements as Backup

For expenses under $75, the IRS accepts credit card statements as proof. I download monthly statements and reference them:

2025-01-25 * "Various" "Multiple small business expenses"
  Expenses:Business:Supplies                     32.45 USD
  Expenses:Business:Subscriptions               14.99 USD
  Liabilities:CreditCard:Chase                  -47.44 USD
  cc_statement: "statements/chase-2025-01.pdf"
  note: "See statement page 2, lines 14-15"

Cash Transaction Documentation

Fred asked about cash. This is the hardest category:

; Cash expense with contemporaneous documentation
2025-01-28 * "Farmers Market" "Fresh flowers for office"
  Expenses:Business:Office                       25.00 USD
  Assets:Cash                                   -25.00 USD
  receipt: "CASH - no receipt available"
  documentation: "Photo of flowers in office: photos/office-flowers-2025-01-28.jpg"
  business_purpose: "Office decoration for client visits"
  vendor: "Downtown Farmers Market, Vendor #23"

; ATM withdrawal supporting cash expenses
2025-01-25 * "Chase ATM" "Cash withdrawal"
  Assets:Cash                                   200.00 USD
  Assets:Checking:Chase                        -200.00 USD
  purpose: "Cash for parking, tips, farmers market"

; Track what the cash was used for
2025-02-01 note Assets:Cash "
=== CASH USAGE RECONCILIATION - JANUARY 2025 ===

Withdrawn: $200.00 (1/25)
Used for:
  Parking meters: $35.00 (various dates)
  Farmers market supplies: $25.00 (1/28)
  Tips at client lunches: $40.00
  Personal: $100.00
Balance carried: $0.00

Business cash: $100.00
Personal cash: $100.00
"

The Audit-Ready File Test

Before tax season, I run what I call the “audit-ready test” on random transactions:

  1. Pick 10 random business expenses from my ledger
  2. For each one, can I produce:
    • The receipt or equivalent documentation?
    • Proof it was paid (bank/CC statement)?
    • Business purpose documentation?
  3. If any fail, I fix the documentation gap

This takes about 30 minutes annually but gives me confidence that I could respond to an audit within days, not weeks.

One More Thing: The Statute of Limitations

Keep everything for seven years minimum. Here’s why:

2025-01-01 note Assets:Records "
=== STATUTE OF LIMITATIONS REFERENCE ===

3 YEARS: Standard audit period from filing date
6 YEARS: If >25% of income underreported
FOREVER: Fraud or unfiled returns

SAFE RETENTION: 7 years for tax documents
                Forever for property basis records
                Forever for Beancount ledger files

CURRENT RETENTION STATUS:
  2018 returns: Can destroy after April 2025
  2019 returns: Can destroy after April 2026
  2020 returns: Can destroy after April 2027
  ...and so on

RECOMMENDATION: Storage is cheap. Keep everything.
"

This thread should be required reading for anyone using Beancount for business expenses.

I appreciate all the detailed advice here. As someone who does accounting for small business clients, I want to add the perspective of what happens when documentation ISN’T there.

The “Reconstruction” Problem

When clients come to me after losing records, we have to reconstruct from secondary sources. The IRS accepts this, but it’s risky:

2025-02-01 note Expenses:Business "
=== RECONSTRUCTED RECORDS WARNING ===

ACCEPTABLE SECONDARY SOURCES:
  - Bank and credit card statements
  - Canceled checks (images)
  - Calendar entries showing meetings
  - Email confirmations
  - Third-party records (vendor invoices)

NOT ACCEPTABLE:
  - Memory alone
  - 'Typical' or 'usual' amounts
  - Round number estimates
  - Undocumented spreadsheets

IRS POSITION:
  Contemporaneous records carry more weight
  Reconstructions must be from reliable sources
  Burden of proof is on taxpayer
"

Real Examples From My Practice

The Client Who Lost Everything

A client’s laptop was stolen with all their financial records. No cloud backup. Here’s how we documented the reconstruction:

2024-01-15 note Expenses:Business "
=== RECORD RECONSTRUCTION LOG ===

SITUATION: All records lost in theft (police report #2024-12345)
RECONSTRUCTION DATE: 2024-02-15

SOURCES USED:
  1. Bank statements (requested from Chase)
  2. Credit card statements (requested from Amex, Visa)
  3. Email receipts (searched Gmail for 'receipt', 'confirmation')
  4. Vendor invoices (contacted major vendors)
  5. PayPal/Venmo history (downloaded from accounts)

METHODOLOGY:
  - Matched every bank debit to supporting document
  - Categorized based on vendor name patterns
  - Unknown transactions: Contacted vendor for duplicate receipt
  - Unverifiable: Excluded from deductions

TOTAL DEDUCTIONS CLAIMED: $45,000
TOTAL EXCLUDED (unverifiable): $3,200

STATEMENT: This reconstruction was prepared using the best available
records after original documentation was lost. All amounts are
supported by third-party sources listed above.
"

The Mileage Log Problem

Mileage is the most commonly reconstructed deduction—and the most frequently disallowed:

2025-01-01 note Expenses:Business:Auto "
=== MILEAGE DOCUMENTATION STANDARDS ===

IRS REQUIREMENT (IRC §274):
  Must record: Date, destination, business purpose, miles
  Must be contemporaneous (at or near time of travel)

INADEQUATE:
  'I drove about 10,000 business miles'
  'I usually drive to clients 3x per week'

ADEQUATE:
  Daily log with: Date, from/to, purpose, odometer/miles
  App-based tracking (MileIQ, TripLog, etc.)
  Calendar corroboration for client meetings

MY TRACKING METHOD:
  2025-01-15 * 'Business Mileage' 'Client visit - ABC Corp'
    Expenses:Business:Auto:Mileage       0.67 USD ; 1 mile @ $0.67/mile (2024 rate)
    Income:Reimbursements               -0.67 USD
    trip_date: 2025-01-15
    from: 'Home office (123 Main St)'
    to: 'ABC Corp (456 Oak Ave)'
    round_trip_miles: 45
    business_purpose: 'Project status meeting'
    calendar_entry: 'calendar/2025-01-15-abc-meeting.ics'

ANNUAL SUMMARY:
  Total miles driven: 15,000
  Business miles: 8,500 (56.7%)
  Deduction at $0.67/mile: $5,695
"

The Hobby Loss Danger Zone

AI specifically flags repeated Schedule C losses. If you’re showing losses for 3+ years, document profit intent:

2025-01-01 note Income:Business "
=== PROFIT MOTIVE DOCUMENTATION ===

BUSINESS: Freelance consulting

YEARS IN BUSINESS: 5 (2020-present)
PROFIT/LOSS HISTORY:
  2020: ($5,000) loss - startup year
  2021: ($2,000) loss - building client base
  2022: $8,000 profit
  2023: $15,000 profit
  2024: $22,000 profit

PROFIT MOTIVE EVIDENCE:
  1. Formal business plan (docs/business-plan-2020.pdf)
  2. Professional website and marketing
  3. Separate business bank account
  4. Regular client invoicing
  5. Expertise development (conferences, training)
  6. Adjusted methods when unprofitable

HOBBY FACTORS (showing this is NOT a hobby):
  [x] Conduct activity in business-like manner
  [x] Time and effort indicates profit intent
  [x] Depend on income for livelihood
  [x] Losses are due to normal startup/circumstances
  [x] Changed methods to improve profitability
  [x] Have knowledge needed to carry on activity
  [ ] Prior success in similar activities

This is clearly a business, not a hobby, based on the above factors.
"

My Advice

The best time to prepare for an audit is before you need to. Build your documentation systems now:

  1. Link receipts at time of entry - Not “later”
  2. Note business purpose - “Supplies” isn’t enough
  3. Reconcile to third parties - Before filing
  4. Keep everything - Storage is cheap; audits are expensive

Your future self (or your CPA, or your audit examiner) will thank you.