@centrst/blind
v0.7.0
Published
Rewrite private text into a blind copy with consistent realistic fakes, then map answers back locally
Maintainers
Readme
blind
blind rewrites private text into a blind copy before it goes to a model or another service, then maps the answer back to the real values. Emails, web addresses, phone numbers, IBANs, cards, tax and identity numbers, IP addresses, amounts and dates become consistent fakes of the same kind and shape, and so do the names, companies and places it finds. Wording and arithmetic stay intact, so the service can still work with the text.
real From: Sophia Ward <[email protected]>
Total: £1,240.80 (£1,034.00 + 20% VAT), due on 3 March 2026.
blind From: Hilary Brierley <[email protected]>
Total: £802.80 (£669.00 + 20% VAT), due on 23 December 2025.All values above are invented, and the blind side is real output. The real text and the mapping stay on your machine. The service sees the blind copy, and you map its answer back locally. What it looks like shows a longer example.
blind has no runtime dependencies (C8), makes no network calls (C7) and runs on standard JavaScript (C19). That is the design. There is no model to download, no native code to build and nothing else to audit, and nothing leaves your process. CI tests it on Node 22, 24 and 26. Browsers, Workers, Deno and Bun offer the same standard APIs but are not tested in CI. The blind and unblind commands cover terminal use.
The trade is names. Without a model, blind finds a person, company or place in two ways. You list it in known, or the text gives it away where mail usually puts a name: a sender line such as Sophia Ward <[email protected]>, a greeting (Dear Margaret,), the line after a closing (Kind regards,), a label (Patient:), a title such as Dr. or Sra., a legal suffix (Finchley Dental Ltd), the words of a private address ([email protected]), or a later mention of a name it already found. A name that appears only in plain prose goes out unchanged, and the leak check cannot report it, because nothing found it. On blind's test corpus of 382 synthetic texts, mostly emails, it found 85.1% of people, 98.2% of companies and 3 of 176 places with nothing passed in, all three in street addresses. With one person per email listed in known, it found 99.3% of all the people. The corpus is home ground: its emails were written with these same greetings and signatures, so expect less on mail that writes names elsewhere.
So list every person, company and place you know is private in known. A listed value is replaced and leak-checked in any letter case (C3). A long list is cheap: an entry the text does not contain costs about 15 microseconds, so 10,000 contacts add about 0.15 s to a call (C55). The few exceptions, such as stop words and one-letter parts of a name, are named in leaks.unenforced. For text you cannot list in advance, turn on paranoid mode. It flags anything blind left that still looks private, such as an unfound capitalised name, a long digit run or an encoded block, and makes assertNoLeaks throw until each one is listed or cleared (C50, C51). It over-flags, so plan for a review step. Read the blind copy before you send it either way.
A separate package with a named-entity detector is in development. It finds more names in plain prose, but it needs a 1.1 GB model and native dependencies, so it stays out of this one. With just this package, use known and paranoid mode.
Contents: Install · Quick start · What it looks like · What it finds · What it does not find · Paranoid mode · Limits · Conversations · Streaming · Fakes, placeholders or random values · Model SDKs · Request handler · CLI · API · Detectors · Language support · Where it runs · Signed receipts · Compared · Claims · Development
Install
npm install @centrst/blindNode 22 or newer. Before 1.0, a minor version can change the API or the mapping format, and the changelog says when it does. npm install @centrst/blind@next installs the next prerelease channel instead. That channel moves only when a prerelease is published, so after a stable release it can be older than the default install; npm view @centrst/blind dist-tags shows both.
This README describes the source revision you are reading. Each published version bundles its own copy.
Quick start
import { blind, unblind, assertNoLeaks } from '@centrst/blind';
const result = blind([email], {
known: [
{ kind: 'person', value: 'Sophia Ward' },
{ kind: 'org', value: 'Moorcroft Joinery Ltd.' },
],
deny: ['*@my-domain.example', 'Project Falcon'],
});
assertNoLeaks(result); // throws if a value it found or was given survived
const answer = await askTheModel(result.texts[0]);
const { text, invented } = unblind(answer, result.mapping);text is the answer with real names, amounts and dates back in place. invented is a heuristic: it lists amounts, dates, emails and names in the answer that no real value stands behind, and it only recognises a name whose first word is on blind's built-in first-name list. A made-up phone number, company or Thaddeus Okonkwo is not listed. The mapping holds real values: keep it local and never send it anywhere.
What it looks like
Real output for one invented email, with Ben Carver passed as known and a fixed seed so the output is reproducible. A test in the repository fails if this section and the code disagree.
real
From: Sophia Ward <[email protected]>
Hi Ben, here is the invoice from Moorcroft Joinery Ltd.
Total: £1,240.80 (£1,034.00 + 20% VAT), due on 3 March 2026.
IBAN GB82 WEST 1234 5698 7654 32, card 4111 1111 1111 1111 12/28.
Policy number 48213907. Call me on +44 7700 900123. Thanks, Sophia
blind
From: Hilary Brierley <[email protected]>
Hi Barry, here is the invoice from Copperfield Labs Ltd.
Total: £802.80 (£669.00 + 20% VAT), due on 23 December 2025.
IBAN GB50 SLGZ 8496 0974 3683 54, card 4111 1150 5986 1850 12/28.
Policy number 84733788. Call me on +44 7700 900570. Thanks, Hilary- The base and the total still add up: the blind total is the blind base plus 20% VAT. One factor scales every amount, and one shift of whole weeks moves every date.
- The IBAN and card fakes pass their own checksums and keep their country, network and format. The policy number keeps its length and layout, and the UK mobile stays a UK mobile. The expiry date after the card is left alone.
- No one can be reached at a fake address blind makes (C58). A mapping from an earlier version keeps the fakes it holds, addresses and numbers alike, and those can still be live (see below). A private host becomes an invented host under
.example, and a fake mailbox at a public provider moves to the provider's name under.example([email protected]), a name RFC 2606 reserves. The provider itself stays only when the address is written unchanged ([email protected]) or the provider could never issue the fake (an underscore at Gmail). - In
fakemode, a fake number is drawn from a range no one holds wherever such a range exists (C58): every UK number blind finds or you list inknowngoes to the Ofcom drama range for its kind of line (020 7946 0xxx in London, 0113 496 0xxx in Leeds, 07700 900xxx for mobiles, 0808 157 0xxx for freephone, 01632 960xxx where its area has none), every ten-digit North American number to NXX-555-01XX (kept for fiction), Spanish mobiles to 75 to 79 (kept in reserve and not yet given to any operator), and IP addresses to documentation addresses. The built-in detector finds a UK number written with+44or0044, a mobile written with07, or a national landline in standard groups (020 7946 0958). A mapping from an earlier version passed back in keeps the fakes it already holds, addresses and numbers alike, so a conversation stays consistent, and those can still be live; only values new to the conversation get these fakes.randommode writes every number as a random Spanish mobile, which can be live. A fake can only coincide with a real number where there is no such range: Spanish landlines and special-rate numbers, numbers from other countries, IBANs, SSNs, DNI, NIE and CIF, VAT numbers and policy or invoice ids. Cards use the first six digits of the networks' published test numbers (4111 11 for Visa, 5555 55 for Mastercard and so on), but no card range is reserved, so a fake card can still match an issued one. Check the fakes before a downstream system calls, pays or writes to them. - The email is English, so the fakes are too: a woman's English name for Sophia, an English surname and an English host (C31).
- "Sophia" in the sign-off gets the same fake as the sender, because a name found once is found again.
- "Moorcroft Joinery Ltd." became another company because it ends in a legal suffix. A company named in prose without one (
Moorcroft Joinery), and a person named in prose away from a greeting, a signature, a label or a title, is not found unless it is inknown. The leak check cannot report it either, since nothing found it. Paranoid mode flags it for review. This is the main thing to plan for.
Pass the mapping to the next call and the conversation stays consistent:
next turn, real Has Sophia paid the £1,034.00 yet?
next turn, blind Has Hilary paid the £669.00 yet?And the model's answer comes back with real values. The model invented a card fee, so it is scaled back and listed in invented:
model answer Yes, Hilary paid £802.80 on 23 December 2025. A card fee of £25.00 is still unpaid.
unblinded Yes, Sophia paid £1,240.80 on 3 March 2026. A card fee of £38.64 is still unpaid.
invented ["£25.00"]The fixed seed is only there to make this example reproducible. Leave seed out in real use: the default is a fresh random seed per conversation, so the same person gets unrelated fakes in different conversations. Reusing one seed everywhere makes those fakes linkable, and anyone who knows the seed can try candidate names until one comes out as the fake.
What it finds
Scope. What is tested is plain text in English and Spanish prose: emails, threads, invoices and the like. Each item below is backed by a claim and its tests. What blind has no detector for is listed under What it does not find. Each text may be at most 1,048,576 UTF-16 code units (text.length) by default. A longer one makes blind throw a BlindError with kind input-too-large, the index of the text, its length and the limit, never its content, before any work is done (C32). The maxTextLength option changes the limit, and Infinity turns it off. Time grows about linearly with the text. A test fails if 800 KB takes more than six times the CPU time of 200 KB (C41). An answer given to unblind, or every chunk pushed to one createUnblinder together, has the same limit by default, set by a last argument { maxTextLength }, and a longer one throws the same input-too-large error with index 0, while unblind time grows about linearly with the answer and stays below the time it took to blind the text (C32, C49).
- Names, orgs, places. Found through your
knownlist,Name <address>anywhere in the text, titles such asDr.,Sra.orMrsbefore a name, values carried from earlier turns, and anyDetectoryou add. Ordinary mail gives more away (C54). At the start of a line, one to three capitalised words after a greeting (Dear Margaret,,Hi Ana, Luis and Marta,,Hola Belén:,Estimado/a Cayetano,,Buenos días Isidro,) are a person, and so is a name after a label (Name:,Patient:,Customer:,Client:,Contact:,Attn:,Nombre:,Paciente:,Cliente:), whileCompany:,Organisation:andEmpresa:label an org when the rest of the line is only the company name (Company: Dorsal Partners (billing)labels nothing). The line right after a closing (Regards,,Kind regards,,Best,,Thanks,,Cheers,,Sincerely,,Saludos,,Un saludo,,Atentamente,,Gracias,), or the line after that when the first is blank, holding only one to four capitalised words is a person, also with a job title after a comma (Odette Ashworth, CEO,Tobias Wren, Head of Sales). Then the first of the next three lines that holds only a company name with a company word or legal suffix is an org, unless a blank line comes first. A name line with anything else on it, such as a sentence or lower case after the comma, starts neither, and neither does a name two blank lines below its closing. Quoted lines (> > Kind regards,) count too. Group, role and common words keep these from counting:Hi all,Hi team,Dear Sir,Dear Customer,Hola a todos, a closing followed byAccountsorSent from my iPhone. Anywhere in the text, capitalised words before a legal suffix (Ltd,LLC,Inc,GmbH,PLC,Corp,S.L.,S.A.) are an org, without a word that only opens the sentence (Regarding). The words of a private address count as well: the parts of its local part, three letters or more, not role words such asinfo,salesorno-reply, not common words such aswilland not words of the private hosts, are found again wherever the text writes them capitalised as words of their own (Margaretformargaret.holloway@...), and the words of its host written as capitalised words (Finchley Dentalforfinchley-dental.example, with or without a legal suffix) are an org when the host label has two to six hyphenated words. A one-word host (dorsal.example) marks nothing. An address at a public provider (gmail.com) says nothing. A person found once is also found wherever the name appears again bare, in any text of the call, unless the text also uses that word in lower case as an ordinary word. A name word of one or two letters (Li) is not, so list the full name inknown(Li Na), since a single Latin letter alone is refused there. A sender with company words (Clínica,Asesores,Labs,S.L.,Inc) is an org. A sender written entirely in capitals is read as a person whose words are replaced one by one (NORVALE KESTREL), and a legal form it ends in (LTD,LTD.,LLP,INC,INC.,GMBH,CORP,CORP.,PTE,PTE.,PTE LTD,PTE. LTD.orLIMITED, after a space, a no-break, figure, thin or narrow no-break space, or a comma, with any spaces after it) stays as written beside the fakes and is no word of the name ("NORVALE KESTREL LTD"becomes, for example,"RODNEY ASHBY LTD"). When one letter or nothing comes before the legal form ("Q LTD"), the whole name is read as a person's. A sender ending inLLCorPLCis a company, by the company words above, before this rule. A legal form in a name that is not all capitals ("Quorvex LTD") or not at its end ("QUORVEX LTD (UK)") is read as before, as a word of the person's name. An org found once is found again by its full name. Fakes come from small built-in English and Spanish lists, in the language of the value: an English name, company, place or host gets an English fake and a Spanish one a Spanish fake, and a value that says nothing about its language (Mena,Daniel) follows the paragraph around it. A first name keeps its gender (C31). Email local parts follow the fake name. Casing (ALL CAPS, lower case) is carried over. - Emails, domains, URLs. Domains become
*.example. URL paths keep their shape, long ids in paths and query strings are scrambled, emails in query strings are rewritten, and percent escapes (%2F) stay as written, so an encoded link still decodes. The value of atoken=,key=,secret=,code=orauth=field with twelve letters and digits or more, escaped ones counted, is scrambled as a whole, an escaped letter or digit as the escape of another. A letter or digit written as an escape counts as written inside a word, so an id with an escape in it (id=712%334567) is scrambled as it would be written plainly, the escape kept as an escape of the new character; the same holds for an identifier glued to a held host or after an address's host (below). A run that 0.6.0 scrambled because an escape's two digits made it six characters long (bank%2F71234) is scrambled still, the escape kept, unless it is a mapped name after an escape of a character that is no letter or digit (%20Mercer), which gets its fake; after an escaped letter (%41Mercer) it is scrambled. A letter written as an escape whose fake is outside ASCII is written as that character's UTF-8 escapes, so the link still decodes. Where a mapped name written with an escape (d%61na) gets a fake of another length, the fake is written plainly and the escape is gone. An address in a link is read as written, its local part taking in the escapes of+,.,-,_, letters and digits before it and what lies between them (mailto%3Adana%2Bteam%40...,dana.merc%65r@..., read asdana.mercer), never an escape of:,/,=,&,?or#; its fake keeps each separator's escape where it was. A%before two hex letters that make no ASCII character (100%dana_belen@...) is read as a bare%, and the letters after it start the local part, as 0.6.0 read them. A held host that starts the local part is replaced on its own, and the address starts after it, when some of the local part is left (quorvex%2Eexample-ana.ruiz%40...); a held host inside or ending the local part (dana=quorvex.example@...,belen.ortega-quorvex.example@...) is part of the address, which is replaced whole as in 0.6.0. A second address right after the first through+or_is replaced too. Then every address 0.6.0's own pattern reads in the link gets a fake for each part of it the reading above left alone (dana%61@...,ana.ruiz%37@...,100%ana.ruiz@..., a second address after a-,_or+, an address chained on another's host such asana%[email protected]@thirdhost.example_belen@...): the whole address, the rest of its local part after another piece, the local part alone where its host went into another address, or the host alone where its local part did. A local part is read with the escape it starts inside, clipped where another piece ends, and an escape is never split, a whole UTF-8 character written as escapes (%E2%82%AC) included. Where a host 0.6.0 read went into the local part of the next address (dana%[email protected]@...), it is replaced as a host and that address starts after it, so no word of it is kept as a role word. Letters and digits glued after a held host (quorvex.e%78amplebelen) are scrambled with it, as 0.6.0 scrambled the token. Letters and digits glued before one (12345quorvex.example,[email protected]%72vex.example) are scrambled where 0.6.0 scrambled the token they made with the host's first label (six or more, a digit among them, the two characters after a%counted and the token read back over whatever came before, as 0.6.0 read it:[email protected]%75orvex.examplereadsexample1234q); what is scrambled reads back no further than the piece before them. Escapes of letters and digits among them are part of them (x9y8z%3573019quorvex.example), each scrambled as the escape of its new character. Any other escape before them stays as written, so a link that decoded still decodes: a separator (%2Fabcquorvex.example), a control character (Invoice%0A,%09,%7F), a whole UTF-8 character (Caf%C3%A9quorvex.example), or a double-encoded separator (%2540quorvex.example, an encoded at sign); its hex digits still count toward the decision. After a%that starts no escape of a whole character (%A912345quorvex.examplewith no UTF-8 lead byte before it) the two characters are scrambled with the rest, as in 0.6.0. A literal%whose next two characters read as an escape of a control character is taken as that escape, so they stay:100%12345quorvex.examplegives100%12881..., the identifier's first two digits kept, where 0.6.0 scrambled all five. Held hosts glued to one another (quorvex.examplequorvex.example, or a dotless host such asbuildboxrepeated, held because another link in the text names it) are each written once as its fake, and the work stays linear. A host found in the text is held only from three characters on, as the leak check looks for an unknown value only from there, so a shorter one (goofhttp://go/expenses) stays as written in other links, as on 0.6.0; one given inknownis held as given. The text grows by the fake's length over the host's for each one, with no fixed factor: the shorter the held host, the more (ab.ioglued 8,000 times afterhttps://ab.io/sgoes from 40,042 characters to 192,073, about 4.8 times; the three-charactera.b/8,000 times afterhttp://a.b/sfrom 32,039 to 200,072, about 6.2 times; the two-characterab/given inknown, 8,000 times, from 24,038 to 200,072, about 8.3 times), so a blind text can be longer than the defaultmaxTextLengthofunblind(1,048,576). Memory grows with the output: a 1 MB link ofa.b/repeated gives 6.55 MB and needs a heap of about 320 MB (it runs out of memory under 256 MB), where 0.6.0 withholds the same text in less than 300 MB. The other way round, a restored text can be far longer than the answer: each copy of a short fake gives back its whole real value, so a mapping holding a host with a label far past what DNS allows (220,000 letters) restores an answer of 250 copies, 5,250 characters, to 55,002,250; one that would be longer than the engine lets a string be (2,500 copies) is refused withinput-too-large. A short held host that is the first part of a longer host written with an escaped dot ([email protected]%2Eharlow.examplewithab.ioheld, or[email protected]%2E%71uorvex.examplewithquorvex.exampleheld too) is withheld, as 0.6.0 withholds the same address with a written dot. A consumer that restores such an answer passesunblindamaxTextLengthat least as long as the answer itself, andcreateUnblinderone at least as long as the longest answer it lets a stream run to (orInfinity); an answer that echoes the blind text needs at least that text's length. It then restores the answer exactly; with the default it throwsinput-too-large, and nothing is lost. An address's host is read on past where 0.6.0 stopped, over escaped letters inside its last label (post.example%78.example) and the labels and dots after it, written or escaped alike (t%65am%40post.example%2Eex%61m%70le,[email protected]%2Ecom.harlow.example), for an address found either way, in time linear in the host, so a known address there is found whole and replaced even when the host before the escaped dot is allowed. It is read shorter where another address is read right after it, or where the longer reading would end in an allowed provider's host that 0.6.0's reading is not ([email protected]%2Egmail.comreplacesharlow.example), and the known-address check still sees the whole host then ([email protected]%[email protected]with[email protected]known); its dots stay as written. Where it reads on past a private host 0.6.0 read and replaced ([email protected]%2Eprivate.example,[email protected]%2Eexample), the host gets a fake host of its own, none of its labels kept, so the short labels 0.6.0 replaced are not kept as written (a known host before the registrable part has each label replaced instead, as above). An answer that quotes such a fake alone with its escaped dot (fernhill-consulting%2Eexample) gets back the bare label of the real host's registrable part (xy%2Eexample), not the whole host; the whole link, or the fake quoted with a written dot, comes back exactly. The host gets that fake of its own unless the mapping already holds a fake for it: one drawn from it written plainly ([email protected], in the same call or an earlier turn) keeps its short labels as 0.6.0 keeps them in plain text, and the escaped form keeps that fake, so those labels reach the blind text there as the plain form already sent them. A short held host inside a local part (ab.io1234ana@...withab.ioheld), which the local part's rewrite would keep as two initials, has its words replaced, so the leak check no longer withholds that text; letters written as escapes there are written plainly. Letters, digits and escapes of them glued after an address's host, the address read either way ([email protected],an%[email protected],55501%399k3), are scrambled where they make such a token with the host's last label, which is more than 0.6.0 scrambled; the decision reads on into a piece that follows (example3f9ab%2Eiowithab.ioheld), and the scrambling stops where that piece starts. Amailto:link's query is not read as a link query: a held host in its body (mailto:[email protected]?body=see%20quorvex.example) is left as written and the leak check finds it, so that text is withheld (fails closed), as under 0.6.0. A test compares 2,000 generated links with 0.6.0's output: addresses with escaped letters and separators, chains of addresses on one another's hosts, identifiers glued before or after a held host written plainly or with escapes, after a separator, glued to what comes before, or right after an address, with a control, UTF-8 or escaped-digit escape before them, held hosts glued to one another, and a known address with an escaped dot after an allowed host. It finds no address word, host or identifier that 0.6.0 replaced left as written or as escapes, no link that decoded and no longer does, no generated link more than three times as long as it was (its held hosts are close in length to their fakes; see above for the real bound), and no known address left once decoded. An address given inknowngets a fake inside a link however it is escaped, a role mailbox at a public provider included, read either way: an address 0.6.0's own pattern reads whose host went into the next address (suppor%74%40gmail.com%2Bbilling%40...) is written whole when its host can be taken back, so the known-address check, the allow-list and the role-word rule see it, and a private local part there gets the provider's fake host (yahoo.example). Where the host's longer reading ends in an allowed host but its added part would change when read as the link's words (a run of six letters or digits or more with a digit, the two characters after a%counted as 0.6.0 counted them, or a mapped name, also one written between escapes:post.example%74enant4711.post.example,post.example%2Emercer.post.example,post.example%2Dx.Mercer%7A.post.example), it is read shorter and that part is scrambled as 0.6.0 scrambled it, its escape kept. A held host that starts inside a label the host would read (cedar.example%61b.io3f9,yahoo.com%2Emx%61b.iowithab.ioheld) is still replaced as a held host, the label read up to it, so a known address there is still found; one that starts a label of its own and ends the host, alone or with held hosts right after it (x.co%2Eab%2Eio,x.example%2Eab%2Eio%2Eab%2Eio), is part of the host, which gets a fake host of its own, none of its labels kept, on that turn and on a later turn that carries the mapping, in any link, unless the mapping already holds a fake for that host: one host gets one fake in a mapping, so where the same call or an earlier turn wrote it plainly first ([email protected], which keeps its short labels as 0.6.0 kept them), its escaped form keeps that fake, short labels included; a known host among those first labels (x.coof[email protected]%2Eab%2Eiowithx.coknown) has each label replaced, unless the mapping already holds that host: then it keeps its one fake, and where that carried fake keeps a host named inknownonly on a later turn, the fake is written with plain dots however the link escaped them, in an address or a link's path, so the leak check finds that host and withholds the text (fails closed), except where the fake follows the hex digits of an escape (next=https%3A%2F%2Fx%2Eco...,kim%40x%2Eco..., after%20or%3D), with its dots escaped or written, where the leak check does not count a host under five characters: 0.6.0 left the escaped forms as written with the check passing too, and withheld the written-dot redirect only because it left the held host after it as written; the short host itself had gone out on the earlier turn, before it was known, in both; one that starts a label with more of the host after it (post.example%2Eab%2Eio.post.example,post.example%2Dx.cedar.io.post.example) is replaced as a held host, the host read up to it. Letters and digits glued after a held host are scrambled with their escapes (ab.io%37%33019). An address at a sub-host of an allowed host with every dot escaped (info@mail%2Epost%2Eexamplewithpost.exampleallowed) saves a pair for its first two labels (mail.post), so a later turn that names that host is withheld (fails closed), as 0.6.0 does with only the last dot escaped. The local part of a known address that holds a=(kim=team@harlow%2Etest) is read from after the=, as 0.6.0 read it, so it stays as written; its private host is replaced, and at a public provider (kim=team@gmail%2Ecom) the whole address stays, as on 0.6.0. An address whose host is written only with escapes, which 0.6.0's pattern does not read (support@gmail%2Ecom,[email protected]%6Fm), is read too, so a known address there is replaced; its host is read up to its first label of letters after a dot and on from there as any other host, so where it runs on into an allowed host, what 0.6.0 scrambled there is replaced (info@post%2Etenant4711%2Epost%2Eexamplewithpost.exampleallowed). Each mailbox a local part holds is checked againstknown, the whole of it and what follows each separator in it (cedar%2Eexample%2Binfo%40post.exampleholds[email protected]), a known mailbox that starts with a separator included, alone or after a word (%2Binfo%40post.exampleordana%2Binfo%40post.examplewith[email protected]known,x%5Fsales%40...with_sales@...known), and no known mailbox is kept in the fake: where the fake keeps any of them as written (dana%2Binfo%40post.examplewith[email protected]and[email protected]known, in either order), the longest one kept gets a fake word for each of its words and the words before it stay as the fake has them, so a long local part that ends in a known mailbox stays about as long. The known mailboxes at a host are read from the fake local part's last character back, and the reading stops at the first character no known mailbox there has, so a longknownlist or one long known mailbox costs no more than reading the local part once. Those mailboxes are kept as a tree of characters, which costs memory beside theknownlist: about a fifth more at the peak for 100,000 known addresses (2,380 MB against 1,969 MB). A role mailbox at a public provider not inknown(mailto%3Ateam%40mailbox.example) and a role word in a local part (dana%2Bteam) stay as they do in plain text ([email protected],dana+team@...keepsteam); 0.6.0 changed them only because it read the escape's digits as part of the local part. A bare%before two hex letters (%Dana%) is an escape, so that text is withheld rather than read as a name. A host the call or an earlier turn replaces is replaced inside another link too, exactly where the leak check would find it in the link with its escapes decoded: as a path segment (/i/quorvex.example/inv), inside a longer word (pre-quorvex.example), before a file extension (quorvex.example.png), or in an encoded link in the query (quorvex%2Eexample,quorvex.ex%61mple), each separator of the fake written as the one in its place. Two held hosts that overlap (quorvex.example.examplewithexample.exampleheld too) get one fake, and the leak check reports the other, so the text is withheld. A double-encoded escape (%252F) is not decoded, and the letters and digits after it are scrambled as in 0.6.0. A link the mapping already holds keeps its saved fake, which can still hold a real host; the leak check finds that host and fails closed, unless the saved fake writes it with escaped dots (x%2Eco), as on 0.6.0. Public platforms (gmail.com, google.com, outlook.com, icloud.com, booksy.com, fresha.com, calendly.com, github.com and a few more) are left alone. - Postal addresses. A street line with a house number in English layouts (
4417 Larkspur Hollow Rd Apt 2B,Flat 3, 12 Quillon Road,88 Maple Crescent,PO Box 4417) and Spanish ones (Calle de los Tilos Altos 14, 3º B,calle del Olmo, 14,C/ Mayor 3) is aplace, and so is the locality after it: on its line, a town after a comma, a US state or Canadian province with its ZIP or postal code (Brookhaven, OR 97399,Brookhaven, OR 97399-1234,Ottawa, ON K1A 0B9), a UK postcode (Ashcombe Vale ZZ1 4QX) or a five-digit postal code before a town (52990 Torrebruna), and on the lines below, the same with a postal code, a unit line, or a town line followed by a postal code line. A town alone on the line below a street is not read outside a labelled block. A postal code after its label (Postcode:,ZIP code:,Código postal:) is one too. In a labelled block (Shipping address,Billing address,Delivery address,Ship to,Bill to,Dirección de envío,Domicilio), the label in any letter case, the lines up to a blank line or another field are read the same way, however many there are, up to two short notes above the street (six words or fewer,delivery instructions) are passed over, and the block ends at a longer line or at a line below the street it does not read, an address after the label on its line goes on below when it ends that line, ac/o,AttnorA/Aline names who it goes to and the block goes on below it, a line there that starts or ends with a number is an address line in any letter case (4417 larkspur hollow rd,brookhaven, OR 97399), while a sentence with a number inside it (Your order ships in 3 days) is not, and a line of one character (a lone3) is not an address, a line above the street is the person or company it goes to, and a country line stays as written. A town alone after a street counts up to a comma, a stop or the end of its line, soRd, Please callkeepsPlease. Infakemode an address keeps its shape: new digits and letters in its numbers and codes, a fake town for each run of name words, the suffix, unit words, street type and region kept (2398 Elmhurst Rd Apt 6K,Ashendale, OR 70269). Inrandommode it becomes a fake town with no shape kept, and inplaceholdermode[REDACTED_PLACE_1]. An address the patterns read that is left in the blind text with its number or postal code outside what blind wrote is aplacehit in the leak check, unlesskeepholdsplace(C59). Prose with a number before capitalised words (3 Main points,2 Hard Drive bays), amounts, dates and versions holds no address. - Phones, IBANs. Same length and format, separators kept. A UK, Spanish or North American mobile stays a mobile of its country, and a landline a landline (C31). A UK number of seven to nine national digits (
0800 1111) gets a ten-digit fake, since no drama range is that short (C58). Fake IBANs carry valid check digits. - Typed ids. Payment cards (Luhn and network checked, in any one separator style), US SSNs (dashed), Spanish DNI, NIE and CIF (control character checked), EU VAT numbers, and IPv4 and IPv6 addresses. Each fake passes the same check as the original and keeps what says what it is: the card network, the NIE letter, the CIF organisation type, the VAT country. IP addresses become documentation addresses (RFC 5737 and RFC 3849). The same number written two ways gets one fake (C20).
- Other ids. Six digits or more in a row, letters mixed with four digits or more, and a value with three digits or more after a label such as
DNI,SSN,pasaporte,póliza,NHCorpolicy number. Same length and layout. Technical text is not one of them and stays as written (C57): a git SHA in lower-case hex (3f9a2c7, or all 40 or 64 characters), a UUID, a hex colour after#with a letter in it (#1f6feb), a value of up to 24 characters marked as a SKU (SKU-4417-BLK,SKU: 100234), and a lower-case name of words, version pieces and dates joined by-or/, such as a model, release or file name (gpt-4o-2024-08-06,claude-3-5-sonnet-20241022,release-2026-01-15,src/v2024/parser1234.ts). Such a name with a number of four digits or more that is not a date is still an id (ord-2026-88412), and so are capitals (ORD-2026-88412,EXP-2026-7670), digits after#(#123456), a product code without the SKU mark (WX-2290-M) and anything after an id label. Versions such as2.14.3were never ids. Typed ids keep their own rules, so a DNI, NIE, CIF, card or IBAN is replaced wherever it sits. Inside a SKU it is replaced as that id and the mark stays (SKU-12345678ZkeepsSKU-and gets the DNI's fake). - Amounts. One factor in [0.6, 1.6] per conversation, rounded to the original precision, currency and number format kept exactly (
1.234,56 €,$1,234.56,1 240,80 €,USD 12.00,15 euros). Thousands grouped with a plain, no-break or thin space are read as one number, so12 500 €is twelve thousand five hundred. When the text shows a relation, the derived amount is recomputed from the scaled operands: a base with a percentage and its surcharge, a base plus a VAT line,a + b = c. An amount in two relations keeps both, since the factor is drawn again until one rounds both to the same cent, and when no draw does, or a later turn keeps the first factor, it keeps the first relation found, a percentage before a sum before a surcharge. Everything else is scaled alone, so it can be off by one unit of the last digit (C4). - Dates. One shift per conversation, a nonzero multiple of 7 days up to 70 either way, so weekdays and intervals hold (C5). ISO,
April 7, 2026,7 April 2026,9 de abril de 2026,6 de octubreand slash dates are re-rendered in the same format and language. Times of day are untouched. Dates without a year stay without one. - Leak check. After rewriting, the output is scanned for every original value found, every
knownvalue, every value from earlier turns and everydenyentry (C2, C3). A person or company from an earlier turn counts where it is written with a capital, as it is found again, unless it is inknownor this call finds it too, and then it counts in any letter case (C21). A fake blind wrote in place of one value can spell a name or company the conversation meets later. That copy is blind's own writing and no hit, unless the name is inknown; a copy outside what blind wrote always is one (C2). A person's name is checked word by word, without its particles (de la) and without a word it writes in lower case between two capitalised ones (fromofAnna from Harborview), which every text writes (C2). Aknownvalue made only of stop words (Al,De) is matched as written or in capitals, so its lower-case copy (alinfue al banco) is an ordinary word and is neither replaced nor reported as a hit, and so is the lower-case copy of a part on the stop list that a full name writes capitalised (alofAl Brennerin Spanish text) or of a one-letter part of a full name (oofO Li). A two-syllable Korean value is matched only where a word starts, so a copy inside a longer word (지원in우리팀지원님) is neither replaced nor reported as a hit. The report names each such entry instead:leaks.unenforcedholds{ kind, index, reason }per entry,indexits place inknownandreasonstop-word,stop-word-part,one-letter-partorhangul-inside-word, never the value, whether or not the text writes such a copy. It never setsokto false,assertNoLeaksthrows only on hits, and the CLI prints each entry by index and kind on stderr (C3, C40). A value in a script without word spaces (Chinese, Japanese) is checked as a plain substring, a Hebrew or Arabic value also behind a glued prefix at a word start (לדוד,ومحمد), reported by kind and the offset of the value (C3, C40), and aknownvalue that is empty or one character makesblindthrow with its index and kind, since it cannot be checked. One character of a script without word spaces (华) is matched as a substring and replaced like any known value as aperson,org,placeordomain, and refused withinvalid-known, its index and kind as anemailorid, which have no fake for it (C40). A one-character word of a known full name is replaced inside the name in both scripts: a Latin one (OofO Li) is also found bare as written or in capitals, and one of a script without word spaces (华of李 华) is not looked for bare, so the leak check holds a bare copy back (C40). A knownidwith no ASCII letter or digit and a knownemailwithout an@that has text on both sides are refused the same way at any length, since their fakes rewrite exactly those (C40). A value none of these cover is not checked. A value of a kind blind has no detector for is never found, so the leak check never reports it unless it was given inknownordenyor found elsewhere in the call. Without paranoid mode a text can reportok: truewith such a value in the blind text (see What it does not find). An address the address patterns read is the exception: see Postal addresses above (C59).
What it does not find
No built-in detector looks for the values below. Each one goes out as written unless you list it in known, which replaces every copy written out as text, in any letter case. A copy that is encoded (base64, quoted-printable, a MIME encoded word), split by a line break inside a word or spelled out is not replaced, even when listed (E2 to E4, S6, O3). A deny entry is not replaced: the leak check reports it as a hit while it stays in the output. A copy of a value blind found elsewhere in the call is replaced when it is a person or company blind finds again where it is repeated, like the name above the address in G1, and otherwise reported the same way. Otherwise the leak check has nothing to look for, so without paranoid mode leaks.ok stays true while the value sits in the blind text. With it, a suspect the sweep flags makes ok false. No claim covers these values and no corpus floor measures them. The only tests are cases in the adversarial set marked as known misses, IDs in brackets, which fail the build the day blind starts finding one, so this list has to change with it. known-misses.md has every input and why it slips. Paranoid mode flags some of them for review. Each item says what it does not flag.
- Addresses in other layouts. A street without a house number (G25), a German or other layout the patterns do not read (G26), a town, region and postal code in a sentence with no street before them (G27), a unit on its own line above an unlabelled street (G28), a town after a street followed by more of the sentence (G29), a town alone on the line below a street outside a labelled block (G30), and a lower-case street below a long note in a block (G31). Paranoid mode flags the street and town words and the postal code of all but the unit, the town alone on its line and the lower-case street.
- Place names. A town or region in a sentence or a field, outside an address (G6). On the corpus, with nothing passed in, blind replaces 3 of 176 places, all three in street addresses.
- Names and companies in plain prose. A name with no sender line, greeting, signature, person label, title or earlier mention goes through unless you list it in
known, and so does a company in prose without a legal suffix (F13, X15). In documents with none of these, such as CSV, EDI or bank statements, the core has nothing to start from, and it found 3.6% of names on the Gretel sample in the 24 October run. A name that is also an ordinary lower-case word in the same text (Rose and rose) is not carried to its bare mentions. A name from an earlier turn that a later turn writes all in lower case (thanks, priya) goes out as written, and is reported only when that turn finds the name itself, in a sender line or a greeting (C21). The leak check still reports those when blind found the name in a span such as a sender line, but a name it took only from an email address ([email protected]) is then not found at all, so list it inknown. - Structured formats. Blind treats JSON and CSV as text. It recognizes name and address fields inside explicit vCard blocks. JSON field names such as
"name":or acitycolumn are not used to find values (G15). - Coordinates, plates, unlabeled logins and device ids. GPS coordinates (G8), vehicle plates (G10), usernames without a login cue and MAC addresses (G13). Paranoid mode flags coordinates and the letters of a plate.
- Card security codes and expiry dates (G9). Paranoid mode flags neither.
- Details that identify someone in combination. An age (G14), which paranoid mode does not flag. A job title, a rare situation or writing style can identify someone too. Nothing looks for them and no case tests them.
- Other codes and number layouts. SWIFT and BIC codes (G16), phone layouts such as Mexican
(55) 1234-5678(G18), French01 99 00 41 27(G19), Swedish08-465 004 27(G21) or German(030) 123 45 67(G22), and an SSN written with spaces and no label (F14). Durations and frequencies such as "monthly" or "30 years" are not dates to blind and stay as written. - Other locales. A German or French date (
7. April 2026,7 avril 2026) (G20, G23), which paranoid mode does not flag, and a name after a title such asFrau,Herr,M.orMme(G24) go out as written. - Words, encodings and splits. Numbers, dates and digits written in words (W1 to W6), text hidden in base64 or quoted-printable (E2 to E4), and names, phones and addresses split by a line break or irregular spacing (S3, S4, S6) or in layouts such as a space before the top-level domain (O3).
Paranoid mode
The leak check only knows values blind found or you gave it. A name nothing found goes out as written, and nothing reports it. paranoid: true adds a review gate for that case. Before the blind copy is used, a sweep reads the text blind leaves as written and flags anything that still looks private (C50):
name: capitalised words that are not common ones, a run of them anywhere (Patient Ana Ruiz), a single one anywhere but the start of a sentence, a line or a subject line (Nos vemos con Lucía). A single one right after an opening bracket, a quotation mark, a dash, a bullet or a>quote marker counts as starting a sentence, so(Zorina)and"Zorina"are not flagged. Function words, months, weekdays, mail headers, greetings and the public platforms' names are left alone.number: five digits or more in groups (123 45 6789,ES91 210 0041 8450).handle:@or#before a word (@AnaRuiz_Design), including the tail of an address the detector did not take whole.encoded: MIME encoded words, quoted-printable escapes and base64 runs, which hide text from every pattern.address: an address spelled out (ana at gestoria dot example,[at],[dot]).
Each suspect is listed in leaks.suspects by kind, text index and offsets in the input text, so a reviewer can find it in what they hold. The value is never in the report. Any suspect makes leaks.ok false, so assertNoLeaks throws and the CLI exits 2 with nothing written. The blind copy and the mapping are the same with or without the sweep.
The review loop: put a suspect that is private in known, so it is replaced, and one that is not in allow, matched whole without regard to case or accents, and run again (C51). An allow list kept across documents is how a team's review gets faster.
const res = blind([note], { paranoid: true, known, allow: ['Seguridad Social'] });
assertNoLeaks(res); // throws until every suspect is replaced or clearedHow much it catches and what it costs, measured 2026-11-09:
- On the labelled corpus, the test requires the sweep to flag at least 97% of the values that survive detection (C52). In the 2026-11-10 run it flagged 390 of 399 in bare mode and 183 of 185 with known lists. That run counted an exposed title as part of a name. The current scorer checks the name itself. The common-word list was tuned on this corpus.
- On the 888 Gretel finance documents, which blind was not tuned on, it flagged 2,891 of the 3,365 labelled values blind left (86%) and held 877 of the 888 documents. Contracts capitalise terms such as
Policy,BorrowerandAgreement, so about 15 suspects per document match no label. Gretel's labels are incomplete, so some of those are private too. The run is recorded in RESULTS-paranoid.md. - It flags 24 of the 43 known misses in the adversarial set (C52). Those include unlabelled names and companies, some unsupported address and phone layouts, handles, hashtags, encoded text, and some numeric identifiers. The known misses list names each input that still passes through in ordinary mode.
Use it where a human reviews what leaves, or where a held document is cheaper than a leaked one. With replaceWith: 'placeholder' nothing in the blind copy reads like real data. Every value blind replaced is marked, and a reviewer has looked at every value it left.
Limits
blind lowers what leaves your machine. It is not 100%, so check the blind copy before you send it. Anything it misses goes out as written, and the leak check only reports values it found somewhere or that you gave it in known and deny. What it does not find lists the kinds it has no detector for. It also does not make the text safe to publish.
THREAT-MODEL.md says who the adversary is, what is replaced, what is only scaled or shifted, and when to use placeholder or random instead.
- Amounts are scaled by one factor and dates shifted by one shift for the whole conversation, so relations between them hold. One known amount gives away every amount, and one known date every date. When the service does not need to compute with them, use
replaceWith: 'placeholder'or'random'. - In
fakemodeunblindtreats every amount and date it does not know as computed from fakes. One the model adds from general knowledge is rescaled or shifted too. With the seed of the example above,The VAT registration threshold is £90,000can come back as£139,104, andThe tax year ends on 5 April 2026as14 June 2026. Both are listed ininvented, but the text has already changed. A month, quarter or year the model derives from a shifted date is not mapped back and not listed:due in December 2025, i.e. Q4 2025stays that way when the real date is 3 March 2026. When amounts and dates need not be hidden, passkeep: ['amount', 'date'](C53). - Chat apps with memory (ChatGPT, Claude on the web) remember across chats, while each new conversation gets new fakes. Memory can then hold one real person under several fake names, or two real people under one fake name, and a name the model recalls from memory does not map back. Turn memory off, or keep related work in one conversation and pass its mapping along.
- A fixed
seedreused across conversations makes fakes linkable and lets anyone who knows it test guesses. Use it for tests and examples only. - A value the detectors miss goes through unchanged. The leak check catches the ones it knows about, so pass your own names, addresses and client domains in
knownanddeny. Paranoid mode flags most of the rest for review, but not names in scripts without capitals (Hebrew, Arabic, Chinese, Japanese, Korean), a single unknown word at the start of a sentence or line or right after an opening bracket, quotation mark, dash or bullet, or numbers under five digits. Read the blind copy before you send it. - Colons count as separators in ID leak checks only when the original ID contained one, as in an IPv6 address. This avoids treating
10:00:00as code100000, but an ID reformatted with new colons may go unreported. - A text longer than
maxTextLength(1,048,576 UTF-16 code units by default) is refused with aninput-too-largeerror (C32). Time grows about linearly with the text (C41), so the limit bounds the work of one call. - An amount the model computes from fakes, such as a difference or a total, comes back close but not always exact. Each fake is rounded to the precision it is written in, and
unblinddivides the computed result by the factor, which carries that rounding through. Over 500 seeds, the difference betweenEUR 200andEUR 100came back asEUR 99orEUR 101in 150 of them. A total of many amounts can drift further, since each operand brings its own rounding. A computed amount is listed ininventedunless it equals the fake of an amount in the mapping. Thenunblindrestores that amount's real value and does not list it, even when the model meant a different number. If the mapping also holdsEUR 99, the answerEUR 149 - EUR 75 = EUR 74can come back asEUR 200 - EUR 100 = EUR 99withinventedempty. A negative amount with the minus after a currency code, such asEUR -74, is not read as an amount at all. It comes back unchanged and is not listed, so a computed negative difference can look right when it is not. The same layout in your text,EUR -100, goes out unscaled.-100 €,-€100.00and-$1,234.56are scaled. Check a computed total against your own figures, or usereplaceWith: 'placeholder'when exact totals matter. - A date the model moves by days or weeks maps back exactly, since every date shifts by the same whole number of days. A date it moves by months can come back a few days off, because the months around the fake and the real date differ in length.
25 January 2026blinded to15 February 2026, and the model's one month later,15 March 2026, came back as22 February 2026, listed ininvented. Like an amount, a computed date that equals the fake of a date in the mapping comes back as that date's real value without being listed. A date written without a year is restored in the mapping's reference year, so one the model moves across a year end can come back a day off.10 December, blinded to31 Decemberand moved 60 days to1 March, came back as9 Februaryinstead of8 February. - Bare numbers without a currency are not scaled.
- Typed ids are checked by their rules, so a card number with a wrong Luhn digit or a DNI with the wrong letter is treated as a generic id, or missed when its shape is too weak. A version tag such as
1.2.3.4reads as an IPv4 address and is replaced. - A phone, IBAN or id fake the model writes in another layout (a card number without its spaces, a phone with dashes) is mapped back in that layout when it has eight letters and digits or more. A shorter one is matched only as written, since six digits written
12.03.26could be a date. A phone the model rewrites in another form (07700 900123for+44 7700 900123) is not mapped back. - Dates written without a year can land in the neighbouring year after a shift, since the year is not shown.
- Thresholds in the text ("free shipping over 50") scale with everything else, so they stay consistent with each other, but the real-world meaning of the number is gone.
- Two different amounts never share a fake, so each maps back to itself. To keep them apart a fake can move off the amount times the factor by the smallest unit, a cent or a whole unit, and by a few units when the factor is below 1 and many amounts sit one unit apart. One date written two ways (
1 Junand1 June) can shift onto one string when both land in May, where the short and long names match, so the second spelling gets the same date written another way (11th May) and each comes back as written. Amounts work the same way: an amount written with and without its thousands separator, or with full-width digits, keeps that spelling in its fake (1.234,56 €and1.234,56 €become, say,1.723,45 €and1.723,45 €), and where two spellings would still render alike, such as1.234 €and1234 €both scaled below 1,000, the second gets the same scaled value written another way (864 €and864.00 €), so each comes back as written and sums still add up (C43). - A value written in another letter case keeps its fake in that case (
ONDARA,OndaraandondarabecomeNORVALE,Norvaleandnorvale). A name written with and without its accent, or with a look-alike letter, gets one fake per spelling, so each spelling comes back as written but the model sees two names. - Look-alike letters, full-width digits, accents, combining marks and zero-width characters are folded before matching, so
Вenwith a Cyrillic В still counts asBen. Words written wholly in Cyrillic or Greek go through the same fold, and so does a known value before it is matched, soИванandИВАНstill find each other; a Greekνis read asvonly when no Greek letter without a Latin look-alike stands right beside it, so theνofΓιάννηςstays Greek and matches its capital. Written-out mailboxes with explicit at and dot separators and a recognized suffix are replaced as addresses. Login names after a username label or “log in as” are replaced as IDs. The mapping keeps each value as it was written, sounblindputs the original spelling back, not the folded one. A detector of your own sees the same-length folded text;foldLookalikesis exported so it can fold its own lookups the same way, andknownDetectorso it can keep clear of the known values inDetectContext.known.
Conversations
Pass the mapping from the last call into the next one. Every value seen before keeps its fake, amounts keep the same scale and dates the same shift, and a value from an earlier turn is found again wherever it shows up, even bare (C21). A person or company is found again where it is written with a capital (Will, WILL). All in lower case it is an ordinary word, left as written and not reported: a name blind met once, such as Will Harrow or a sender called Work From Home, is made of words later text is full of (it will work from home). An address, host, phone, id or place from an earlier turn, a name in a script without letter case and a name inside a link are found in any letter case. A name that has to be caught in lower case too belongs in known, which is matched in any letter case on every turn that passes it. The mapping holds only values some text wrote: a known value no text of the call contains gets no pair, so the mapping never carries it, and a later turn finds it only if that turn passes it in known again. Pass your known list on every turn, as below.
let mapping: Mapping | undefined;
async function turn(userText: string): Promise<string> {
const b = blind([userText], { known, mapping });
assertNoLeaks(b);
mapping = b.mapping; // holds every pair so far
const answer = await askTheModel(b.texts[0]);
return unblind(answer, mapping).text;
}So "Sophia Ward [email protected]" in the first message and a plain "Sophia" in the third both become the same fake, and the model can follow the thread.
A lower-case person fake is restored only if that exact spelling appears in the mapping. This keeps ordinary words like holly as written when the mapping only contains the name Holly.
Streaming
createUnblinder takes the answer chunk by chunk. A fake name or amount can arrive split across two chunks, so it holds back the tail of the stream until nothing in it can still be part of a value. The pieces joined are exactly what unblind returns for the whole answer, for any chunking (C22), with two limits. A piece ends only at a space blind's detection keeps (not U+FEFF, which it takes out), never within one holdback (the longest fake plus 8 characters, at least 88) of the end of what has come, and never inside a value, a label, an address that keeps a label, or a stretch the written-out address pattern reads. First, a written-out address with a space in it more than one holdback before its end (meadow-consulting, 100 spaces, then [at] mailbox [dot] example) can be cut at that space before the rest has come, and then a host label in it can come back as the real label where one-shot keeps it, and invented can differ (C60). A push reads the held text again only when a space has come within reach that its last look did not have, and after a look that found no place to end a piece, only once the held text has doubled, so streaming stays linear in the answer; text that comes after such a look can be held until then, up to about twice as much as 0.6.0 held. A space inside a stretch the written-out address pattern reads that is no address (Mara At harlow.org) ends a piece only where no stretch could start after it before the old one ends, and never while the held text holds a host label, which holds back every space of such a stretch. Second, an address that starts inside such a stretch and ends more than one holdback after the space (Mara At harlow.org then 400 characters of .x and [at] mailbox [dot] example) can be listed in invented by the stream where one-shot lists nothing, as 0.6.0 lists it. Text in which every space lies inside a value or an address (4 March 2026- or a at b dot com/ repeated), or in which words are parted only by U+FEFF, is held until end(), still in linear time. It keeps the whole answer in memory until end, because the invented list is worked out over the whole answer so it matches what unblind reports.
const u = createUnblinder(mapping);
for await (const chunk of modelStream) show(u.push(chunk));
const { text, invented } = u.end(); // the rest, and what the whole answer invented
show(text);As a web TransformStream:
function unblindStream(mapping: Mapping): TransformStream<string, string> {
const u = createUnblinder(mapping);
return new TransformStream({
transform: (chunk, out) => out.enqueue(u.push(chunk)),
flush: (out) => out.enqueue(u.end().text),
});
}Fakes, placeholders or random values
replaceWith picks what each value blind finds becomes. The same email in each mode, sender and total lines only:
real From: Sophia Ward <[email protected]>
Total: £1,240.80 (£1,034.00 + 20% VAT), due on 3 March 2026.
fake From: Hilary Brierley <[email protected]>
Total: £802.80 (£669.00 + 20% VAT), due on 23 December 2025.
placeholder From: [REDACTED_PERSON_1] <[REDACTED_EMAIL_1]>
Total: £[REDACTED_AMOUNT_1] (£[REDACTED_AMOUNT_2] + 20% VAT), due on [REDACTED_DATE_1].
random From: Hilary Brierley <[email protected]>
Total: £6,322.90 (£4.29 + 20% VAT), due on 15 December 2026.fake, the default, is what the rest of this README shows. Each fake keeps the kind and shape of its value, amounts keep their relations, dates keep their weekdays, and ids pass their checksums. The service can still do arithmetic. A date it moves by days or weeks maps back exactly, but one it moves by months can come back a few days off. An amount it works out comes back close but not always exact. Both are usually listed ininvented, and Limits says when they are not. What you lose: a fake reads like real data, so nothing in the text shows what was replaced.placeholderwrites[REDACTED_PERSON_1],[REDACTED_EMAIL_1]and so on: the kind in upper case and a number per kind, counted in order of first appearance. One value keeps one placeholder across the texts of a call and across turns (C26). A placeholder already written in the input, such as a text redacted once before, is left alone and its number is never given to a value, in that call or a later turn (the mapping records it inliterals). Placeholder output matches LLM Guard's[REDACTED_PERSON_1]format, so code written against it reads the same. What you lose: everything about a value but its kind. Amounts and dates become placeholders too, so the service cannot add, compare or count days, and a total it works out has no real value to map back to. Each spelling keeps its own token for exact restoration. Theidentitieslegend links related name and email placeholders for the reader, as shown below.randomwrites an unrelated random value of the same kind. Names, companie
