OpenAI Codex vs GitHub Copilot

Codex and Copilot now meet at every level: a cloud agent that returns a pull request, an agent in the editor, a CLI, a desktop app and a pull request reviewer. How they compare at each, which instruction files each reads, which models each runs, and how Codex can run inside Copilot.

7 min read

OpenAI Codex and GitHub Copilot no longer compete as an autocomplete and an agent. Both now have a cloud agent that works on its own and returns a pull request, an agent in the editor, a command-line agent, a desktop app and a pull request reviewer. The real differences are where each is anchored and what it runs. Copilot is anchored in GitHub: issues, Actions, pull requests and policies, with models from several vendors, OpenAI’s among them. Codex is OpenAI’s own agent, running OpenAI’s models, anchored in your ChatGPT account and one AGENTS.md. And they are not exclusive: GitHub now offers the Codex coding agent inside Copilot, in public preview. Choose by where your team already works and reviews, then decide whether you need both.

The surfaces, side by side

Where each one runs
              Codex                            GitHub Copilot
Cloud         Codex cloud                      Copilot cloud agent
Editor        Codex IDE extension              Copilot agent mode
Terminal      codex                            copilot
Desktop       ChatGPT desktop app, Codex view  GitHub Copilot app
Scripts, CI   codex exec                       copilot -p
PR review     @codex review                    Copilot code review

Cloud delegation

Codex cloud runs tasks in isolated, OpenAI-managed environments that you configure once per repository with its dependencies, tools and variables. OpenAI’s Codex cloud page (opens in a new tab) says it connects to GitHub or, in beta, GitLab, and takes work from the web, GitHub pull requests, GitLab merge requests and issues, Linear and Slack, as well as from the CLI and the IDE extension. Each task returns a summary and a diff; you ask for follow-ups or open a pull request. Setup runs with network access; the agent phase is offline by default unless you allow it.

Copilot’s cloud agent, formerly called the coding agent, works in its own ephemeral development environment powered by GitHub Actions, according to GitHub’s page about the cloud agent (opens in a new tab). You start it from the agents panel on GitHub.com, by assigning an issue to Copilot, from VS Code, or with @copilot in a pull request comment, and there are integrations for Slack, Teams, Jira, Linear and Azure Boards. On GitHub.com it can research and plan on a branch before any pull request exists. It works only on repositories hosted on GitHub. The full walkthrough is in the GitHub Copilot coding agent.

In the editor

  • Codex: the IDE extension runs in VS Code and compatible editors, including Cursor and Windsurf, while Xcode and JetBrains IDEs have their own Codex integrations. You add open files and selections to the prompt, review a focused diff and keep the changes you want, or hand a longer task to Codex cloud.
  • Copilot: agent mode works in VS Code beside your code, with Plan to agree an approach first and checkpoints you can restore. Copilot also runs in other editors, including JetBrains IDEs. Habits that help are in GitHub Copilot agent mode best practices.

In VS Code the choice can be made per session. The editor’s page on agent harnesses (opens in a new tab) lists Local, Copilot, Claude and Codex harnesses, and says the Codex harness runs through the OpenAI Codex extension, with VS Code providing session management, chat and code review around it.

In the terminal

  • Codex CLI: codex in a repository. It runs in an OS-enforced sandbox with the network off and writes limited to the workspace by default, codex exec runs it from a script, /review reviews local changes, and codex cloud sends work to the cloud from the terminal.
  • Copilot CLI: copilot in a repository. It asks before any tool that can change your system, lets you allow a tool once or for the session, has a plan mode on Shift+Tab, and runs from scripts with -p plus --allow-tool rules. A GitHub MCP server is built in, so it can list your pull requests or open an issue as well as change code. The detail is in GitHub Copilot CLI.
One non-interactive task in each
codex exec "Summarise this week's commits"

copilot -p "Summarise this week's commits" --allow-tool='shell(git)'

The desktop apps follow the same split. Codex’s is now a view inside the ChatGPT desktop app, built for parallel threads and worktrees. GitHub’s newer Copilot app is built on Copilot CLI and runs several agent sessions, each on its own worktree and branch, with GitHub issues, pull requests and CI results in the same window.

GitHub integration and pull request review

This is Copilot’s home ground. Its code review can be requested on any pull request or turned on for every one, reads the whole repository for context, and can pass its suggestions to the cloud agent, which opens a pull request with the fixes applied. Organisations on Business and Enterprise plans can let members without a Copilot licence use it on GitHub.com.

