OpenAI Codex
{{short description|Artificial intelligence model geared towards programming}}
OpenAI Codex is an artificial intelligence model developed by OpenAI that translates natural language into code, a technology described by artificial intelligence researchers as an AI agent.{{cite web |last=Metz |first=Cade |title=OpenAI Unveils New Tool for Computer Programmers |url=https://www.nytimes.com/2025/05/16/technology/openai-codex-programming-tool.html |date=2025-05-16 |website=The New York Times |access-date=2025-05-20 |language=en}} It powers GitHub Copilot, an AI-based code autocompletion tool available in select IDEs such as Visual Studio Code and Neovim.{{cite web |last=Zaremba |first=Wojciech |author-link=Wojciech Zaremba |date=August 10, 2021 |title=OpenAI Codex |url=https://openai.com/blog/openai-codex/ |url-status=live |archive-url=https://web.archive.org/web/20230203201912/https://openai.com/blog/openai-codex/ |archive-date=2023-02-03 |access-date=2021-09-03 |website=OpenAI}}
On May 16, 2025, OpenAI announced the launch of a research preview of a distinct tool with a similar purpose, also named Codex, based on a finetuned version of OpenAI o3.{{cite web |last=Knight |first=Will |title=OpenAI Launches an Agentic, Web-Based Coding Tool |url=https://www.wired.com/story/openai-launches-an-agentic-web-based-coding-tool/ |date=2025-05-16 |website=Wired |access-date=2025-05-20 |language=en}}
Capabilities
Based on GPT-3, a neural network trained on text, Codex was additionally trained on 159 gigabytes of Python code from 54 million GitHub repositories.{{Cite news|last=Wiggers|first=Kyle|date=July 8, 2021|title=OpenAI warns AI behind GitHub's Copilot may be susceptible to bias|work=VentureBeat|url=https://venturebeat.com/2021/07/08/openai-warns-ai-behind-githubs-copilot-may-be-susceptible-to-bias/|access-date=2021-09-03|archive-date=2023-02-03|archive-url=https://web.archive.org/web/20230203201912/https://venturebeat.com/business/openai-warns-ai-behind-githubs-copilot-may-be-susceptible-to-bias/|url-status=live}}{{Cite news|last=Alford|first=Anthony|date=August 31, 2021|title=OpenAI Announces 12 Billion Parameter Code-Generation AI Codex|work=InfoQ|url=https://www.infoq.com/news/2021/08/openai-codex/|access-date=2021-09-03|archive-date=2022-07-09|archive-url=https://web.archive.org/web/20220709221205/https://www.infoq.com/news/2021/08/openai-codex/|url-status=live}} A typical use case of Codex is for a user to type a comment, such as "//compute the moving average of an array for a given window size
", then use the AI to suggest a block of code that satisfies that comment prompt.{{Cite news|last1=Anderson|first1=Tim|last2=Quach|first2=Katyanna|date=July 6, 2021|title=GitHub Copilot auto-coder snags emerge, from seemingly spilled secrets to bad code, but some love it|work=The Register|url=https://www.theregister.com/2021/07/06/github_copilot_autocoder_caught_spilling/|access-date=2021-09-04|archive-date=2023-06-02|archive-url=https://web.archive.org/web/20230602214528/https://www.theregister.com/2021/07/06/github_copilot_autocoder_caught_spilling/|url-status=live}} OpenAI stated that Codex can complete approximately 37% of requests and is meant to make human programming faster rather than to replace it. According to OpenAI's blog, Codex excels most at "mapping... simple problems to existing code", which they describe as "probably the least fun part of programming".{{Cite news|last=Dorrier|first=Jason|date=August 15, 2021|title=OpenAI's Codex Translates Everyday Language Into Computer Code|work=SingularityHub|url=https://singularityhub.com/2021/08/15/openais-codex-translates-everyday-language-into-computer-code/|access-date=2021-09-03|archive-date=2023-05-26|archive-url=https://web.archive.org/web/20230526045651/https://singularityhub.com/2021/08/15/openais-codex-translates-everyday-language-into-computer-code/|url-status=live}}{{Cite news|last=Dickson|first=Ben|date=August 16, 2021|title=What to expect from OpenAI's Codex API|work=VentureBeat|url=https://venturebeat.com/2021/08/16/what-to-expect-from-openais-codex-api/|access-date=2021-09-03|archive-date=2023-02-03|archive-url=https://web.archive.org/web/20230203201913/https://venturebeat.com/ai/what-to-expect-from-openais-codex-api/|url-status=live}} Co-founder of Fast.ai, Jeremy Howard ted that "Codex is a way of getting code written without having to write as much code", and that "it is not always correct, but it is just close enough".{{Cite news|last=Metz|first=Cade|date=September 9, 2021|title=A.I. Can Now Write Its Own Computer Code. That's Good News for Humans.|work=The New York Times|url=https://www.nytimes.com/2021/09/09/technology/codex-artificial-intelligence-coding.html|access-date=2021-09-16|archive-date=2022-03-30|archive-url=https://web.archive.org/web/20220330010719/https://www.nytimes.com/2021/09/09/technology/codex-artificial-intelligence-coding.html|url-status=live}} According to a paper by OpenAI researchers, when Codex attempted each test case 100 times, it generated working solutions for 70.2% of prompts.{{Cite arXiv|last1=Chen|first1=Mark|last2=Tworek|first2=Jerry|last3=Jun|first3=Heewoo|last4=Yuan|first4=Qiming|last5=Pinto|first5=Henrique Ponde de Oliveira|last6=Kaplan|first6=Jared|last7=Edwards|first7=Harri|last8=Burda|first8=Yuri|last9=Joseph|first9=Nicholas|last10=Brockman|first10=Greg|last11=Ray|first11=Alex|date=2021-07-14|title=Evaluating Large Language Models Trained on Code |eprint=2107.03374 |class=cs}}
OpenAI claims that Codex can create code in over a dozen programming languages, including Go, JavaScript, Perl, PHP, Ruby, Shell, Swift, and TypeScript, though it is most effective in Python. According to VentureBeat, demonstrations uploaded by OpenAI showed impressive coreference resolution capabilities. The demonstrators were able to create a browser game in JavaScript and generate data science charts using matplotlib.
OpenAI showed that Codex can interface with services and apps such as Mailchimp, Microsoft Word, Spotify, and Google Calendar.{{Cite news|last=Vincent|first=James|date=August 10, 2021|title=OpenAI can translate English into code with its new machine learning software Codex|work=The Verge|url=https://www.theverge.com/2021/8/10/22618128/openai-codex-natural-language-into-code-api-beta-access|access-date=2021-09-03|archive-date=2021-09-02|archive-url=https://web.archive.org/web/20210902142401/https://www.theverge.com/2021/8/10/22618128/openai-codex-natural-language-into-code-api-beta-access|url-status=live}}
The Codex-1 model is designed to identify and refuse requests related to malware, exploits, or content that violates usage policies, citing the relevant policy clauses. It operates within a restricted container environment that lacks outbound internet access and includes only whitelisted dependencies, thereby minimizing the potential impact of any malicious code. {{Cite news|last=Nuzhnyy|first=Sergey|date=May 19, 2025|title=What is Codex? Exploring OpenAI's AI Coding Agentx|work=AI/ML API|url=https://aimlapi.com/blog/what-is-codex-exploring-openais-ai-coding-agent}}
Issues
OpenAI demonstrations showcased flaws such as inefficient code and one-off quirks in code samples. In an interview with The Verge, OpenAI chief technology officer Greg Brockman said that "sometimes [Codex] doesn't quite know exactly what you're asking" and that it can require some trial and error. OpenAI researchers found that Codex struggles with multi-step prompts, often failing or yielding counter-intuitive behavior. Additionally, they brought up several safety issues, such as over-reliance by novice programmers, biases based on the training data, and security impacts due to vulnerable code.
VentureBeat stated that because Codex {{Cite web |date=2025-05-17 |title=Coding's Next Frontier: How OpenAI Codex Is Redefining Software Engineering |url=https://timelybharat.com/openai-codex/ |access-date=2025-05-26 |language=en-US}}is trained on public data, it could be vulnerable to "data poisoning" via intentional uploads of malicious code. According to a study by researchers from New York University, approximately 40% of code generated by GitHub Copilot (which uses Codex) in scenarios relevant to high-risk CWEs included glitches or other exploitable design flaws.{{cite arXiv |last1=Pearce |first1=Hammond |last2=Ahmad |first2=Baleegh |last3=Tan |first3=Benjamin |last4=Dolan-Gavitt |first4=Brendan |last5=Karri |first5=Ramesh |date=2021-12-16 |title=Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions |class=cs.CR |eprint=2108.09293 }}
=Copyright=
The Free Software Foundation expressed concerns that code snippets generated by Copilot and Codex could violate copyright, in particular the condition of the GPL that requires derivative works to be licensed under equivalent terms.{{Cite news|last=Krill|first=Paul|date=August 2, 2021|title=GitHub Copilot is 'unacceptable and unjust,' says Free Software Foundation|work=InfoWorld|url=https://www.infoworld.com/article/3627319/github-copilot-is-unacceptable-and-unjust-says-free-software-foundation.html|access-date=2021-09-03|archive-date=2021-09-03|archive-url=https://web.archive.org/web/20210903201419/https://www.infoworld.com/article/3627319/github-copilot-is-unacceptable-and-unjust-says-free-software-foundation.html|url-status=live}} Issues they raised include whether training on public repositories falls into fair use or not, how developers could discover infringing generated code, whether trained machine learning models could be considered modifiable source code or a compilation of the training data, and if machine learning models could themselves be copyrighted and by whom.{{Cite news|last=Robertson|first=Donald|date=2021-07-28|title=FSF-funded call for white papers on philosophical and legal questions around Copilot: Submit before Monday, August 23, 2021|work=Free Software Foundation|url=https://www.fsf.org/blogs/licensing/fsf-funded-call-for-white-papers-on-philosophical-and-legal-questions-around-copilot|access-date=2021-09-04|archive-date=2021-08-11|archive-url=https://web.archive.org/web/20210811003717/https://www.fsf.org/blogs/licensing/fsf-funded-call-for-white-papers-on-philosophical-and-legal-questions-around-copilot|url-status=live}} An internal GitHub study found that approximately 0.1% of generated code contained direct copies from the training data. In one example the model outputted the training data code implementing the fast inverse square root algorithm, including comments and an incorrect copyright notice.
In response, OpenAI stated that "legal uncertainty on the copyright implications of training AI systems imposes substantial costs on AI developers and so should be authoritatively resolved."
The copyright issues with Codex have been compared to the Authors Guild, Inc. v. Google, Inc. court case, in which judges ruled that Google Books's use of text snippets from millions of scanned books constituted fair use.{{Cite magazine |last=Barber |first=Gregory |date=July 12, 2021 |title=GitHub's Commercial AI Tool Was Built From Open Source Code |url=https://www.wired.com/story/github-commercial-ai-tool-built-open-source-code/ |url-status=live |archive-url=https://web.archive.org/web/20210725233825/https://www.wired.com/story/github-commercial-ai-tool-built-open-source-code/ |archive-date=2021-07-25 |access-date=2021-09-04 |magazine=WIRED}}
Coding’s Next Frontier: However, use of text snippets from books provides for a reliable reference of the copyright owner, as opposed to compiled works used for the training algorithm data where the final output is made without any such reference.
References
{{reflist}}
{{OpenAI navbox}}
{{Generative AI}}
Category:Deep learning software applications
Category:Copyright infringement of software