An AI use statement for code explains whether and how you used an AI tool while creating or revising source code.

A clear statement can make your process easier to review, especially when the rules differ between a class, workplace, open-source project, or publication.

What is an AI use statement for code?

An AI use statement is a short disclosure of the role an AI system played in producing a code artifact.

Depending on the context, that artifact might be a script, application, notebook, configuration file, test suite, or code sample.

The statement should help a reader understand the extent of the assistance.

For example, it can say whether AI helped brainstorm an approach, generated a function, suggested edits, explained an error, or produced tests.

It should also identify what you reviewed, changed, and verified yourself, when those details are relevant.

There is no single universal format.

Follow the instructions from the organization or person requesting the work.

If no format is specified, use plain language and include enough detail to describe the tool’s role without implying that the tool can take responsibility for the final code.

What should the statement include?

A useful disclosure is specific enough to be informative and concise enough to read quickly.

Consider including these details:

  • Tool: Name the AI tool or service if the applicable instructions ask for it.

    If you do not know the exact model or version, do not guess.
  • Purpose: Describe what you used it for, such as generating a draft, explaining an error message, suggesting a refactor, or proposing test cases.
  • Scope: Identify the affected files, functions, or sections when that information helps reviewers understand the contribution.
  • Your work: Summarize how you reviewed, edited, tested, or rejected suggestions.

    Only describe steps you actually took.
  • Verification limits: State any important checks that remain incomplete, if the reader needs to know them.

Keep the wording factual. “AI generated the initial draft of the input-validation function; I revised it and reviewed the tests” is more useful than “AI helped with the code.” Avoid claiming that code is secure, correct, or fully tested unless you have evidence for that claim.

How to write the statement step by step

  1. Check the applicable rules. Look at the assignment instructions, employer guidance, repository contribution policy, or publication requirements.

    Rules may differ, including what tools must be named and where disclosures belong.
  2. Write down what happened. Record which parts of the process involved AI while the work is fresh.

    Distinguish suggestions you used from suggestions you discarded.
  3. Describe the scope plainly. Say whether assistance covered planning, a small snippet, a larger section, documentation, debugging, or testing.

    Avoid vague descriptions such as “AI was involved.”
  4. Describe your review accurately. Mention only the checks you performed, such as reading the generated code, running specified tests, or checking behavior against requirements.

    Do not suggest that a review guarantees correctness.
  5. Place the disclosure where requested. It might belong in a submission note, report, README, commit description, or another designated field.

    Follow the requested format and length.

Examples of AI use statements for code

Adapt these examples to the work and the relevant rules.

Replace bracketed text with accurate details, and do not include claims that are not true.

AI used for debugging guidance

“I used [tool] to help interpret an error message and suggest possible debugging steps.

I applied the changes I considered appropriate and reviewed the affected code.”

AI used to draft a code section

“I used [tool] to generate an initial draft of [function or file].

I edited the draft to fit the project requirements and [describe any tests or review actually completed].”

AI used for tests or documentation

“I used [tool] to suggest test cases for [component] and to draft related documentation.

I reviewed the suggestions and kept the parts that matched the project.”

No generative AI used

If a form asks for a statement regardless of whether AI was used, a direct response may be appropriate: “I did not use generative AI to create or revise the submitted code.” Use that wording only if it accurately describes the work and satisfies the requested scope.

How much detail is enough?

Match the detail to the stakes and the instructions.

For a small code sample, one sentence may identify the tool’s role and the parts you reviewed.

For a team project or a substantial codebase, a short note organized by file or task can help collaborators understand where AI assistance occurred.

More detail is not automatically better.

Avoid pasting private prompts, credentials, personal information, or confidential source code into a disclosure.

If someone requests sensitive information, use an approved channel and follow the organization’s data-handling rules.

Keep the statement separate from technical claims about the code.

Saying that you used an AI assistant does not establish who wrote every line, whether the code is original, or whether it meets a security or licensing requirement.

AI authorship detection is different from code similarity checking

AI authorship classification attempts to estimate whether content may have been generated by an AI system.

Code similarity or plagiarism checking compares code against other material or identifies matching patterns.

These are different questions, and neither result alone proves who wrote the code or whether a rule was violated.

Turnitin states that its AI writing model does not reliably detect code.

A writing-focused AI report should not be treated as a source-code similarity result.

If you need to examine code overlap, use a process designed for source-code comparison and interpret its findings in context.

Codespy is an external source-code detector.

If you consider any detector, describe its role accurately and avoid presenting a score as proof of authorship, misconduct, or originality.

A statement about your process is more direct evidence of what assistance you used than an unsupported inference from a detection result.

Common mistakes to avoid

  • Being too broad: “AI helped” does not explain whether it generated code, suggested edits, or answered a conceptual question.
  • Overstating verification: Do not say the code is fully tested or safe unless the checks support that claim.
  • Omitting meaningful assistance: If AI generated a substantial section, a disclosure limited to “grammar suggestions” would misrepresent its role.
  • Treating a detector score as a verdict: Detection outputs can be uncertain and do not establish authorship on their own.
  • Assuming one policy applies everywhere: Academic, workplace, publisher, and open-source expectations can vary.

    Check the rules that govern the specific code.

A strong AI use statement is a brief, accurate account of the tool’s contribution and your own review.

Before submitting or publishing code, compare it with the applicable policy and make sure every claim in the disclosure reflects what you actually did.