Codex reviews on GitHub once Codex cloud is set up for the repository: comment @codex review, or turn on automatic reviews. It posts a standard GitHub review that flags only P0 and P1 issues and follows a ## Code Review Rules section in your AGENTS.md. Other requests work the same way; @codex fix the CI failures starts a cloud task with the pull request as context. How to fit either reviewer into your process is in AI agents for PR review.

Instruction files

Codex reads AGENTS.md, from ~/.codex down through each directory to where you are, with an AGENTS.override.md taking precedence in any directory that has one. Copilot reads more. GitHub’s page on repository custom instructions (opens in a new tab) lists .github/copilot-instructions.md, path-specific .instructions.md files, one or more AGENTS.md files with the nearest taking precedence, or a single CLAUDE.md or GEMINI.md at the root. The overlap is AGENTS.md, so put shared rules there. Which Copilot surface reads which file is in does GitHub Copilot support AGENTS.md?

Model choice, and Codex inside Copilot

Codex runs OpenAI’s models, chosen with /model or --model. Copilot runs several vendors’ models. GitHub’s supported models list (opens in a new tab) includes OpenAI’s GPT models, a Codex-tuned one among them, alongside models from Anthropic, Google, Microsoft, Moonshot AI and xAI, with availability depending on your plan and where you use Copilot. So you can use OpenAI models inside Copilot without Codex, but that is Copilot’s agent running an OpenAI model, not the Codex agent.

The Codex agent itself is available too. GitHub’s OpenAI Codex page (opens in a new tab) says the Codex coding agent is available on all paid Copilot plans, in public preview, as a third-party agent you enable in your Copilot policies. You assign it an issue or a prompt on GitHub, and it works on a pull request and consumes Actions minutes and AI credits like Copilot’s own agent. In the Codex VS Code extension, Sign in with Copilot is available to Copilot Pro+ and Max subscribers. Billing differs between the routes, so check each vendor’s current plans.

Who each suits

  • Your team lives in GitHub, assigns work as issues and wants one reviewer on every pull request: Copilot, whose cloud agent, code review and policies are built into the platform.
  • You want OpenAI’s agent with one configuration in every tool, including editors other than VS Code: Codex.
  • Your code is on GitLab: Codex cloud connects to it in beta. Copilot’s cloud agent works on GitHub repositories.
  • You want to try several vendors’ models on the same task: Copilot’s model picker, or its third-party agents.
  • You pay for Copilot but want the Codex agent: enable the Codex coding agent in your Copilot policies, or use the Codex harness in VS Code.
  • You already pay for ChatGPT: Codex signs in with your ChatGPT account and needs nothing else.

One list for every agent

With Codex and Copilot both able to take the same issue, the risk is two agents working one task and nobody seeing the whole picture. Keep the list outside both. On fenbs, Codex and Copilot in VS Code connect to the same MCP address with a browser sign-in; Copilot’s cloud agent, which does not yet support OAuth sign-in for remote servers, uses a token you issue under Settings. Every change is recorded in History under the assistant’s name on your behalf, and tasks move through To Do, Next Up, In Progress and Completed whichever agent did the work.

Questions people ask.

Can I use Codex inside GitHub Copilot?

Yes. GitHub offers the OpenAI Codex coding agent as a third-party agent on all paid Copilot plans, in public preview, once it is enabled in your Copilot policies. VS Code also has a Codex harness, and Copilot Pro+ and Max subscribers can sign in to the Codex extension with Copilot.

Does GitHub Copilot use OpenAI models?

Yes, among others. GitHub’s supported models list includes several OpenAI GPT models, including a Codex-tuned one, alongside Anthropic, Google, Microsoft, Moonshot AI and xAI models. Which ones you see depends on your plan and client.

Is Codex cloud the same as Copilot’s cloud agent?

No. Both run a task away from your machine and return a diff or pull request, but Codex cloud runs in OpenAI-managed containers and connects to GitHub or GitLab, while Copilot’s cloud agent runs in a GitHub Actions environment on GitHub repositories.

Do Codex and Copilot read the same instructions file?

They share AGENTS.md. Codex reads AGENTS.md and AGENTS.override.md; Copilot also reads .github/copilot-instructions.md and path-specific instruction files. Keep shared rules in AGENTS.md.

Start with one thing.

There is nothing to set up first. Write one line and you’ve started.