All articles
Technical skills

How to Tell a Candidate Their Code Was Flagged for AI Without Accusing Them

Don't forward the flag. Invite them to walk through the code live, admit unclear AI rules, ask what tools they used, and say what happens either way.

  • Better candidate experience
  • Fairer hiring
  • Less legal risk

Sep 2, 2026 · 9 min read

61%. That's how often seven popular AI detectors wrongly flagged essays by non-native English writers as machine-written, in a 2023 Stanford study (Liang and colleagues, 91 TOEFL essays). 89 of the 91 essays were flagged by at least one detector. Those were essays, not code, but the lesson holds: a detector's score is a guess, and it guesses wrong most about people least able to argue back.

So when your assessment platform says a take-home is "87% likely AI-generated", the email you send next matters more than the number.

The short answer: don't forward the flag. Write to the candidate as if nothing has been decided, because nothing has. Invite them to a short live call where they walk an engineer through their code and make one small change. If your instructions never said what AI use was allowed, say so and own it. Ask which tools they used, say plainly that using tools isn't automatically a problem, and tell them what happens if they say yes or no. Agree that last part with the hiring manager first: in our test, AI drafts made it up. Then decide on the call, not the score.

The best email from our test, word for word (Claude, from the prompt below):

Subject: Next step for your take-home: a 45-minute code walkthrough

Hi [ASK RECRUITER: candidate name],

Thank you for your take-home submission. Next, we would like to invite you to a 45-minute video call with [ASK RECRUITER: engineer name]. You will walk through your code so we can understand how you built it, and then make one small change live.

Our instructions said "Please complete this on your own," but they did not say whether tools like AI assistants were allowed. That was unclear, and that is our fault. Before the call, could you tell us in your own words which tools you used, if any? Using tools is not automatically a problem.

The engineer's feedback and the call will decide whether you move to the final interview.

If you would rather not do the call, just reply and tell us. We will close your application, and you are welcome to apply again in 6 months.

Please reply by [ASK RECRUITER: date] with times that work for you, or with any questions.

Best regards,
[ASK RECRUITER: your name]

The case we gave the tools

A made-up mid-level backend candidate sent a small Python REST API, built at home over 3 days. The tool said 87%. The engineer's notes: the code is clean, the comments read like a tutorial, and the error handling is far better than in the earlier live screen. The candidate writes fluent but non-native English. The test instructions said only "Please complete this on your own."

Gemini 3.8 Flash and a blind Claude Opus 5.5 session each wrote the email: three times from a plain one-line request, three times from the prompt below.

Problem: the draft quotes the score

The plain request ("Write the email I should send the candidate to tell them their code was flagged for AI") produced the worst habit in all 3 of Gemini's answers: the email told the candidate their code "was flagged with an 87% likelihood of being AI-generated." A percentage sounds like evidence that nobody can check.

Claude's plain answers kept the number out of every email, but 2 of its 3 main drafts still told the candidate the code "was flagged as possibly AI-generated."

Fix: never put the tool, its name or its number in the email. Your reason for the call is that you want to understand how they built it.

Problem: the draft offers a rejection on the flag alone

Every one of Gemini's 3 plain answers included a ready-made rejection, under headings like "Firm Disqualification": "Because of this flag and our assessment guidelines, we have decided not to move forward with your candidacy at this time." One read: "Use this only if your company treats detector flags as automatic grounds for rejection." A tired recruiter will copy that one.

Answers out of 3 that made each mistake
Gemini, plain request: quoted the 87% to the candidateGemini, plain request: quoted the 87% to the candidate, run 1: made itGemini, plain request: quoted the 87% to the candidate, run 2: made itGemini, plain request: quoted the 87% to the candidate, run 3: made it3 of 3Claude, plain request: quoted the 87% to the candidateClaude, plain request: quoted the 87% to the candidate, run 1: didn'tClaude, plain request: quoted the 87% to the candidate, run 2: didn'tClaude, plain request: quoted the 87% to the candidate, run 3: didn't0 of 3Gemini, plain request: offered a rejection on the flagGemini, plain request: offered a rejection on the flag, run 1: made itGemini, plain request: offered a rejection on the flag, run 2: made itGemini, plain request: offered a rejection on the flag, run 3: made it3 of 3Claude, plain request: offered a rejection on the flagClaude, plain request: offered a rejection on the flag, run 1: didn'tClaude, plain request: offered a rejection on the flag, run 2: didn'tClaude, plain request: offered a rejection on the flag, run 3: didn't0 of 3Gemini, first prompt: invented the 'if you decline' outcomeGemini, first prompt: invented the 'if you decline' outcome, run 1: made itGemini, first prompt: invented the 'if you decline' outcome, run 2: made itGemini, first prompt: invented the 'if you decline' outcome, run 3: made it3 of 3Claude, first prompt: invented the 'if you decline' outcomeClaude, first prompt: invented the 'if you decline' outcome, run 1: didn'tClaude, first prompt: invented the 'if you decline' outcome, run 2: didn'tClaude, first prompt: invented the 'if you decline' outcome, run 3: didn't0 of 3made itdidn't

