Using AI Coding Assistants

AI Coding Assistants

The use of AI coding assistants is becoming more common, this can include either inline comments or full blown auto generated code and classes. We can also use these tools to refactor and document / test our code This can also include generative ai elements such as icons, and other images

Elepant Image 1

While such tools enhance efficiency, they also complicate questions of authorship (and hence academic integrity). Unlike human collaborators, AI systems do not “own” their contributions, but their output can still reflect training data, licensing issues, and non obvious biases.

We need a way to cite and monitor how these tools are used and integrated in our workflows. This document outlines ways of doing so and what we expect to be submitted with code based assignments.

It is also important to stress that most of the work you do should be your own and not 100% AI generated, you are learning how to program not how to use AI.

General Citation rules

Unlike written work, code citations must integrate into technical workflows. Effective citation should:

  • Be explicit: Identify the AI system, version, and interaction that generated the code.
  • Be contextual: Note whether the AI generated full solutions, partial snippets, or debugging hints.
  • Be reproducible: Provide enough metadata to allow others to regenerate the same or similar output.
  • Be modular: Embed citations directly within the codebase where appropriate.

Simple Citations

As outlined in the Citation page for simple code we can cite inline.

If you use the chat element to ask for help or specific code structures / algorithms then this should be cited with the prompt used. For example.

// code modified from this example
// OpenAI GPT-5 (prompt on 3/9/2025).
// prompt :- write c++ code to convolve an array of floats
/*
std::vector<float> convolve(const std::vector<float>& a, const std::vector<float>& b) {
    std::vector<float> result(a.size() + b.size() - 1, 0.0f);
    for (int i = 0; i < a.size(); ++i) {
        for (int j = 0; j < b.size(); ++j) {
            result[i+j] += a[i] * b[j];
        }
    }
    return result;
}
*/

After this put in the code you modified or used, if using this in a Jupyter notebook please use the reference system https://jupyterbook.org/en/stable/tutorials/references.html

The should also be done for any images / icons created. In this document I have cited the elephant image, if you have generated app icons etc, add the prompts / agent used in the documents.

Rules Files

An AI .rules file is a project-level configuration or documentation file that defines how AI tools are allowed to be used within a codebase. If you are using AI Agents this file must be included in your repository.

For example, this project https://github.com/NCCA/ASEPythonCode/blob/main/.rules has the rules file as part of the repository.

AI Chat Log

Most agent based systems keep a log / chat history. You should maintain and submit this in a markdown document as part of the project submission. This can either be in a separate folder for large projects or as a single file.

This project https://github.com/NCCA/VenvCleaner gives an example of this, in particular the file https://github.com/NCCA/VenvCleaner/blob/main/AIChat1.md


  1. This image was generated with the following promp. “generate me a new image called “the AI elephant in the room” which is to be used in an article about how to cite and use AI generated code for students, I’m thinking we need some sort of “Matrix” style graphics in it " ↩︎

Previous
Next