Risks of RAG: anonymisation and the external LLM data dilemma
Banks want the productivity of generative AI, but sending customer data to an external model leaves a contract as its only protection.
A financial technology chief information officer argues the answer lies in engineering: anonymising sensitive information before it leaves the institution, and restoring it only once it is safely back inside.
Alessandro De Leonardis is CIO of Armundia Group, with long experience of aligning strategic vision with new technologies, research and development. In this contributed piece he sets out how banks can use external large language models without exposing sensitive data. The views are his own.
Banks face a dilemma. Generative AI continues to promise significant gains in performance, but using external large language models (LLMs) puts sensitive customer data at risk. There are ways to achieve the productivity and maintain security at the same time.
Expectations of AI
Most financial services professionals discovered and experimented with generative AI long before their employers made such tools available, and today they arrive at work already expecting it. Rightly so, as commercial generative models get better every quarter, whether on documents, processes or analysis.
But the wider context remains fraught. Generative AI is a real problem in regulated environments, hence the EU AI Act and the UK's proposed AI regulation, both of which sit alongside GDPR and the Digital Operational Resilience Act (DORA), designed to strengthen the digital resilience of financial entities. The question is shifting from what the provider promised to do with the data to what the provider actually received. Contracts answer the first question; only architecture answers the second.
The buck stops with data: everything from personally identifiable information and financial data to confidential documents and proprietary knowledge. Users want AI inside their applications, just as they are used to in their personal lives, but they cannot put that data on somebody else's servers. So what is the market's answer?
Today's market approach
Every financial organisation handles sensitive data every day, in client portfolios and meetings, suitability profiles, prospectuses, position reconciliation, investment documents and advisory notes. The challenge is to keep the value of generative AI while controlling the information that leaves the trusted environment.
Retrieval-augmented generation (RAG) with external LLMs is now mainstream. For financial institutions it is the standard way to improve an LLM's performance by connecting it to external knowledge sources, and it helps overcome problems such as hallucinations and a lack of contextual grounding.
It is also normal for an institution to send regulated data to a commercial model under contractual protection, through a private tenant, under data protection law, with no training on the data and no retention permitted. The trouble is that the data still leaves the institution, with a legal instrument as its only protection.
What is less common is a technical gateway that stops the provider from ever receiving the unfiltered data. Plenty of technology exists to make that possible, but combining it reliably is difficult.
Anonymisation
The exam question for banks is how to use external LLMs without exposing sensitive information unnecessarily. One answer is anonymisation: a model that sits between the in-house application and the external model.
It finds sensitive entities and replaces them with neutral tokens, such as a placeholder standing in for a client's name, so the external model reasons on the structure of the information rather than the real values. Once the response is back inside the institution's zone of trust, the real values are restored according to what each user is permitted to see. This is what we call hybrid symbolic-generative RAG.
The case of alternative investment funds
Take closed-ended funds, where almost all of the relevant information is private: offering memoranda, deal documents, valuations of target companies and capital account statements.
Ironically, the offering memorandum is a closed-ended fund's most confidential document, yet it contains very little personal data. Its value lies in the targets, the valuations and the counterparties. A standard filter for personally identifiable information applied to that page finds nothing to protect and lets the most sensitive information straight through. The institution's system has to know that the name of the target company is the secret. There is no ready-made model to download for that; the configuration comes from domain expertise.
Engineering the harness
What makes this complex is not the individual pieces of technology but the engineering of everything around the model, the harness. Controlling the information that leaves the trusted environment takes a careful combination of a deterministic engine for structured identifiers, which must give certainty rather than probability; a statistical named-entity recognition engine for free-text prose; a domain engine for business entities that no off-the-shelf model recognises; symbolic guards that decide what may leave; and an in-house medium-sized language model acting as the sole gateway to the outside.
The value does not lie in any single detector, but in several engines with complementary strengths and weaknesses. What the rule cannot see, the model catches; what the model invents, the rule refuses. Success lies in the integration: resolving conflicts when two engines claim the same piece of text, and keeping tokens stable enough to cross-reference across a whole session. Together, that is what makes the environment safe by design. It is not a filter added at the end, but an architecture with no side door, where any errors are contained.
For banks that want to protect data while using external LLMs, the focus should fall less on the model itself and more on the engineering of the harness around it. That is where safety lives.