Source: our test, Gemini 3.8 Flash and Claude Opus 5.5, counted by script

Show the data
made itTotal
Gemini, plain request: quoted the 87% to the candidate33
Claude, plain request: quoted the 87% to the candidate03
Gemini, plain request: offered a rejection on the flag33
Claude, plain request: offered a rejection on the flag03
Gemini, first prompt: invented the 'if you decline' outcome33
Claude, first prompt: invented the 'if you decline' outcome03

Fix: a flag is a reason to look closer, never the decision. A person decides, after the live call.

Problem: the email invents what happens next

With the full prompt, which said to write [ASK RECRUITER] for any missing fact, Claude left the "if you decline" outcome as [ASK RECRUITER] in all 3 runs. Gemini filled it in all 3 times, with three different inventions: "Declining will conclude your application", "we will withdraw your application", and "without affecting any future opportunities with us." None of these came from us.

Fix: decide the "if you decline" answer with the hiring manager before the email goes out, and put it in the prompt. We added two lines for it, plus a rule against saying anything flagged the code, and ran both tools 3 more times: all 6 emails used our outcome wording and none mentioned a flag. Two Gemini emails still praised the "thorough error handling", the detail in question.

Problem: the email still sounds suspicious

Good drafts still leaked doubt. One of Gemini's prompted emails kept "an automated check flagged potential AI assistance", even though the prompt said not to suggest any conclusion. One of Claude's opened with "Our review raised some questions about how the code was built", which is polite and still reads as "we think you cheated."

Fix: lead with the next step and why it helps you both. The best line in the test came from Claude: "We haven't made any decision yet."

The prompt that fixed most of it

PERSONA
You are a senior technical recruiter who writes calm, respectful emails to candidates. You never accuse anyone of cheating.

TASK
Write an email to a candidate whose take-home coding test was flagged by our assessment tool as possibly AI-generated. The goal is a fair next step, not a verdict.

CONTEXT
- Role: [role]. The test: [what it was, how long they had].
- What our test instructions said about AI: "[exact words]"
- What the tool reported: "[result]". We do not know how the tool decides, and it can be wrong.
- What the reviewing engineer noticed: [observations]
- [Anything else relevant, for example: The candidate's English in emails is fluent but non-native.]
- Our next step: [for example, a 45-minute video call where the candidate walks one of our engineers through the code and makes one small change live]
- If they do the call: [what happens next]
- If they decline the call: [what happens to the application]

Rules:
- Do not mention the percentage, the tool's name or the words "cheat", "dishonest", "violation" or "detected".
- Do not say that anything flagged the submission.
- Do not say or suggest we have concluded anything. Say what we will do next and why.
- Admit that our instructions about AI were not clear, if they were not.
- Ask the candidate to tell us, in their own words, which tools they used, if any, and say that using tools is not automatically a problem.
- Give a clear way to say no or ask questions, and say what happens to their application either way.
- If a fact you need is missing, write [ASK RECRUITER] instead of inventing it.

FORMAT
Subject line, then an email under 180 words. Then, separately, a list of 3 things the recruiter must NOT say on the follow-up call.

With our scenario filled in, all 6 first-round emails admitted the instructions were unclear; Claude wrote "That wasn't clear, and that's our fault." In the "must not say" lists, Claude warned in all 3 runs that comparing the code comments to the candidate's English is unfair to a non-native speaker. Gemini raised it once.

Maya unrolling a teal blueprint on a table, ready to walk through it together

Before you hit send

  • Agree the outcome first. What happens if they decline, and what happens after the call, comes from you, not the draft.
  • The call is the test. Ask "why did you handle this error this way?", not "did you write this?" People code differently with 3 days at home than in a timed live screen.
  • Don't judge the code by their English. Never compare their code comments with their emails.
  • Same process for everyone flagged. If one flagged candidate gets a call, all of them do.
  • Fix the instructions for next time. Say exactly what AI use is allowed in the test.
  • The law. Rejecting someone on a detector score alone can carry legal risk in some places. Treat this as a pointer, not legal advice, and check with your lawyer for each country you hire in.

Next step: if you're not an engineer, these interview questions work without knowing the stack, and for CVs that look too polished, use these checks instead of a detector.

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.

Keep reading