Key Takeaways
- Masking is a family of techniques, not one feature. Banks usually need at least three of them, chosen field by field.
- Static masking protects copies of data, dynamic masking protects live access, and tokenization protects payment and account numbers that must be reversible.
- Format-preserving encryption keeps data valid for legacy systems, but NIST's draft revision now specifies only FF1 and sets a minimum domain size.
- For LLMs, masking must cover the prompt, the retrieved context, the output and the logs, with consistent substitutes so the model can still reason.
- Masked data is often still personal data under GDPR, so masking reduces risk without removing compliance duties.
- Evaluate software on your own documents, with per-entity accuracy scores, and keep the re-identification mapping inside your own environment.
Most masking projects in banks start for one reason, such as a test environment or a new AI pilot, and end up touching dozens of systems. Choosing the wrong technique early means rework later, usually when an auditor asks how a masked value can be reversed and by whom.
This guide explains the main masking techniques in plain terms, shows how they apply to AI workflows, and ends with a checklist you can use to compare software. For a general introduction, see our earlier guide to AI data masking.
What Data Masking Software Has to Do in a Bank
Financial data is unusually varied, which is why redaction is no longer optional for it. A single loan file can hold a scanned ID, bank statements, a credit report, emails with a broker and a call transcript. The identifiers inside include financial identifiers such as account and routing numbers, card numbers, IBANs and SWIFT codes, along with ordinary personal data such as names, addresses and dates of birth.
Good software has to do three jobs well. It must detect sensitive values across structured tables and messy unstructured data. It must apply the right transformation for each value and purpose. And it must keep a record of what it changed, so the bank can prove to an examiner that real values never left the places they were allowed to be.
Detection is where most tools differ. Pattern matching catches card numbers reliably because they follow a fixed structure with a check digit. Names, addresses and free-text references to a customer need language models for entity detection, and those models make mistakes. A masking tool is only as good as what it finds.
The Core Techniques, and When Each One Fits
Static masking for test and analytics copies
Static data masking transforms a copy of the data once, permanently. It is the right choice for development, testing, vendor demos and analytics sandboxes, where nobody needs the real values. A good static masking job preserves relationships, so that a masked customer ID still links to the same masked accounts across tables, and keeps formats valid so applications do not break.
The risk with static masking is incomplete coverage. Free-text fields such as comments and case notes often escape column-level rules and carry real names straight into a test system.
Dynamic masking at the point of access
Dynamic masking leaves stored data unchanged and alters what each user sees at query time. A call center agent might see the last four digits of a card number, while a fraud investigator with a documented need sees more. This ties masking to access control and role design. It protects live systems without creating copies, but it depends on every access path going through the masking layer. A direct database connection or an export can bypass it.
Tokenization for payment and account data
Tokenization swaps a sensitive value for a random token and stores the mapping in a protected data vault. Systems that only need to reference a card or account can work with the token, and only the tokenization service can return the original. That is why it dominates payment card environments: systems that never see real card numbers can fall outside much of the PCI DSS scope.
Tokenization is reversible by design, which is both its value and its risk. Whoever controls the vault controls the data. Our comparison of pseudonymization and tokenization covers how the two overlap.
Format-preserving encryption
Format-preserving encryption, or FPE, encrypts a value so the output keeps the same format, such as a 16-digit number that still looks like a card number. It suits legacy core banking systems that reject anything that does not fit a field definition, and it avoids running a token vault because a key reverses it instead.
NIST's original SP 800-38G specified two methods, FF1 and FF3. After researchers found weaknesses in FF3, NIST's second public draft of SP 800-38G Revision 1, released in February 2025, drops FF3 entirely and keeps only FF1, with a minimum domain of one million possible values. Short fields such as a four-digit PIN or a two-digit code are too small for safe FPE under that rule. Ask any vendor which FPE method it uses and how it handles short fields. The differences between anonymization and encryption also matter here, because encrypted data is reversible by anyone with the key.
Masking Prompts and Outputs for LLMs
Generative AI adds a new place where masking has to happen, and the old techniques do not transfer cleanly. A database column has a known type. A prompt is free text, and a single paragraph can mention a customer, a counterparty, an account and a dollar amount.
Consistent substitutes, not blanks
Replacing every name with a black bar breaks the model's reasoning. If a loan memo mentions two borrowers and a guarantor, the model needs to know which is which. Better software replaces each real value with a consistent placeholder or realistic substitute, so the same person is always the same token within a session. That approach underpins prompt anonymization, and it lets the model produce useful output without ever seeing who is involved.
Masking the response side
Outputs need checking too. Models can repeat identifiers from their context, or reconstruct them from surrounding detail. OWASP lists sensitive information disclosure among the top risks for LLM applications in its 2025 list. The software should scan model output before it reaches the user, then re-identify placeholders only for users who are allowed to see real values. Re-identification should happen inside the bank, not at the model provider.
Retrieval, logs and vector stores
Retrieval augmented generation pulls whole documents into the prompt, which multiplies exposure. If customer files are embedded into a vector database unmasked, every query can surface them. Mask before embedding where possible, and see our guide to RAG security for the wider controls.
Logs are the copy everyone forgets, a point our guide to PII governance in AI pipelines covers step by step. Prompt logs, tracing tools and evaluation datasets often store the full text of every request. If the masking layer sits upstream of those systems, the logs stay clean. If it sits downstream, they quietly become a second copy of your customer data. An AI privacy firewall placed in front of every model call is the simplest way to guarantee the order.




