PII rules
Settings → PII. What never leaves this machine as it stands.

One set of rules protects two audiences: an agent reading over MCP or the oe command line, and a person opening a share link. Both are data leaving this machine, and both go through the same code in the app's own server, reading the same two lists from the same file, ~/.objectexplorer/settings/mcp.yaml. Someone who decides once that email is never shared plainly has decided it for both. An edit in the pane holds from the next call or the next share — the file is read again every time, with no restart.
An agent you ask about a bucket, or about a local folder ticked Agents read through PII in Settings → Locations → Local folder, is the first audience too: it starts in an empty folder of its own and reads every file through the MCP server, under these rules.
An agent over MCP or oe | A person with a share link | |
|---|---|---|
| Which rules | both lists, on every call | both lists, on every share |
| Who can loosen one | nobody — no call can ask for less | the sender, one column at a time, for that one share |
| Drop or Token | as the rule says | opens as Hash: no column left out, no token sent |
| The key | one per install, in ~/.objectexplorer/account/mcp_key | one per share, made when the dialog opens, never in the link |
| How it is told | every rewritten column is marked encrypted: true | a rewritten column reaches the receiver's grid as text |
Everything else is the same: the methods below, the 16 hex characters a hash comes back as, the characters a mask hides, and the full-text rules — which hold over a share even for a column set to None.
Two lists, because there are two kinds of value
Tabular — matched against a column's name, anywhere in it. email catches email, emailAddress and billingEmail. Every value in that column goes through the rule, whatever the value says.
Full text — matched against what a value says. Only what it matched is replaced; the rest of the value is left alone. A note field with a customer's address and personal number in it is exactly the case this is for:
mail anna.berg@example.com about 19790224-5678 or call +46 73 987 65 43
mail kxnh.qtay@zbmwuxe.tqf about 84013557-1092 or call +19 04 246 71 88A starting rule file ships both — column rules for email, phone, national id and card or account number, and text rules for an email address, an international phone number and the detectors below — because a file with only column rules looks like it works right up until the day it does not.
Try a value, under the two lists, shows what an agent gets for a value you type under every rule above; name a column beside it and the tabular rules join in.
Five methods
| Method | What comes back | Keeps |
|---|---|---|
| Token | a typed pseudonym, <PERSON_17>, <EMAIL_3> | identity, joins, counts, type |
| FPE | a different value of the same shape | format, joins, counts |
| Hash | 16 hex characters of keyed SHA-256 (HMAC) | joins, counts |
| Mask | a range of characters hidden, the rest kept | shape |
| Drop | the value never leaves — the column is not in the result at all | nothing |
Drop and Token are for an agent. The share dialog offers None, Mask, Hash and FPE, and a column a rule drops or turns into tokens opens there as Hash — a share cannot leave a column out yet, and a token means nothing outside this install's vault.
Token is the default, and a rule that names no method gets it. The same value is the same token in every file, every session and every agent's answers — Anna.Berg@Example.com and anna.berg@example.com are one <EMAIL_3>, 19790224-5678 and 197902245678 one <ID_1> — so an agent can still follow one person across documents, and it is never in doubt that it holds a stand-in. A rule's type names the token (type: PERSON); without one it is read off the pattern.
The tokens live in a vault, ~/.objectexplorer/data/mcp/vault.db: SQLite, each real value encrypted (AES-256-GCM) under a key kept in the system keychain, never in the file. The file copied elsewhere holds nothing readable.
FPE stays for a column that must keep its shape — a format check downstream, a fixed-width id. Where there is no format to preserve — a float, a timestamp, a blob — FPE hashes instead.
Mask carries a range, dragged on a two-handle slider: the characters between the handles become stars and the rest is kept. The range can never close to nothing — a mask that hides no character is a rule that reads as set and does nothing.
Every rule shows its own sample, rewritten as you change it by the same code a call or a share goes through. The sample uses this install's key, so it is exactly what an agent gets; a share's Hash and FPE values read differently, because a share has a key of its own. A Token sample is never put in the vault: it shows the type and a digest, <EMAIL_bdd8e64f>, where an agent gets <EMAIL_3>.
Reveal
Settings → PII → Reveal turns a token back into the real value, for the person who owns this machine: the system asks for the login first (Touch ID or the password on macOS), and every ask — answered or not — is a line in ~/.objectexplorer/log/mcp/reveal.ndjson, with the token, who asked and what the login said, never the value. Windows and Linux cannot ask for the login yet, so there nothing is revealed. On the command line the same is oe pii reveal '<PERSON_17>', and oe pii reveals lists the asks (the command line).
Where the key lives
Hash and FPE are both keyed, and the key is the one place the two audiences part.
An agent is answered under one key per install, generated on first use and kept in ~/.objectexplorer/account/mcp_key — never in the rule file and never on the wire. So an encrypted value is stable across sessions on this machine, and means nothing on any other.
A share is encrypted under a key of its own, made when the share dialog opens. It never enters the link; Copy key is the only way it leaves the browser. So a receiver given that key holds that one share and nothing else, and the same email hashed in two shares, or in a share and an agent's answer, comes back as two different values that cannot be joined.
What an agent is told
Every column a rule rewrote is marked encrypted: true — in describeObject, in columnSummary and beside query results. An agent holding a customer id that is not the customer id has to be told, or it will hand it to a person as a real one.
columnSummary is measured after the rules, never before. The top values of the real column would be precisely the leak the rules exist to stop.
What the rules reach, and what they cannot
getObject reads a whole object and answers as what it is: rows for a table, which go through the column rules; text for a document, which goes through the full-text rules; a tree for JSON, YAML, XML or a notebook, where a key is treated as a column name (an ssn key anywhere in the tree is caught by the ssn column rule) and every other string goes through the full-text rules.
Documents are PDF, Word (.docx and the older .doc), OpenDocument, RTF, PowerPoint, EPUB, HTML and plain text. A picture, and a PDF page with no text in it (a scan), is read by the system's own text recognition on macOS before the rules see it; on Windows and Linux a picture is refused, saying so. Anything else — an archive, a model — is refused: bytes no rule can read are not sent. The one way past that is getRawFile, which sends a file as it is so an agent can look at a picture: the rules are not applied to it. It is off for an agent over MCP until you tick it, and on for an agent you ask through the PII rules.
A query cannot step around the column rules by renaming a column: each object it names is read through a copy where the caught columns are already rewritten, so SELECT ssn AS x, upper(ssn) and WHERE ssn LIKE '1979%' all see the rewritten value, and a dropped column is simply not there.
A full-text rule whose match starts with @ is a detector rather than a pattern: @id finds a Swedish personnummer, a US SSN, a Danish CPR or a Finnish henkilötunnus only when its date and check digit are right; @card and @iban likewise check Luhn and mod 97, so an order number of the same length is left alone; @person finds a name from lists of given and family names in a dozen languages, or any capitalised name after a title or greeting (Mr, Frau, Hej, Dear); @address a number and a street (Street, -gatan, -straße, rue …) with its postcode and town. The starting rules use all of them.
The name detector is lists and context, not a language model: a name it has no list entry for, with no title before it and no known family name after it, gets through. It is measured on a test set of planted fake people in six languages, and that is where it is improved.
That is why a root holding raw exports is a place for an approve rule, or for no grant at all.
Where the rules do not apply
They guard what leaves this machine for someone else: an agent over MCP or oe, and a share. They do not touch:
- your files, and what this app shows you — nothing is changed on disk;
- Ask… on a local folder not ticked Agents read through PII (Settings → Locations → Local folder; a folder holding
.gitstarts unticked): your own data, sent as it is to the agent you picked. Settings → PII lists the folders read this way; - folders other people open through this machine's server (Settings → Admin): they see the files as they are;
- Create Anonymized Copy, which replaces every value whatever the rules say.
Next: sessions, replay and audit.