File size: 6,892 Bytes
2af8f9a 9c2c9a4 2af8f9a 5436158 e4ebe6f ded341d e4ebe6f ded341d 5436158 ded341d 5436158 e4ebe6f 9c2c9a4 e4ebe6f 5436158 ded341d 5436158 ded341d 5436158 ded341d 5436158 e4ebe6f ded341d e4ebe6f ded341d e4ebe6f ded341d e4ebe6f 5436158 ded341d 5436158 ded341d 5436158 ded341d 5436158 ded341d 5436158 ded341d 5436158 ded341d 5436158 ded341d 5436158 ded341d 9c2c9a4 ded341d 5436158 ded341d 5436158 9c2c9a4 5436158 e4ebe6f 5436158 e4ebe6f 5436158 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | ---
license: cc-by-nc-4.0
language:
- en
- fr
- de
- it
- es
- nl
library_name: opf
pipeline_tag: token-classification
tags:
- pii
- privacy
- redaction
- accessibility-tree
- ocr
- computer-use
- agentic
- screen-capture
- screenpipe
base_model:
- openai/privacy-filter
metrics:
- f1
- recall
- precision
extra_gated_prompt: >-
This model is licensed CC BY-NC 4.0 (non-commercial). For commercial
use — production deployment, SaaS / API embedding, agent privacy
middleware, custom fine-tunes — contact louis@screenpi.pe.
---
# screenpipe-pii-redactor
> A [screenpipe](https://screenpi.pe) project.
A fine-tuned PII redactor for the **three surfaces an AI agent actually
sees a user's machine through**:
1. **Accessibility-tree dumps** — the structured AX hierarchy macOS /
Windows expose to assistive tech. Short, structured, often containing
labels like `AXButton[Send to marcus@helios-ai.io]`.
2. **OCR'd screen text** — what tools like screenpipe extract from
screen recordings. Mix of window-title-shaped artifacts, app chrome,
and occasional long-form (emails, docs).
3. **Computer-use traces** — what an agentic model (Claude Computer Use,
GPT operator, etc.) reads when it controls a desktop.
These surfaces are short, sparse-context, and full of identifiers that
slip past redactors trained on chat-style prose. This model is fine-tuned
specifically for them — while still handling long-form text at
competitive accuracy.
Built on top of the [OpenAI Privacy Filter](https://github.com/openai/privacy-filter)
(1.5B parameters, 50M active).
> **License: CC BY-NC 4.0** (non-commercial). For commercial use —
> production redaction, SaaS / API embedding, AI-agent privacy
> middleware, custom fine-tunes — contact **louis@screenpi.pe**. See
> [`LICENSE`](LICENSE).
## Headline numbers
| | base OPF | **this model** |
|---|---:|---:|
| Accessibility / window-title PII zero-leak | 38.6% (33.6–43.8) | **79.1% (74.8–83.5)** |
| Long-form PII zero-leak (English) | 14.0% (11.7–16.2) | **77.5% (74.5–80.3)** |
| Long-form PII macro-F1 (English) | 0.591 | **0.934** |
| Targeted secret-redaction (34 realistic shapes) | not measured | **31/34** |
| p50 inference latency (CUDA) | ~23 ms | ~23 ms |
95% bootstrap CIs in brackets. Zero-leak: % of cases where the model
caught all gold spans (the metric that matters for privacy).
## Why this exists (vs the base Privacy Filter)
The OpenAI Privacy Filter (and most other public PII redactors) is
trained on prose-shaped data. A typical accessibility-tree node, OCR'd
window title, or computer-use log line looks nothing like that:
```
AXButton[Send to marcus@helios-ai.io]
Welcome | Acme Corp | xAI Console
[ScreenCapture 09:14] Slack — #compai-tessera (12 unread)
```
These are 30-character strings with one or two PII tokens and almost
no surrounding context. A model trained on chat corpora will conflate
brand names with people, miss `Arc | Marcus Chen` because it expects
sentence context, and tag `Raycast` and `Claude` as people.
If you're building an **agentic system that reads screen state** — a
desktop-control agent, a memory layer for browsing, anything that
streams accessibility / OCR / screen-capture data into an LLM — this
is the redactor designed for that pipe.
## What it does
Span-level redaction. Given a string, returns `[(start, end, label, text)]`
where each span is a region the model thinks is PII, classified into one
of 12 canonical categories:
```
private_person, private_email, private_phone, private_address,
private_url, private_company, private_repo, private_handle,
private_channel, private_id, private_date, secret
```
`secret` covers passwords, API keys, JWTs, DB connection strings,
PRIVATE-KEY block markers, etc.
## Inference
```python
# pip install opf (currently from source: github.com/openai/privacy-filter)
from opf import OPF
filt = OPF(model="./model", device="cuda") # or "cpu"
out = filt.redact("Welcome | Marcus Chen — Confluence")
for span in out.detected_spans:
print(f" [{span.start}:{span.end}] {span.label} = {span.text!r}")
# -> [10:21] private_person = 'Marcus Chen'
```
See [`examples/inference.py`](examples/inference.py) for a longer example
covering window titles, long-form text, and secrets.
## Multilingual
This model handles 6 languages. Performance on a public long-form PII
benchmark (n=200 per language):
| Language | zero-leak |
|---|---:|
| English | 76.8% (70.1–83.1) |
| Spanish | 73.2% (66.5–79.3) |
| Italian | 70.8% (64.3–77.4) |
| German | 70.6% (63.5–77.1) |
| French | 68.1% (61.5–75.3) |
| Dutch | 56.1% (48.9–63.3) |
Romance + Germanic languages drop −3 to −9 pp from English.
**Dutch is the weakest** — flagged as a known gap.
## Limitations
1. **Sudo / login password prompts leak.** Pattern like `[sudo]
password for alice: hunter2` results in the username being redacted
but the password surviving. One known hard miss in the targeted
secret probe; mitigate with an OS-level keystroke-suppression policy
alongside this model.
2. **Dutch is the weakest language** at −20.7 pp from English. Indic,
Asian, African, Cyrillic scripts not evaluated at meaningful sample
sizes — don't deploy without a locale-specific eval pass.
3. **Synthetic training data only.** No real user data was used during
fine-tuning. Validate on YOUR data before deploying.
4. **Oversmash.** 7.8% on accessibility / window titles, 16.5% on
long-form text. The model over-redacts. Acceptable for privacy-first
deployments; flag if you need clean OCR text downstream.
5. **Strict label-space evaluation.** The numbers above use a
12-class taxonomy and a strict per-example zero-leak metric.
Absolute values depend on the evaluator's label taxonomy and metric
choice; macro-F1 is a more lenient point of comparison.
## Reproducing inference
```bash
git clone https://huggingface.co/screenpipe/pii-redactor
cd pii-redactor
git lfs pull
pip install git+https://github.com/openai/privacy-filter.git
python examples/inference.py
```
Reproducing the eval scores requires our held-out benchmark, which is
not redistributed. Contact **louis@screenpi.pe** for benchmark access
or commercial licensing.
## License
[CC BY-NC 4.0](LICENSE) — non-commercial use only. The base model is
Apache-2.0; obligations are preserved (see [`NOTICE`](NOTICE)).
For commercial licensing (production deployment, redistribution rights,
SaaS / API embedding, custom fine-tunes for your domain): **louis@screenpi.pe**.
## Citation
```bibtex
@misc{screenpipe-pii-redactor-2026,
title = {screenpipe-pii-redactor: a PII redactor for accessibility
trees, OCR'd screen text, and computer-use traces},
author = {{screenpipe}},
year = {2026},
url = {https://huggingface.co/screenpipe/pii-redactor}
}
```
|