Give the task less personal detail.
A support-note rewrite usually needs the problem and the useful context. A customer's email can be irrelevant. Before pasting a note into an AI tool, ask which details the task actually needs and whether that tool is approved for the data.
Today's lab uses Presidio, an open-source project for detecting and transforming sensitive information. We use only its Anonymizer component to replace explicitly selected spans. No automatic detector or language model runs in this exercise.
The project is transitioning from Microsoft ownership to community governance under Data Privacy Stack. The guide follows the current documentation location. This is a practical exercise with an existing tool, not a new-release announcement.
Practice with fictional text. Replacing a name does not establish anonymity, approval to upload, or compliance. Context can still identify someone. For real work, follow your organization's data rules and use its approved environment.
Download the small, readable lab.
You need Python 3.13 and PowerShell for these Windows commands. We ran Python 3.13.15 with presidio-anonymizer==2.2.364. Get Python from its official download page if needed. The pinned package release lists Python 3.10 through 3.14 as supported; other versions and operating systems were not tested here.
Use a new working folder. Download and extract the practice ZIP, then read the files before execution:
Invoke-WebRequest -Uri 'https://jabsystems.io/ai-anonymous/Social/replace-before-prompt-exercise.zip' -OutFile .\replace-before-prompt-exercise.zip
Expand-Archive -LiteralPath .\replace-before-prompt-exercise.zip -DestinationPath .\presidio-lab
Set-Location .\presidio-lab
Get-Content -LiteralPath .\presidio-readme.txt
Get-Content -LiteralPath .\replace_identifiers.pyCreate a local package environment and install the pinned Anonymizer. Calling the environment's Python directly avoids changing PowerShell's activation policy:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install presidio-anonymizer==2.2.364
.\.venv\Scripts\python.exe .\replace_identifiers.pyInstallation downloads packages. The example contains no AI API calls or automatic analyzer and needs no model weights or credentials. A virtual environment separates packages; it is not a security sandbox. Transitive dependencies are not fully locked, and we did not audit network isolation.
Separate finding text from replacing it.
The Anonymizer API takes text, spans, and operators. A span describes the start and end of a selected substring. An operator says what to do with it. The official tutorial shows how supplied spans can be transformed without running an analyzer.
Our helper finds every exact, case-sensitive occurrence of two values we wrote into the fixture: Alex Morgan and alex@example.com. It labels those spans, then calls this code from the downloadable source:
operators = {
"PERSON": OperatorConfig("replace", {"new_value": "[PERSON]"}),
"EMAIL_ADDRESS": OperatorConfig("replace", {"new_value": "[EMAIL]"}),
}
result = AnonymizerEngine().anonymize(
text=text, analyzer_results=spans, operators=operators
)The span score 1.0 in the file marks an authored fixture, not measured confidence. The helper is a teaching convenience for known, non-overlapping values. It is not a general detector, and changing capitalization can bypass its exact match. Replacement also collapses different people to the same [PERSON] label, so it does not preserve who is who in a larger conversation.
Read the output, including the misses.
The fictional input is:
Alex Morgan (alex@example.com) reports that the export button fails. Reply to alex@example.com. Internal case: HARBOR-417.We actually ran four cases locally. Their complete results are saved in the observed JSON. Every case exits 0: the program demonstrates transformations; it does not decide whether text is safe to share.
- Selected values: 3 supplied spans and 3 replacements. One name and both email occurrences are replaced.
- Omitted email: only the name is supplied. There is 1 replacement; both email occurrences remain.
- No spans: 0 replacements. The original input is returned unchanged.
- Case variant:
ALEX MORGANdoes not matchAlex Morgan. There are 0 replacements.
The first case produces:
[PERSON] ([EMAIL]) reports that the export button fails. Reply to [EMAIL]. Internal case: HARBOR-417.Notice HARBOR-417. It survives because we did not select it. In a real organization, an internal case ID or surrounding detail might link back to a person. The problem statement survives too, which lets us remove more context without losing the purpose of this fictional task.
These checks establish exact replacement behavior on authored fixtures. They measure neither detection recall nor privacy protection on real documents. Presidio's own documentation warns that automatic detection cannot guarantee finding every sensitive detail; this exercise does not run automatic detection at all.
Review what remains before any prompt.
Read the transformed note as if you already knew the project. Could an internal ID, unusual incident, location, date, or combination of facts identify someone? Remove whole sentences when the task does not need them. Do not rely on the appearance of a placeholder as a pass signal.
- Confirm that every intended occurrence changed, including repeated names and contact details.
- Check aliases, capitalization, account IDs, links, signatures, and contextual clues separately.
- Keep enough technical context to ask useful questions; remove irrelevant personal details.
- Check whether the destination and the remaining data are approved for this use.
For our fictional troubleshooting-question task, a manually minimized note is enough:
[PERSON] reports that the export button fails.This second edit is a human choice, not something the published script infers. A production pipeline needs a policy, representative evaluation, and appropriate review. Logging original text or keeping a name-to-placeholder mapping can create additional exposure. The lab prints its original fixture only because all of it is fictional.
Use the minimized note for a narrow request.
If you want to explore the next step, use only fictional or otherwise approved input in an approved AI tool. This proposed prompt is included as a text download:
Fictional note:
[PERSON] reports that the export button fails.
Draft three troubleshooting questions using only this note.
Ask for missing technical context. Do not invent a cause,
resolution, identity, or case number. Keep placeholders unchanged.
A human will review the draft before use.Review any generated questions for unsupported assumptions before using them. We did not run or evaluate this AI prompt. The tested part is the local text replacement and its visible limits, not model quality, speed, savings, anonymity, real-data safety, or a production privacy system.
The original poster is AI-generated conceptual artwork, not a screenshot or test result. The fictional email remaining on the illustrated paper represents the input; use the actual JSON above to assess what the program changed.
Keep the guide and downloads together.
Primary sources reviewed October 17, 2026: Presidio overview and detection warning, Anonymizer API, simple anonymization tutorial, project transition notice, pinned package metadata, Python virtual environments, and Python downloads.
Practice ZIP · Full Python source · README · Actual outputs · Original graphic · Caption · Alt text · Article URL · Posting ZIP
Manual social delivery: the posting ZIP contains the graphic, intentionally incomplete teaser, alt text, and full article URL for you to post. Nothing is scheduled or published to social media, and no Instagram profile-link change is claimed.
