GitHub Copilot is an AI assistant that supports programming, available for an annual license. Trained on GitHub’s vast code database, it offers context-based code suggestions and improves productivity. Although it raises legal and security issues, it promises to revolutionize software development, especially in open source. The technology was already partly available, but with the latest release, it is possible to interact with an AI assistant capable of assisting by reasoning on existing code and helping to generate new code. Let’s try to understand what’s new and the implications of its use in software development.
GitHub Copilot requires, as often happens with technologies based on generative AI, a specific license, which for independent developers costs about $100 per year, about half of the license for companies. It is also possible to activate a trial version of the service to test its capabilities. Copilot can be used within very popular editors, both proprietary ones like Visual Studio and open ones like Visual Studio Code. Copilot can also be used within the GitHub command line.
By selecting the Copilot chat view, you can ask questions about the code, such as asking for an explanation of a code fragment. The assistant shows the generated code, and you can decide whether to consolidate it in the actual source. You can also ask for code to be written starting from a specification expressed based on a requirement. In the following example, we asked to add a URL to the Web application that allows you to add the two numbers using the request parameters in the Web browser. Copilot also works by proposing a completion of the code you are writing based on the context. If we want to add a method capable of subtracting two numbers, we can start writing, and as soon as the assistant understands the intention, the assistant will propose the correct completion.
But how does GitHub Copilot work?
By now we know well that training a generative artificial intelligence requires large amounts of data that will be used by the neural network to learn the structure of the input data that will then be used to generate new information. Even in the case of GitHub Copilot, training was carried out using the enormous code base hosted by the platform, a heritage that led Microsoft to acquire it in June 2018.
Even in the case of GitHub Copilot, the question arises as to whether the training of generative AI falls within the so-called FAIR use of sources or whether the AI has obtained copyrighted information to do business. It is no coincidence that many companies have prohibited the use of these technologies for fear that intellectual property could be put at risk. However, it must be said that productivity increases so much that many employees try to circumvent the restrictions imposed to take advantage of it.
The evolution of the legal framework on the perimeter of artificial intelligence training and the protection of intellectual property will contribute to determining its use, even if its use in writing open code can certainly benefit, also because the assistant tends to propose programming schemes that tend to follow best practices, often offering ideas to the programmer who contributes to his growth as a developer.
AI and Cybersecurity
GitHub Copilot used OpenAI’s Codex model, but it is unclear how the collection is updated over time, although it is likely that they are limited to using open-licensed code to reduce the risk of legal content. Some argue that even using open-source code to train an AI goes beyond the terms of the license, but attempts to support this thesis have not produced significant results to date.
The use of code generated by artificial intelligence tends to alter the verification process of non-functional aspects such as, for example, those of cybersecurity: how do we know that the proposed code does not turn out to be insecure? This is a matter of no small importance; on the one hand, the AI could have learned widely used but insecure programming patterns (perhaps not yet known); on the other hand, the programmer is capable.

Will programs write themselves?
One might wonder what the role of the programmer is in a world where a program (Copilot) writes other programs. The so-called “metaprogramming”, or the writing of programs by other programs, is a discipline as old as computer science: a compiler is nothing more than a program that, given a source code written in a programming language, generates the machine code equivalent to that program. What AI brings is, therefore, simply the ability to generate a mouth of an algorithm, but it does not replace, at least for now, the programmer, at least the one who is able to understand the generated code.
Professional figures at risk
However, there are professional figures at risk: website programmers, for example, do not develop complex code and normally do not have enough knowledge to appreciate its sophistication. The code they write is often quite simple and regular and generated by artificial intelligence. It is, therefore, reasonable to expect a proposal in the request for application programmers (thanks to the increased productivity with generative AI). At the same time, these programmers will be required to have greater skills so as not to be subjected to the code generated by the process but to be able to manage its development in an informed manner.