---
title: "Introducing Philter Diffuse: Differential Privacy for PII Analytics"
description: "Philter Diffuse applies differential privacy to PII counts with a formal bound on what each release reveals. Epsilon explained, with a demo."
url: "https://philterd.ai/blog/introducing-philter-diffuse-differential-privacy-for-pii-analytics/"
---

[← All posts](https://philterd.ai/blog/)

# Introducing Philter Diffuse: Differential Privacy for PII Analytics

By [Jeff Zemerick](https://philterd.ai/authors/jeff-zemerick/) November 26, 2026 [Philter Diffuse](https://philterd.ai/categories/philter-diffuse/) · [Privacy](https://philterd.ai/categories/privacy/)

A question comes up on almost every data team that handles sensitive records: how many Social Security numbers flowed through this pipeline last month? It sounds harmless. It is a count, not a record. Yet the two obvious ways to answer it are both wrong.

The first is to publish the exact number. An exact count feels safe because it is just one integer, but exact aggregates can leak information about the documents behind them. The second is to fall back on crude bucketing or small-cell suppression: round to the nearest hundred, or hide any cell under some minimum. That destroys the utility you wanted in the first place, and the privacy it offers is shakier than it looks. Both small-cell suppression and k-anonymity have well-documented failure modes, especially once an attacker can combine several “safe” releases or bring in outside data.

[Philter Diffuse](https://philterd.ai/philter-diffuse/) is a third option. It applies differential privacy to PII counts and aggregations so you can answer the question with a number that is useful for analytics and carries a formal, mathematical bound on how much it can reveal about any one document. The bound is a property of the algorithm, not a promise on a spec sheet.

## What differential privacy actually means

Differential privacy is a precise definition, but the intuition behind it is approachable.

Imagine you run the same count twice. The first time, one specific document is in the dataset. The second time, you remove that document and run it again. If the two answers are so close that nobody looking at the output could confidently tell which run included it, then its presence is hidden. That is the whole idea: the output should look almost the same whether or not any single document is in the data.

The unit matters. Philter Diffuse protects a document, not a person. Someone who appears in fifty documents can move a count by fifty, so their protection is weaker in proportion. Keep that in mind when you choose your settings, particularly where one person can appear in many documents.

Philter Diffuse achieves this by adding carefully calibrated random noise to each count before releasing it. The amount of noise is not arbitrary. It is tuned so that the influence of any one document stays within a fixed bound.

That bound has a name: **epsilon**, written with the Greek letter ε. Epsilon is the privacy knob. Here is the plain-language version a non-statistician can carry around:

- Epsilon is a budget for how much the output is allowed to “react” to any single document.
- A **small** epsilon means more noise, a fuzzier answer, and stronger privacy. The presence or absence of one document barely moves the result.
- A **large** epsilon means less noise, a sharper answer, and weaker privacy. One document can move the result more, so more can be inferred about it.

A useful mental anchor: at epsilon near 0.1 the protection is very strong and the answer is quite noisy; around epsilon 1.0 you have strong protection that is still good enough for most production analytics; above epsilon 5 you are mostly trading privacy away for accuracy and should treat the result as low protection. Philter Diffuse prints exactly this interpretation in its audit report so the trade-off is never hidden.

What epsilon does **not** buy you is worth stating plainly. Differential privacy bounds leakage; it does not eliminate it. Every released number costs a little bit of your budget, and those costs add up across queries. It also does not anonymize raw records or make a single row safe to publish. It is a guarantee about aggregate outputs, and only when you respect the budget.

## Membership inference, briefly

The reason an exact count is risky is a class of attack called membership inference: figuring out whether a specific record is in a dataset at all, which by itself can be sensitive (think of a dataset about a particular kind of care).

Here is how an exact count betrays membership. Suppose you publish “47 records contain an SSN in the cardiology context this week.” Next week the same query returns “48.” If an attacker has reason to believe only one document changed, that single-unit difference can confirm that a specific document was added. No raw data was released, yet that document’s presence leaked through the arithmetic of two exact counts.

Differential privacy is designed precisely to defeat this. Because Philter Diffuse adds noise calibrated so that adding or removing one document changes the output by only a bounded amount, the attacker can no longer read a clean one-unit jump. The signal they need is drowned in noise they cannot distinguish from a real change.

## Tuning epsilon: the privacy and utility trade-off

There is no universally correct epsilon. Picking one is a policy decision that should match your regulatory posture and how sensitive the data is.

In Philter Diffuse you do not set epsilon directly. You set the **noise scale**, and epsilon follows from it. For the Discrete Laplace mechanism the tool uses, adding or removing one document changes each count by at most one. A document can contain several PII types, though, so it can change every count in a query at once. The sensitivity of a query is therefore the number of PII types it releases:

```
epsilon = sensitivity / scale = (number of PII types) / scale
```

So a larger `--scale` adds more noise and spends a smaller epsilon (more privacy), while a smaller scale spends a larger epsilon (more accuracy). Releasing four PII types at a scale of 4.0 spends epsilon 1.0 per query; at a scale of 8.0 it spends 0.5.

Because every query spends budget, Philter Diffuse tracks the cumulative epsilon you have spent against each data source and enforces a ceiling. When a new query would push you past the ceiling, the tool refuses: it exits with an error, writes no output, and spends no further budget. This is what stops an attacker from running the same query many times and averaging the noise away to recover the true value.

## A worked example

Philter Diffuse reads a flat JSON document of PII counts (or reads them from Philter’s API, more on that below) and writes privatized counts to a CSV alongside a human-readable audit report.

Start with the raw counts your pipeline produced:

```json
{
  "ssn": 4823,
  "name": 12947,
  "phone": 2841,
  "passport": 3
}
```

Run it through Diffuse:

```bash
python main.py \
  --input redaction-log.json \
  --source claims-2026 \
  --output privatized_counts.csv \
  --pii-types ssn,name,phone,passport \
  --scale 4.0 \
  --threshold 5
```

`--source` names the dataset, so the budget follows the data even if the file is renamed. `--pii-types` lists the types to release. The output has exactly those rows whether or not the data holds each type, because a row for each type found would itself reveal that a rare type is present, so choose the list before looking at the counts. A `--scale` of 4.0 spends epsilon 1.0 on this query (four PII types / 4.0), the strong-but-usable setting. The `--threshold` masks any privatized count that lands below 5, so rare entity types are reported as `None` rather than as a small, revealing number.

The CSV holds the noised counts:

```csv
PII Type,Private Count
ssn,4820
name,12944
phone,2836
passport,None
```

Note that `ssn` came back as 4820 rather than the true 4823. That small wobble is the noise doing its job, and it is the point: you can see the population-level signal (roughly forty-eight hundred SSNs, far more names, fewer phone numbers) while no single document’s presence rides cleanly on the result. `passport` was suppressed because its noised count fell under the threshold. The threshold applies to the noised count, so a rare type is not suppressed on every run: the same command can report `passport` as 5 or 7.

Diffuse also prints an audit report to your console that records the epsilon spent, a qualitative protection strength (HIGH at epsilon 1.0), and the per-type breakdown, so the privacy accounting is auditable rather than implicit.

If you are already running [Philter](https://philterd.ai/philter/) 4.0 or later and have it recording PII count statistics, you can skip the JSON step entirely. Diffuse reads the counts through Philter’s API, so it needs only an API key, not access to Philter’s database:

```bash
export PHILTER_API_KEY=<api key>
python main.py \
  --philter-url https://localhost:8080 \
  --philter-ca-cert philter.pem \
  --from 2026-10-01 --to 2026-10-31 \
  --pii-types ssn,email-address,phone-number,person \
  --output privatized_counts.csv \
  --scale 4.0
```

`--from` and `--to` are the UTC days to report on, both inclusive. The key needs the `pii-counts:read` scope and must belong to a Philter administrator. Philter records document-presence counts, where each redaction contributes at most one per type, which is what keeps the sensitivity bounded. That makes your own redaction telemetry from Philter a clean source for analytics: you can share how your pipeline behaves without publishing exact counts.

## What Philter Diffuse will not do

Setting expectations is part of an honest privacy tool.

- **Aggregate queries only.** Diffuse answers counts of PII types. It does not, and will not, release raw records or row-level data.
- **No reconstruction.** The output is designed so that you cannot reassemble any single document from it. That is a feature, not a limitation to work around.
- **Budget is finite.** Every query costs epsilon, and once a source hits its ceiling, Diffuse refuses further releases from it until you deliberately reset the budget. If you need accurate results indefinitely, you are misunderstanding what differential privacy offers.
- **It is not anonymization of your dataset.** Diffuse protects the answers to questions, not the underlying data at rest. Keep using [Philter](https://philterd.ai/philter/) for redaction and [Phield](https://philterd.ai/phield/) for monitoring; Diffuse is the layer that adds noise to the counts Philter records before you share them.

## Open source, and how to get started

Philter Diffuse is open source under the Apache 2.0 license. Every part of the pipeline (the noise calibration, the sensitivity assumption, and the budget accounting) is there to read. The privacy guarantee is one you can inspect and reproduce rather than take on faith, and the noise itself is generated by the well-reviewed [OpenDP](https://github.com/opendp/opendp) library.

To get started:

- Read the [Philter Diffuse product page](https://philterd.ai/philter-diffuse/) for the overview.
- Clone the repository at [github.com/philterd/philter-diffuse](https://github.com/philterd/philter-diffuse).
- Read the documentation at [philterd.github.io/philter-diffuse](https://philterd.github.io/philter-diffuse/) for installation, the full set of CLI options, and how the privacy budget is tracked.
- If you already run [Philter](https://philterd.ai/philter/), turn on PII count statistics and point Diffuse at it with `--philter-url`.

The next time someone asks how many SSNs went through the pipeline last month, you can give them a real, useful answer, and a formal bound on what that answer reveals about any one document.

## Got a redaction problem that looks like this in your own pipeline?

Spend 30 minutes with Jeff (the engineer behind Philter) and walk away with a clear view of the architecture that fits your stack. No sales pitch.

[Newer post →: Introducing Phield: Monitoring How PII Actually Moves Through Your Systems](https://philterd.ai/blog/introducing-phield-pii-drift-monitoring/)

[← Back to all posts](https://philterd.ai/blog/)

Questions, ideas, or want to contribute? Join the conversation at [community.philterd.ai](https://philterd.ai/community/). Everything happens in public on GitHub.
