How to redact a Social Security number before using AI
· Updated
![A payroll prompt without the SSN Fictional payroll question to an AI chat with the Social Security number already replaced by the placeholder [SSN_1]](/guias/en-us/redact-social-security-number-payroll-chat.webp)
Joaquín Trapero in AI and privacy expert, and founder of Nonimo.
In a document, a Social Security number rarely looks like a card. It’s a payroll column, a line on an intake form, a page deep in a court exhibit. Card copies are a separate job, covered by the Social Security card watermark. This page is about the nine digits inside text.
A 2024 Federal Judicial Center study found 22,391 unredacted SSNs in sampled PACER documents, about half of them inside bank statements, payroll records and similar papers. People hand those files to chatbots for summaries. Of all the personal information to remove before AI, the SSN has the least excuse for being there.
Before a file or prompt reaches an AI tool, replace all nine digits with a placeholder like [SSN_1]. Keeping the last four is a court convention for public filings, and a pending civil and criminal proposal would end even that. In a prompt, four digits point to one person, and no answer needs them.
Where Social Security numbers hide in documents and exports
The SSN rarely sits in the body of a letter. It turns up in fields, columns and attachments that nobody reads line by line before pasting. Payroll records are the obvious ones, but the files below carry it just as often and get much less suspicion.
Files that usually carry an SSN, and where it sits
| File | Where the SSN sits | How to clean that format |
|---|---|---|
| Payroll or HR export | Its own column, often without dashes; a spreadsheet that treats it as a number drops a leading zero | Masking a CSV column |
| Benefits enrollment file | The employee's number plus every spouse and dependent on the plan | Redacting an Excel sheet |
| Onboarding packet with ID copies | Scans of a license or passport next to the SSN field | Marking a license copy, a passport copy, or redacting the passport |
| Patient intake form | The identity block at the top; older forms still ask for it | Nonimo for healthcare |
| Scan of an old Medicare card | Cards before the switch to the MBI printed an SSN-based claim number | HIPAA and AI tools |
| Loan, lease or account application | The applicant section, sometimes a co-signer too | Rental applications |
| Insurance application or claim file | Claimant details, and often the email subject line | Nonimo for insurance agencies |
| Credit report or bank paperwork | The header or the identity section | Redacting a PDF properly |
| Court exhibit | Attached financial records that were never redacted | Nonimo for law firms |
| City or county case file | Benefits and payroll records inside a larger file | AI and public records |
| Word or PowerPoint version of any of these | Headers, comments, hidden slides, speaker notes | Word or PowerPoint |
Rows are our own list. The Medicare row comes from CMS, which replaced SSN-based claim numbers with the Medicare Beneficiary Identifier; the court row from the FJC findings cited below.
The payroll export is the row I trust least. Nobody types it, nobody reads it, and it carries hundreds of numbers at once. A dropped leading zero also makes an SSN eight digits long, so a search for the usual nine-digit pattern can walk right past it.
Scans are their own problem. A photo of a form is an image, and an image of an SSN is still an SSN; once uploaded, it can stay with the provider longer than the chat, as the guide on ChatGPT and stored images explains.
The last-four rule in court filings: Rule 5.2 and Bankruptcy Rule 9037
The “last four digits” convention people search for comes from the federal courts. Under Civil Rule 5.2, Criminal Rule 49.1 and Bankruptcy Rule 9037, a public filing may show only the last four digits of an SSN, along with a few other trimmed identifiers. PACER’s public records follow from those rules.
What each federal rule lets a filing keep
Last four digits of an SSN or taxpayer ID, the year of birth, a minor's initials, the last four digits of a financial account.
Filing your own number unredacted and not under seal waives the protection for it. A redacted filing can carry an unredacted copy under seal.
The same four items, plus only the city and state of a home address.
The same four items as the civil rule. Exempt, among others: the record of an administrative or agency proceeding unless filed with a proof of claim, and the official record of a state-court proceeding.
A motion to redact a document already filed makes the court restrict access to it while the motion is pending.
Benefit appeals are exempt from the redaction list. Instead, remote electronic access is limited: parties and their lawyers see the whole file, everyone else sees the docket and the court's orders online and goes to the courthouse for the rest.
Civil and criminal filings would redact SSNs and ITINs completely, plus EINs and adoption taxpayer IDs. Bankruptcy would keep the last four. All three rules would say plainly that exhibits and attachments are covered.
Public comment runs to February 15, 2027. Until the rulemaking finishes, the current rules apply.
Fed. R. Civ. P. 5.2, Fed. R. Crim. P. 49.1, Fed. R. Bankr. P. 9037, and the Judicial Conference's September 2026 report on the privacy rules.
For a litigation team, the proposal is the most useful part of this. The judiciary’s own report says most unredacted SSNs in public filings appear in exhibits and attachments, the papers that originate outside the case. A paralegal who trims the brief and attaches the bank statement whole has followed half the rule.
None of this governs a chatbot. Rule 5.2 decides what the public reads on a docket; what a privileged draft may hold before AI touches it is covered in whether redacting protects privilege. This is my reading of the rule text, not advice on your case, and local rules settle the rest.
Is it safe to share the last four digits of your SSN?
Safe enough for the person who has to verify you, and nobody else. Institutions treat the last four as the secret part, which is why phone menus and sign-in pages ask for them. NIST’s guide on personal data says partial SSN digits are often PII themselves, being nearly unique and linkable.
For older numbers, the first five digits aren’t much of a secret either. From 1972 until June 25, 2011, the area number followed the state on the application’s mailing address, and group numbers went out in a known order. Carnegie Mellon researchers used that, plus birth date and state, to predict them.
First five digits predicted on the first try
With those predicted, the last four are the only part left to find.
Acquisti and Gross, Carnegie Mellon (2009), tested on the SSA Death Master File. The same work found the full number in fewer than 1,000 attempts for 8.5% of people born after 1988.
SSA’s randomization ended that pattern for new numbers: area numbers no longer stand for a state, and 000, 666 and 900 to 999 are never assigned. Most adults got their number before 2011, though. SSA’s randomization page on ssa.gov sets out what changed.
So “xxx-xx-3391” beside a name and a birth date gives a careful attacker most of a number. I wouldn’t call a prompt with the last four in it redacted. New York’s SSN statute agrees in its way, covering any number derived from the SSN; PII, PHI and sensitive personal information maps the other state categories.
Truncation or placeholder: what a redacted SSN should look like for AI
Truncation keeps four digits so a human reader can match a record. An AI tool has no record to match, so the four digits buy nothing and still carry risk. A placeholder tells the model an SSN stood there, keeps two people apart, and contains no part of either number.
One payroll line, five ways to send it
Fictional employee and number. The 000 area is never assigned.
Delphine Arbuckle, hygienist, SSN 000-84-3391
The whole number travels, along with the name it belongs to.
Delphine Arbuckle, hygienist, SSN xxx-xx-3391
Fine on a court docket. In a prompt, the four digits a bank asks for sit right next to the name.
Delphine Arbuckle, hygienist, SSN 000-84-3391
The box covers the picture of the page. A tool that reads the PDF's text layer gets every digit.
Delphine Arbuckle, hygienist, ID EMP-3391
A label built from the number hands the last four straight back. HIPAA forbids exactly this for re-identification codes.
[PERSON_1], hygienist, SSN [SSN_1]
No digits. A second employee becomes [SSN_2], and the list that maps both back stays on your computer, as our security page explains.
The code rule is 45 CFR 164.514(c)(1): a re-identification code may not be derived from information about the individual.
The placeholder asks for one thing: consistency. If Delphine is [SSN_1] in one message, she stays [SSN_1] in the next, or the model sees two people. Numbering in order of appearance, never reusing one, is the simplest scheme I know. Portkey’s PII redaction numbers placeholders but keeps no lookup list at all.
Others only detect. Lakera Guard lists US Social Security numbers among its built-in data types, so an app can block a prompt that contains one. Blocking is fine for a developer’s API call; for an office worker with a deadline, a placeholder that keeps the sentence usable gets used, and a block gets worked around.
One limit: whoever holds the lookup list can turn [SSN_1] back into nine digits, so that list now needs the care the SSNs had. Which word fits the result in a contract is covered in deidentified and anonymized data.
Finding every SSN format before you upload a file
A search for ”###-##-####” finds the tidy cases and misses the rest. The same number can appear with dashes, with spaces, as nine bare digits, as eight digits after a spreadsheet ate the zero, or as a phrase like “ending in 3391”. Tick what you’ve checked in the copy you’re about to send.
0 of 7 checked
Keep going. A file with one unchecked hiding place is a file you can't vouch for.
Now replace what you found with placeholders, one per person, and read the result once more as text.
The file name is the item people skip, and I’d rename the copy before touching anything inside it. A name like “Arbuckle_3391_payroll.pdf” is common in payroll folders, and it travels with every upload. The rest of the file’s hidden fields are covered in removing metadata from PDF and Word.
When the Nonimo app processes text, an SSN gets a label even when it’s already truncated, written as XXX-XX-3391 or as “ending in 3391”, and an ITIN gets its own label, [ITIN_1], so the model can tell the two kinds of number apart without seeing either.
Deleting an SSN you already pasted into ChatGPT, Claude or Gemini
It happens, usually because a whole form went in when one figure was needed. Deleting the conversation is the right first move, but it isn’t instant and it isn’t complete everywhere. Each vendor’s own controls decide what’s left.
What deleting the chat does, by tool
| Tool | After you delete the chat | What can stay behind |
|---|---|---|
| ChatGPT | Gone from your account at once; permanently deleted from OpenAI's systems within 30 days, unless it was already de-identified or must be kept for security or legal reasons | Files saved to your Library stay until you delete them there. Saved memories are separate too: deleting ChatGPT history fully |
| Claude (consumer plans) | Gone from your history at once; deleted from back-end storage within 30 days | If you allowed model improvement, chats may be kept de-identified for up to 5 years; a deleted chat isn't used in future training. See whether Claude trains on your data |
| Gemini | Depends on your activity settings and account type | What Gemini keeps |
| Microsoft Copilot | Depends on the consumer or work version you used | What Copilot does with prompts |
OpenAI Help Center, chat and file retention (read via an Internet Archive copy of July 2026); Anthropic Privacy Center, updated July 1, 2026. Business plans follow their own retention terms.
What I wouldn’t do is assume the deletion button closed the matter. Thirty days is a deletion schedule with exceptions written into each policy, so plan as if a copy exists until that window ends. For the wider picture of what these companies keep, start with what OpenAI does with your chats.
If the slip came from software rather than a person, say an app sending whole records to a model’s API, deletion buttons don’t apply. That fix lives in the app: send less and swap identifiers before the call.
For teams building those apps, the Nonimo Gateway makes the same placeholder swap on their own server before a request reaches the model.
Someone’s SSN got out: identity theft steps and breach questions
Your own number and a client’s number lead to different next steps. One is consumer protection, handled through the FTC’s steps; the other may be a privacy incident for your business. Answer the first question and follow the path.
Whose number went into the chat?
Is it your own SSN?
Has anything been opened or filed in your name that you don't recognize?
Is your business covered by HIPAA, the FTC Safeguards Rule or a state breach law?
FTC, IdentityTheft.gov guidance on lost or exposed information, and 16 CFR 314.4(j). State laws differ: see Connecticut's sensitive-data rules, for one. Whether a paste into an AI vendor counts as a notification event is a question for your lawyer.
I wouldn’t spend time chasing a brand-new Social Security number. The FTC notes you usually can’t get one without evidence of misuse, and a new number doesn’t cut the links agencies already hold to the old one. The free freeze does more, faster, which is why it’s first on IdentityTheft.gov.
For a business, the harder question is whether state law calls it a breach. That turns on the state, the data and whether the provider counts as an unauthorized party, worked through in our guide on client data in chatbots.
Texas runs a shorter clock for its attorney general than for the people affected, set out in the Texas privacy and AI guide, while Connecticut now lists an SSN as sensitive data. Read this section as a map of whom to ask; your own duty to notify is a call for counsel.
![The last four, replaced too The last four digits of an SSN, shown as XXX-XX-0000, replaced by [SSN_2], since four digits still point to one person](/guias/en-us/social-security-number-last-four-tag.webp)
One rule for the courthouse, another for the chat window
Two conventions, two readers. A docket needs four digits so a clerk can match a record, and even that is now under review for civil and criminal cases. A chatbot needs none, so the whole number comes out, in every format, before the text leaves your computer.
Public court filing
- Last four only, under Rules 5.2, 49.1 and 9037
- Exhibits and attachments too
- Full number, if needed, under seal
AI prompt or upload
- All nine digits out
- [SSN_1], [SSN_2], one per person
- The lookup list stays on your machine
- One line in a written AI policy
An office does this dozens of times a day, so it can’t rest on memory. Clients should hear about it as well, and the AI disclosure language for engagement letters gives wording that matches what the office actually does.
Some desks feel it more than others. In CPA firms nearly every file carries an SSN, so the right-hand column above is the one I’d tape beside every monitor.
If that’s your desk, Nonimo’s app for Mac and Windows swaps SSNs, names and account numbers for placeholders on your own computer before anything reaches the AI, and puts the original values back in the answer.
Sources
- Fed. R. Civ. P. 5.2 and Fed. R. Bankr. P. 9037. What a filing may keep, exemptions, waiver, remote access in Social Security appeals. Criminal Rule 49.1 read on the same site. law.cornell.edu and Rule 9037
- Judicial Conference, 2026 report on the privacy rules (September 2026) and proposed amendments published for comment. FJC count of 22,391 unredacted SSNs, financial papers as about half of the documents holding them; full-redaction proposal; comment period to February 15, 2027. uscourts.gov and comment page
- SSA, Social Security Number Randomization. June 25, 2011; area numbers by state from 1972; 000, 666 and 900 to 999 excluded. ssa.gov
- Acquisti and Gross, “I Just Found 10 Million SSNs” (2009), companion to their PNAS paper. 90%, 44%, 2% and 8.5%. blackhat.com
- NIST SP 800-122. Footnote 21: partial SSN digits are often PII. nist.gov
- 45 CFR 164.514 and 16 CFR 314.4. Re-identification codes not derived from the individual; FTC notice within 30 days for 500 or more consumers. ecfr.gov and section 314.4
- CMS, New Medicare Card. SSN-based claim numbers replaced by the MBI. cms.gov
- New York General Business Law 399-ddd. Any number derived from the SSN. nysenate.gov
- OpenAI Help Center, chat and file retention (read via an Internet Archive copy of July 20, 2026). Deletion within 30 days; Library files kept separately. openai.com
- Anthropic Privacy Center, How long do you store my data? (July 1, 2026). Back-end deletion within 30 days; training retention. privacy.claude.com
- FTC, IdentityTheft.gov, When information is lost or exposed (checked through a summary by a search engine). Free freeze and fraud alert, earnings record check, E-Verify lock, new numbers. identitytheft.gov
Checked on November 7, 2026.
Common questions
Is putting black over text the same as redacting it?
No. A black shape drawn on a PDF usually sits over digits that are still in the text layer. Select, copy and paste, and the number comes back. Redacting means the characters are deleted from the file.
How do you redact numbers in a PDF?
Use a redaction tool that deletes the text, then save a new copy. Search that copy for the number with and without dashes, and paste a page into a plain text editor to confirm nothing returns.
Is it safe to give the last four digits of your Social Security number?
It's often requested, but it's never anonymous. Banks and agencies use those four digits to confirm who you are, so treat them like half a password and give them only to someone who has to verify you.
What is a redacted Social Security number?
One with some or all of its digits removed. Federal court filings keep only the last four, as in xxx-xx-3391. In a prompt for an AI tool, all nine should go and a placeholder takes their place.
What are the federal rules for redacting personal information in court filings?
Civil Rule 5.2, Criminal Rule 49.1 and Bankruptcy Rule 9037. Filings may show only the last four SSN digits, the birth year, a minor's initials and the last four digits of an account number.
I accidentally put my SSN in ChatGPT. What now?
Delete the chat, then any copy of the file in your Library. OpenAI says deleted chats are permanently deleted within 30 days, with legal and security exceptions. A free credit freeze covers what deletion can't.
Is it safe to put your SSN in ChatGPT?
No, and no answer you need depends on it. A chat sits in your history, and after you delete it the provider can take up to 30 days to erase it. Type a placeholder such as [SSN_1] instead.