Skip to content
CodeLifter
Search/ Browse prompts
CodeLifter Forum

A detector flagged code written in 2019 as AI. What now?

Staff answerWritten by CodeLifter editors · Code provenance2 repliesupdated

Short answer

Treat the score as a claim, not a finding, and answer it with records made at the time. Published research says AI code detectors perform poorly on source code, so the useful evidence is your commit history, release archives and anything a third party stored with a date in 2019. Collect those and ask what the reviewer needs.

Written by CodeLifter editors · Staff, CodeLifter ·
CiteCodeLifter Forum, "A detector flagged code written in 2019 as AI. What now?", https://codelifter.com/forum/posts/a-detector-flagged-code-written-in-2019-as-ai-what-now/, accessed 2026-11-12.
  1. Staff, CodeLifter ·

    Why the score is weak evidence

    A detector reads a snippet and returns a number that estimates whether a model wrote it. It does not know when the file was written, who typed it, or what it was copied from. The research on code is not kind to these tools:

    • In a 2024 study, Suh and colleagues tested existing AI detection tools on source code and reported that "they all perform poorly and lack sufficient generalizability to be practically deployed". Their own best model reached an F1 score of 82.55, which still means errors in both directions.
    • The 2025 DroidCollection paper, built on more than a million samples in seven languages from 43 models, found that existing detectors fail to generalise to coding domains and languages outside their training data.
    • Watermarks do not help with old code. A watermark exists only if the generating tool embedded one, and Lee and colleagues found standard text watermarks fail on code because code has low entropy. A missing watermark proves nothing either way.

    None of the papers explains why a particular 2019 file scored high, and you should not guess on the reviewer's behalf. Short, conventional code written the way tutorials teach it is the kind of input where a classifier has little to go on, but that is a reason for caution, not a measurement. The CodeLifter page on whether you can tell if AI wrote code goes through each method and its limits.

    What to collect

    You are building a timeline. The strongest items are ones somebody other than you recorded, at the time.

    Evidence Who recorded it What it shows How much weight it carries
    Commit history with author and committer dates Your Git client, then the server you pushed to Which lines existed on which date, and who committed them Good, especially when the repository was pushed to a hosted service in 2019
    A tagged release or published package from 2019 The registry or hosting service That a version containing the code was public on that date Strong: a third party stored the file and the date
    An archived copy of a project page or README The archive service That the page existed, sometimes with the code visible Strong for what it shows, often partial
    Issue tracker threads, pull requests, code review comments The hosting service Discussion of the code while it was being written Good context, and hard to produce later
    Coursework submission receipts, emails with attachments The school system or mail server That you handed in or sent the file on a date Good, if you still have the original message
    Your own memory of writing it You Nothing a reviewer can check Useful only alongside the items above

    Steps to pull the record from Git

    1. Find the file's history. In the repository, run git log --format='%h %an %ad | %cn %cd' -- path/to/file.js. That prints each commit's short hash, author and author date, then committer and committer date. The Pro Git book explains the difference: "The author is the person who originally wrote the work, whereas the committer is the person who last applied the work."
    2. Find when a specific function first appeared. Run git log -S functionName --format='%h %an %ad' -- path/to/file.js. The -S option shows only commits that changed the number of occurrences of that string, so the oldest result is usually where it arrived.
    3. Show the exact lines from that commit. Run git show <commit> -- path/to/file.js and save the output.
    4. Narrow to the year if the history is long: git log --since=2019-01-01 --until=2019-12-31 -- path/to/file.js.
    5. Link the same commits on the hosting service if the repository was public or shared. A commit page on the service is easier for a reviewer to open than a pasted log, and it shows the service holding the same hash.

    A commit date is written by the machine that made the commit, so on its own it is your statement about time. That is why the third-party items in the table matter: a 2019 release, a pushed branch, or a submission receipt is harder to dispute than a local log.

    What to write back

    Keep the reply short and factual. Something like this works for a course, a client or a project reviewer:

    1. Name the file and the claim: which detector, which score, on what date.
    2. Give the timeline: first commit hash and date, the release or submission that contained it, and links.
    3. Quote the research in one line, with the link, so the reviewer can see the tool's limits for themselves.
    4. Offer to walk through the code. Explaining why each part is there is direct evidence of authorship that a score cannot give.
    5. Ask what decision the reviewer is making and what would satisfy them. A school may need a meeting; an open source project may only need a statement in the pull request.

    Do not rewrite the code to lower the score. A rewritten file loses its link to the 2019 history, which is your best evidence.

    If the code was partly copied

    Old code often includes pieces from a forum answer, a library example or a tutorial. If the flagged part came from somewhere else, say so and link the source, with its licence. That is a provenance question rather than an AI question, and the thread on what a provenance record for copied code should include covers the fields. For code written now, the broader question of proof is in can you prove you wrote a piece of code yourself.

    Going forward

    Make the record as you work rather than reconstructing it later. Commit often with messages that say what changed, push to a remote, and when an assistant helps, say so in a trailer. A team that wants that line on every commit can follow the thread on enforcing an Assisted-by trailer. A history like that answers the next detector score in a few minutes.

    0
    ReplyLink

Plain text or simple Markdown. Links are nofollow. Your email is never shown.

  1. CodeLifter editorsStaffStaff, CodeLifter ·

    Are general AI text detectors like GPTZero any good on code? The published evidence says they are the wrong tool. A 2023 study, Is this Snippet Written by ChatGPT?, built a code-specific classifier called GPTSniffer on top of CodeBERT, a model pretrained on source code. The authors report that it outperformed two text detectors used as baselines, GPTZero and the OpenAI Text Classifier, on telling human-written from AI-generated code. The same abstract adds a caution: performance improved with similar training data, or when the classifier compared paired snippets. That is a reason for doubt about any score on your file, because a 2019 hobby project is unlikely to look like the training data of a detector built years later. The 2024 Suh study cited in the opening post makes the general point: existing tools perform poorly on code and do not generalise. So if the flag came from a general text detector, say so in your reply and link this paper next to the others. If it came from a code-specific tool, ask which one and what it was trained on. Neither answer changes the main advice here: dated records from 2019 outweigh any classifier output.

  2. CodeLifter editorsStaffStaff, CodeLifter ·

    Can an archive prove when code was published? It can show the latest date by which an archive held a copy, which is often enough. For source code the most direct option is Software Heritage, a public archive of software source. Its guide to saving and referencing software says you submit a public repository's clone URL on the "save code now" page, choosing Git, Mercurial or Subversion, with no account needed, and the archive stores the repository with its full development history. For forges it already knows, that takes a few hours. Each archived object gets a SWHID, an intrinsic identifier; the guide says version 1 uses Git-compatible hashes, so a commit's SWHID is swh:1:rev: followed by the commit hash. A lines= qualifier can point at specific lines in one file. Two cautions for a 2019 dispute. Archiving the repository today records that the history existed today, not that the commits are as old as their dates; it is a defence for the future, not a time machine. For the past, look for copies made at the time: a release on a registry, a pushed branch, or an archived web page from 2019. Start the archive habit now, as the opening post's last section suggests.

CodeLifter

Reviewed vibe coding prompts, the JavaScript each one should produce, and sourced answers on AI-generated code: who wrote it, who owns it, and whether you can ship it. Free since 1999.

Browse the Prompt Shelf

Popular topics

© 1999 to 2026 CodeLifter

Independent. No ties to any software vendor.
Code MIT Text CC-BY-4.0 Back to top