---
title: "Legal AI: Why Redaction Destroys the Context a Model Needs"
slug: "legal-ai-redaction-destroys-context-structure-aware-masking"
author: "Jaione Amigot"
date: "2026-11-24 12:00:00"
category: "Premium"
sector: "legal"
topics: "legal AI, redaction, pseudonymization, structure-aware masking, eDiscovery AI, attorney-client confidentiality, ABA Formal Opinion 512, Rule 1.6, GDPR pseudonymisation, law firm AI privacy, self-hosted legal AI"
summary: "Blanket redaction strips the names, dates and relationships a model needs to reason about a legal matter. Structure-aware masking replaces each person with a consistent placeholder so the reasoning survives, and running the model inside the firm's own perimeter changes how much has to be masked at all."
banner: ""
thumbnail: ""
linkedin: |
  The real barrier to AI in legal work is not privacy. It is that brute-force redaction destroys the context a model needs.

  Black out every name in a discovery set and the model can no longer tell who wrote to whom. Every person collapses into the same [PERSON] token. Remove the dates and the timeline, which is often the whole case, is gone.

  The fix is structure-aware masking: each real person becomes a consistent placeholder (PERSON_1 is always the same person, across every document), dates keep their order and spacing, roles stay attached. The open-source Presidio toolkit documents exactly this pattern, and the EDPB's 2025 pseudonymisation guidelines note that pseudonyms let records about the same person be linked without the key.

  The federal courts already work this way. FRCP 5.2 keeps the year of birth, a minor's initials and the last four digits of an account, not a black bar.

  And the ABA's Formal Opinion 512 does not say "redact everything". It says assess the risk that client information is disclosed outside the firm. Run the model inside the firm and the outside-disclosure risk changes shape; the in-firm duties, like ethical walls and consent for self-learning tools, remain.

  On ibl.ai you own all the code and the data, so the model, the masking layer and the key that reverses it all stay inside your perimeter.

  #iblai #LegalAI #LegalTech #eDiscovery #DataPrivacy #AgenticAI
---

## The Short Answer

**Blanket redaction fails legal AI because it deletes the relationships a model needs: who wrote to whom, who signed, what happened when. Structure-aware masking swaps each real name for a consistent placeholder, so the reasoning survives. On ibl.ai you own all the code and the data, so a firm can run the model inside its own perimeter and decide how much context to keep.**

Most law firm AI policies start from one instinct: strip everything identifying before a document goes near a model. It feels like the safe answer to Rule 1.6.

It is often the wrong one. A redacted discovery set protects the client and also stops the analysis the firm wanted, because in legal work the identities and the dates *are* the facts.

## Why does blanket redaction break AI analysis of legal documents?

Blanket redaction breaks legal AI because it removes identity without preserving sameness. Once every name becomes the same token, a model cannot tell one custodian from another, and the relationships that decide a matter disappear.

