Masking Tool – Confidentiality Shield for CAs Using LLMs
AI & Accounting

Masking Tool – Confidentiality Shield for CAs Using LLMs

Author : CA Jain Neelukumari Trilokchand

Watch on Youtube

AI MASKING PRO

Tool Summary

A privacy-first assistant that lets accountants use AI on client data without exposing it

Prepared by: CA Neelukumari Jain

1. What it is

AI Masking Pro is a single, self-contained HTML file that runs entirely in the browser — no installation, no account and no server of its own. It protects sensitive identifiers in accounting data before that data is analysed by any AI, and it can restore the real values afterwards, on the same device.

The problem it addresses: accountants want the speed of AI for ledger review and financial analysis, but client data contains GSTIN, PAN, Aadhaar, bank details, emails, phone numbers and names that must not be pasted into a third-party tool as-is.

2. The three workflows

The user chooses one of three workflows at the start. All three share the same masking engine.

WorkflowWhat it doesWhen to use it

Mask onlyProtects the data and lets the user download it. The protected text is then used with any AI tool the user already has. An “Unmask an AI response” box brings the AI’s reply back and restores real values locally.You want to keep using ChatGPT, Claude or Gemini, but safely.
Mask + local AIProtects the data, then sends it to a model running on the same computer through Ollama. The reply can be reviewed and the real values restored afterwards.Highly confidential work where nothing should be sent to any online service.
Financial dashboardAccepts one or more financial statements, computes ratios and red flags, draws charts, and produces a styled Excel report. An optional step asks the local AI to explain the results.Reviewing Balance Sheet, P&L and Cash Flow statements.

3. How masking works

  1. Pattern detection. Scans free text and any column left unmasked for: GSTIN, PAN, Aadhaar, IFSC, mobile numbers, email addresses, Singapore UEN, NRIC / FIN, and company names in text. Each pattern can be switched on or off.
  2. Custom terms. The user can add extra terms to protect (for example a client or project name). A “Suggest entities” button proposes candidates found in the data.
  3. Consistent tokens. Each value is replaced by a label such as [CUSTOMER_001]. The same value always receives the same label, so analysis stays meaningful.
  4. Private reference key. The label-to-value mapping is shown in a key table, stays only in the current browser session, and is never sent to Ollama. It can be exported as CSV by the user.
  5. Quarantine of instruction-like text. Lines that look like instructions aimed at an AI (for example “ignore previous instructions”) are removed and replaced with a placeholder, so they never reach the model.
  6. Residual leak check. After masking, the tool checks again for identifier patterns that may remain and reports the result on the privacy dashboard.
  7. Column mapping. For tabular data, the user can choose how each column is treated before protection is applied.

4. Local AI assistant

In the Mask + local AI workflow, the protected data and the user’s question are sent to Ollama on the same computer. The model is told to treat the data as content, never as instructions, to use masked labels exactly as given, and to answer only from the data supplied.

Controls

ControlOptions

Modelllama3.2:3b, llama3.2:1b, qwen2.5:1.5b, gemma2:2b
Answer lengthTurbo — short answer, about 200 tokens (fastest).Balanced — 400 tokens. Detailed — 800 tokens.
What is sentA calculated summary of the protected data (fast, default), or every protected row, capped for speed.
Question templatesOverdue receivables, GST review, Unusual entries, Draft client email.
Live feedbackA thinking indicator, a Stop button, and a meter showing time to first token, total time and speed.
Transparency“View what was sent” shows exactly what the model received.
Warm-upThe model can be pre-loaded into memory so the first real question answers faster.


Setup note: Ollama must be running on the same computer, and the file should be opened from a local web address (not by double-clicking it) with Ollama set to accept requests from the browser. Masking, unmasking, ratios, red flags and charts work without Ollama.

5. Financial dashboard

Inputs

One or more files can be uploaded together (Balance Sheet, Profit & Loss, Cash Flow, or a single file containing several statements). The statement type of each section is detected automatically from its heading. Identifying text is masked before anything reaches the local AI.

Calculated locally, without AI

  1. Current ratio, debt-to-equity, net margin and gross margin, shown per period.
  2. Red flags: negative equity, current ratio below 1, net loss, debt-to-equity above 2, expenses growing faster than revenue, and a notice when no standard statement labels could be matched.
  3. Charts: revenue, cost and net profit by period; ratio trend across periods; largest line items in the most recent period.

All arithmetic is done by plain calculation in the browser. The AI is only ever asked to explain figures that have already been calculated — it does not compute them.

Styled Excel report

Choosing Excel as the download format builds a multi-tab workbook:

  1. Summary tab — colour-coded key ratios, key figures and red flags. Ratios and figures are live Excel formulas that point to the cells on the statement tabs, so they recalculate if a number is edited. AI insights, if requested, appear with an “AI-generated — verify” label.
  2. Charts tab — images of the charts shown on screen.
  3. One tab per statement found — with bold headers, banded rows and number formatting. Only the statements actually present are included.

The colour of each ratio cell reflects the figures at the time of export; if a number is edited later in Excel, the formula recalculates but the colour does not change.

6. Supported file formats


Formats

UploadCSV, TSV, TXT, Excel (.xlsx, .xls, .xlsm), Word (.docx), PDF (text-based). Text can also be pasted directly.
Download (protected data and restored output)CSV, Excel (.xlsx), Word (.docx), plain text — with an option to match the format uploaded.
Download (dashboard report)Styled Excel workbook, or CSV, Word and plain text.
Other exportsReference key (CSV) and audit log (CSV).

PDF reading extracts text only; a scanned PDF with no selectable text will not read cleanly.

7. Controls, transparency and audit

  1. Privacy dashboard. Shows records processed, values replaced, unique labels, whether any external transfer occurred, and the residual leak check.
  2. Review-before-release checkboxes. Downloads and copies of protected data, restored output and the dashboard report stay disabled until the user ticks a short “I’ve reviewed this” confirmation.
  3. “AI-generated — verify” labels. Any text produced by an AI is clearly marked, so it is never mistaken for a calculated figure.
  4. Controlled restore. Real values are restored only when the user chooses, after reviewing the AI’s reply.
  5. Activity log and audit export. Each key event — workflow selected, data protected, AI reply received, values restored, report exported — is logged with a timestamp. Where data is involved, a local fingerprint of that data (never the original values) is recorded. The log is kept in the browser and can be exported as CSV.

The fingerprint is a simple deterministic check that shows whether data has changed. It is not a cryptographic hash and is intended as an audit aid, not a security control.

8. How it is built

  1. Single HTML file. All logic, styling and screens are in one file that works in a standard browser.
  2. Bundled inside the file: Chart.js (charts) and SheetJS (reading and writing Excel and CSV).
  3. Loaded on first use: ExcelJS (styled Excel report), the PDF reader, Mammoth (reading Word files) and JSZip (writing Word files). Each is loaded from a copy placed beside the file if present, otherwise from a public library host.
  4. Local AI: Ollama, running on the same computer, with open models.
  5. Storage: Session data stays in browser memory; the audit log is kept in the browser’s local storage.

9. Scope and limits

  1. Masking is pattern-based. It recognises the listed formats and any custom terms, but cannot guarantee that every sensitive value is caught — which is why a human review step is built in before data is released.
  2. The tool does not reconcile one ledger against another, and it does not look up tax law or provide legal citations; it answers only from the data supplied.
  3. Local AI answers depend on the size of the model chosen; smaller models are faster but less thorough.
  4. The key table is held in memory only. If the browser tab is closed before values are restored, that session’s key is lost unless it was exported.
  5. The sign-in screen is a demonstration screen; session details are kept only in the browser.