How to Anonymize Take-home Assignments for Blind Grading with Claude or Gemini, Without Breaking the Code
Scrub the record's values with a script, let Claude or Gemini catch the rest, then check by script that nothing leaked and the code still runs.
- Fairer hiring
- Consistent decisions
- Less legal risk
Nov 13, 2026 · 8 min read

About 384,000 people sent a take-home test through Greenhouse between January 2021 and December 2022. When graders could see who they were, Black candidates were 7.4 to 12.4 percent less likely to pass; when grading was anonymous, pass-through rose by about 6.5 to 10 percent overall (Greenhouse's own analysis, regression estimates that show an association, not proof). If graders are remote and work arrives as a file, hiding the author is a cheap fairness step, and it can be automated.
The short answer: replace the values your application record already holds with a script, using letter-only placeholders such as CANDIDATE_NAME. Then run a model pass for what the record can't know, and check by script that no record value is left, the code still parses and the facts graders need survive. Finally, have a non-grader read it once for leftovers like a kept degree. In our test, a model removed all 15 planted details; what went wrong was something else.

What we hid in a 350-word submission
A fictional analyst wrote a churn analysis with a short Python snippet. We planted the details real submissions leak:
| Where it hid | What | How many |
|---|---|---|
| The header | name, email, phone, GitHub handle | 4 |
| Inside the code | the first name, as tomasz_clean() and in the sign-off |
1 |
| A personal aside | the time and time zone it was written, a public holiday, the city, kids and a wife | 4 |
| The bio sentence | school, graduation year, previous employer, years of experience | 4 |
| The numbers and an anecdote | prices in a local currency, a country | 2 |
That is 15 items on our answer key, checked by script. Eight technical facts had to survive (a Wilson interval, a Pearson correlation of 0.41, the churn rates, the code logic), so over-redaction would show.
Round one: ask the model
We gave the raw submission to Claude and Gemini, twice each.
PERSONA
You prepare candidate take-home submissions for blind grading.
TASK
Rewrite the submission below so a grader cannot tell who wrote it, where they live, or their gender, age, schooling or employer, without changing anything about the quality of the work.
CONTEXT
The graders only score the analysis. Placeholders that are already in square brackets, like [NAME], can stay.
RULES
- Replace every identifying detail with a neutral bracket label such as [SCHOOL], [EMPLOYER], [CITY] or [COUNTRY].
- Delete personal asides entirely: family, holidays, the time or day of writing, years of experience, graduation years.
- Replace currency amounts with the same amount in "[CURRENCY]".
- Keep every technical term, formula, data number and line of code logic exactly as it is. Do not fix, improve or add anything.
- If you are unsure whether a detail identifies someone, redact it.
FORMAT
1. The redacted submission only, with nothing before it.
2. Then a line containing only "---", then a count of changes per category (for example "School: 1"). Never repeat the original text of anything you changed.
SUBMISSION
[paste the submission]
This is the prompt we tested. It still names [NAME] and asks for bracket labels, which is a likely reason one run later put brackets back inside the code. By script, all four runs removed all 15 items, kept all eight technical facts and listed only categories in the change log.
What was left was subtler, and Gemini did it in both runs. It kept "an MSc from [SCHOOL] and experience at [EMPLOYER]", which still tells a grader the author has a master's degree and a past employer. It also kept "Customers in [COUNTRY] often compare by monthly cost", a sentence born from the author's personal aside. Claude cut both sentences.
Then the code. Gemini turned def tomasz_clean into def [NAME]_clean, which is not valid Python. Claude renamed the function to candidate_clean, so the code still ran.
Round two: scrub first, with a script
A model reading the raw submission sees the name and email, so do the exact matches first; your application record already holds them. Our script, which we ran:
import re, sys
# What the application record already tells you about this candidate.
RECORD = {
"NAME": ["Tomasz Wierzbicki", "Wierzbicki", "Tomasz"],
"EMAIL": ["[email protected]"],
"PHONE": ["+48 600 123 456"],
"HANDLE": ["tomasz-w-data"],
}
def scrub(text):
pairs = [(v, label) for label, values in RECORD.items() for v in values]
for value, label in sorted(pairs, key=lambda p: len(p[0]), reverse=True): # longest first
text = re.sub(re.escape(value), f"CANDIDATE_{label}", text, flags=re.I) # letters only, never [brackets], or code breaks
return text
if __name__ == "__main__":
print(scrub(open(sys.argv[1]).read()), end="")
Two mistakes of ours taught us the details. Our first version replaced the name before the email, leaving [NAME].[NAME]@mailbox.example with the domain visible, so the script now goes longest first. And our first placeholder was [NAME], which is why the code broke again: every scrubbed run kept [NAME]_clean, and none of those functions parses. With a placeholder made of letters, CANDIDATE_NAME_clean, the code stayed valid in 3 of 4 model runs. In the fourth, Gemini quietly rewrote it back to [NAME]_clean, so the check in step 4 below is not optional.
Claude and Gemini, 2 runs each; one Gemini run of the middle row timed out and is missing. In the last row Gemini once rewrote CANDIDATE_NAME as [NAME].
Source: our test, one made-up submission, checked by script (Python parser)
Show the data
| Yes | Total | |
|---|---|---|
| Model on the raw submission | 2 | 4 |
| Script with [NAME] placeholders, then model | 0 | 3 |
| Script with CANDIDATE_NAME, then model | 3 | 4 |
The script can't find what the record doesn't know: the school, the holiday, the "father of two". That is the model's job.
The pipeline, step by step
- Intake: give every submission a random ID, and keep the ID-to-person table away from graders.
- Script scrub: replace the record values with letter-only placeholders, longest first, or the email domain survives.
- Model pass: the prompt above, in a company-approved account.
- Automatic checks: search the output for every record value (should find none), confirm any code still parses, and confirm your list of required facts is still there.
- Spot read: a person who is not a grader reads the output once for the leftovers the checks can't see: a kept degree or employer label, a rare project name, a writing quirk.
- Grade by ID; reveal names after scoring.
We did not test file metadata (author fields in documents), so ask for plain-text submissions or strip it yourself.
If you see this, do this
| What you see in the output | Do |
|---|---|
[SCHOOL] or [EMPLOYER] kept next to a degree or role |
Delete the sentence, because the label still signals pedigree |
| A record value is still there | Fix the script's list and re-run, never patch by hand |
| A claim that came from a deleted aside | Delete the claim too |
| Code that no longer parses | Use letter-only placeholders, and re-check after the model pass |
| An unusual project name or phrase | Treat it as identifying and redact it |
What this does not give you
Anonymized is not anonymous: a rare project or writing style can still point to a person. We ran one made-up submission a handful of times. The Greenhouse numbers are vendor data, and Greenhouse itself says anonymous take-homes "do not necessarily remove bias by themselves". Whether stripped submissions still count as personal data where you hire goes to your lawyer, and the model pass does send the submission to a third party, so use an approved account.
Next step: if candidates are allowed to use AI on the take-home itself, read whether to allow AI in a take-home coding assignment.
This article is general information, not legal advice. Laws differ by country and change often, so consult your lawyer before you rely on it for your situation.