The default replace behaviour in Presidio, the open-source de-identification toolkit that began at Microsoft, swaps a detected value for its type, for example `<PHONE_NUMBER>`, per its [anonymizer documentation](https://presidio.dataprivacystack.org/anonymizer/). ibl.ai's own Redact action works the same way, replacing a value with its type label.

That is fine for a support chat. It is destructive for a discovery set. Here is an illustrative email thread, with invented names, processed three ways:

<table style="width:100%; border-collapse:collapse; margin:1.5rem 0; font-size:0.95rem;">
  <thead>
    <tr style="background:#f5f5f0; border-bottom:2px solid #2175C5;">
      <th style="text-align:left; padding:0.75rem; color:#5f6368;">Version</th>
      <th style="text-align:left; padding:0.75rem; color:#5f6368;">What the model reads</th>
      <th style="text-align:left; padding:0.75rem; color:#5f6368;">Can it answer "who knew first?"</th>
    </tr>
  </thead>
  <tbody>
    <tr style="border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>Original</strong></td>
      <td style="padding:0.75rem;">Dana Ruiz emails Tom Klein on 3 March 2025; Klein forwards it to Priya Shah on 9 March</td>
      <td style="padding:0.75rem;">Yes</td>
    </tr>
    <tr style="border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>Blanket redaction</strong></td>
      <td style="padding:0.75rem;">[PERSON] emails [PERSON] on [DATE]; [PERSON] forwards it to [PERSON] on [DATE]</td>
      <td style="padding:0.75rem;">No. Three people became one token, and the six-day gap is gone</td>
    </tr>
    <tr style="background:#f0f9ff; border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>Structure-aware masking</strong></td>
      <td style="padding:0.75rem;">&lt;PERSON_1&gt; emails &lt;PERSON_2&gt; on Day 0; &lt;PERSON_2&gt; forwards it to &lt;PERSON_3&gt; on Day 6</td>
      <td style="padding:0.75rem;">Yes, and the answer maps back to real names inside the firm</td>
    </tr>
  </tbody>
</table>

The table is our illustration, not a benchmark. The point it makes is structural: a model reasoning about knowledge, notice, sequence or authority needs to know which person is which and how far apart events sit.

For a deeper look at how this plays out when the data is used for training rather than review, see [why PII redaction breaks enterprise AI](/blog/pii-redaction-breaks-enterprise-ai-transformation).

## What is structure-aware masking, and how is it different from redaction?

Structure-aware masking hides who a person is while keeping that they are the same person everywhere they appear. It is pseudonymisation applied with the document's structure in mind: people, organisations, dates and roles each get a treatment that preserves what the model needs.

Presidio publishes a [pseudonymization sample](https://presidio.dataprivacystack.org/samples/python/pseudonymization/) that does the core move. A custom operator replaces each value with a unique identifier, keeps a mapping, and can reverse it afterwards. Its sample output reads `<PERSON_1> gave his book to <PERSON_2>`.

Its documentation also describes a salted hash operator and notes that to "maintain referential integrity across records/calls", you provide a consistent salt. That is the property that matters across a 10,000-document production: Klein is the same pseudonym in every file.

<table style="width:100%; border-collapse:collapse; margin:1.5rem 0; font-size:0.95rem;">
  <thead>
    <tr style="background:#f5f5f0; border-bottom:2px solid #2175C5;">
      <th style="text-align:left; padding:0.75rem; color:#5f6368;">Element</th>
      <th style="text-align:left; padding:0.75rem; color:#5f6368;">Blanket redaction</th>
      <th style="text-align:left; padding:0.75rem; color:#5f6368;">Structure-aware masking</th>
    </tr>
  </thead>
  <tbody>
    <tr style="border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>People</strong></td>
      <td style="padding:0.75rem;">One shared token</td>
      <td style="padding:0.75rem;">One consistent pseudonym per person, across every document</td>
    </tr>
    <tr style="border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>Organisations</strong></td>
      <td style="padding:0.75rem;">One shared token</td>
      <td style="padding:0.75rem;">Distinct pseudonyms, so the counterparty stays distinct from the client</td>
    </tr>
    <tr style="border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>Dates</strong></td>
      <td style="padding:0.75rem;">Removed</td>
      <td style="padding:0.75rem;">Kept in order, with intervals preserved, for example by one consistent offset</td>
    </tr>
    <tr style="border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>Roles</strong></td>
      <td style="padding:0.75rem;">Lost with the name</td>
      <td style="padding:0.75rem;">Kept as text: "General Counsel", "the buyer", "the guarantor"</td>
    </tr>
    <tr style="background:#f0f9ff; border-bottom:1px solid #e5e7eb;">
      <td style="padding:0.75rem;"><strong>Reversal</strong></td>
      <td style="padding:0.75rem;">Impossible</td>
      <td style="padding:0.75rem;">Possible, with a mapping the firm alone holds</td>
    </tr>
  </tbody>
</table>

The European Data Protection Board makes the same observation in its [Guidelines 01/2025 on pseudonymisation](https://www.edpb.europa.eu/system/files/2025-01/edpb_guidelines_202501_pseudonymisation_en.pdf), adopted on 16 January 2025 for public consultation.

It says pseudonymised data "can often be usefully analysed" and that pseudonyms enable "the linkage of various records" about the same person without the additional information.

## Do the courts already redact this way?

Yes. The federal courts' own privacy rule for filings is structure-aware rather than blanket. It keeps a deliberate slice of each identifier so a filing still makes sense to the reader.

[Federal Rule of Civil Procedure 5.2(a)](https://www.law.cornell.edu/rules/frcp/rule_5.2) says a filing may include only the last four digits of a Social Security or taxpayer-identification number, the year of an individual's birth, a minor's initials, and the last four digits of a financial-account number.

Those four rules each protect a person while keeping enough to tell records apart. A minor's initials keep two children distinct; a year of birth keeps an age. It is the same design principle structure-aware masking applies to an AI pipeline.

## Does the ABA require lawyers to redact client data before using AI?

No. ABA Formal Opinion 512, issued on 29 July 2024, does not tell lawyers to redact everything. It asks them to assess the risk that information relating to a representation is disclosed outside the firm, and to act on that assessment.

Under [Model Rule 1.6](https://www.americanbar.org/groups/professional_responsibility/publications/model_rules_of_professional_conduct/rule_1_6_confidentiality_of_information/), a lawyer must make reasonable efforts to prevent the inadvertent or unauthorized disclosure of, or access to, client information. [Opinion 512](https://www.americanbar.org/content/dam/aba/administrative/professional_responsibility/ethics-opinions/aba-formal-opinion-512.pdf) applies that duty to generative AI tools.

As summarised in [The Bar Examiner's analysis](https://thebarexaminer.ncbex.org/article/fall-2024/generative-artificial-intelligence-tools/), the opinion says that for self-learning tools "a client's informed consent is required prior to inputting information relating to the representation".

It also notes that tools differ in how they protect information, so the risk assessment is fact based.

Redaction is one way to make that assessment come out safely. It is not the only one, and it is the one that costs the most usable context. Where the model runs, and who can see its inputs, is the other lever.

We covered the rule itself in [ABA Model Rule 1.6 compliant AI](/blog/aba-model-rule-1-6-compliant-ai). This is a summary, not legal advice; each firm's ethics counsel decides.

## Is a pseudonymised legal document still personal data under GDPR?

For the firm holding the key, yes. GDPR treats pseudonymisation as a safeguard, not an exit. A masked document still carries obligations for the controller that can reverse it.

[Article 4(5) of the GDPR](https://eur-lex.europa.eu/eli/reg/2016/679/oj) defines pseudonymisation as processing so that data can no longer be attributed to a person without additional information kept separately. Recital 26 says such data should still be considered information on an identifiable person.

The EDPB guidelines repeat that pseudonymised data "remains information related to an identifiable natural person, and thus is personal data". In September 2025 the EU Court of Justice added a nuance in EDPS v SRB (C-413/23 P).

As [Covington's Inside Privacy summarises](https://www.insideprivacy.com/eu-data-protection/eu-court-of-justice-clarifies-the-concept-of-personal-data-in-the-context-of-a-transfer-of-pseudonymized-data-to-third-parties/), the court held that pseudonymised data must not be regarded as personal data "in all cases and for every person": a recipient that cannot re-identify may be outside it. The controller that holds the key is not.

For a law firm with EU matters, that makes two practical points. Structure-aware masking reduces risk without removing GDPR duties. And the place the mapping key lives, inside the firm or inside a vendor, is part of the analysis.

## When does a law firm not need to mask documents before AI at all?

When the model, its logs and its storage all run inside the firm's own perimeter, the disclosure risk Opinion 512 describes changes shape. Nothing leaves the firm, so masking stops being a precondition for using the model and becomes a choice made per matter and per agent.

Opinion 512 still applies inside the perimeter: a self-learning tool can disclose one client's information to other lawyers at the same firm, and for those tools it requires the client's informed consent wherever the model runs.

That is the real trade. A firm sending documents to an external API has to strip context to stay safe. A firm running an open-weight model on its own infrastructure can keep the names, the dates and the relationships, and still control who sees them.

Masking still has a job inside the perimeter: ethical walls between matters, least-privilege access for agents, and cleaner outputs when a summary goes to a wider audience. For the most sensitive work, see [air-gapped AI for law firms](/blog/air-gapped-ai-for-law-firms-protecting-privilege).

The subpoena question is separate and worth reading too. The [NYT v. OpenAI discovery filings](/blog/nyt-v-openai-unsealed-discovery-law-firm-ai-privilege) showed how chat logs held by a vendor can become discoverable.

## How does ibl.ai handle client data in legal AI agents?

ibl.ai lets a firm decide, per agent, whether personal information reaches the model untouched, redacted, masked or blocked, and it logs each detection without copying the data. Because the firm self-hosts the platform, that decision happens inside its own perimeter.

Every agent carries a Privacy tab with [PII filtering across thirteen entity types](/updates/incognito-pii-filtering-agent-privacy), from Person and Date / Time to IBAN and Passport, and four actions: Allow, Redact, Mask and Block. An optional second pass filters the agent's own responses.

Since [25 September 2026](/updates/platform-update-2026-09-25), detections are recorded in a read-only privacy-flags audit log that stores entity types only, never raw values. The filter also covers uploaded files, including OCR and pixel-level redaction on images.

Be precise about what that means for legal work. The built-in Redact action is the type-label kind, which is right for a chat agent and wrong for a discovery review.

For matter analysis on a model running inside the firm, Allow with detection logging keeps the full context and still records what was seen.

Where a firm wants entity-consistent pseudonyms before a document reaches an external model, that layer is built on top. Because you own all the code and the data, the masking layer and the mapping key that reverses it stay on the firm's infrastructure, not a vendor's.

The platform is model-agnostic, so the same firm can route public research to a hosted frontier model and privileged review to a local one. It deploys anywhere, from your own cloud to a fully air-gapped network, with no per-seat pricing.

See [ibl.ai for legal](/solutions/legal), or the flagship [Agentic OS](/product/agentic-os) the agents run on. ibl.ai is family-owned and operated from New York, NY, and our team works with legal departments and firms as a long-term partner, from the first agent through every model change that follows.

## Why does owning the AI stack matter?

**ibl.ai is the agentic AI platform where you own all the code and the data. You self-host the entire stack inside your own perimeter, run it model-agnostic across any LLM and switch anytime, and pay by usage with no per-seat pricing — so you can deploy anywhere: your cloud, on-premise, GovCloud, or fully air-gapped.**

- **You own all the code and the data.** Full source code under a perpetual license, running on your infrastructure. Not API access to someone else's platform — the stack itself is yours.
- **Model-agnostic.** Run any LLM — Claude, GPT, Gemini, Llama, Command, or your own fine-tune — and switch providers without rewriting the platform.
- **No per-seat pricing.** Usage-based billing against a budget cap you set. Cost tracks what your organization actually uses, not how many people you employ.
- **Deploy anywhere.** Your cloud, your VPC, on-premise, GovCloud, or a fully air-gapped network with no outbound connectivity.

1.6M+ users across 400+ organizations run the platform this way, including NVIDIA, MIT, and Syracuse University.

ibl.ai is family-owned and operated from New York, NY — a U.S.-headquartered, domestically-owned long-term partner, not a vendor that sells licenses and moves on.
