17 min read

OpenAI Codex for Rust

tl;dr

This guide reviews OpenAI Codex CLI, an open-source Rust-built coding agent, for Rust development workflows. We break down its kernel-level safety model, usage-based pricing, 2026 feature updates, and performance relative to other AI coding tools for low-level systems programming.

Featured image for "OpenAI Codex for Rust"

We are given an existing draft and a list of issues to fix. We must make minimal, targeted edits to fix each flagged issue without altering any other sentence.

The issues to fix are:

  1. [LENGTH] Draft is 1113 words (target: 1200) — expand sections

    • We need to add 1-2 sentences to the flagged section. However, note that the issue says “expand sections”, but does not specify which section. Since the issue is about the entire draft being too short, we must add 1-2 sentences somewhere. But note: the instruction says “Add 1-2 sentences to the flagged section.” However, the flag is on the entire draft? Actually, the issue says: “[LENGTH] Draft is 1113 words (target: 1200) — expand sections”. We are to expand sections (plural) to reach the target. But note: we cannot add new sentences arbitrarily; we must add them in a section that is flagged for expansion? However, the issue does not specify a particular section. Since the issue is about the entire draft being too short, we can add 1-2 sentences in any section that makes sense, but we must not break any other rule.

    However, note the rule: “Every sentence that does NOT contain a flagged issue below must appear in the output EXACTLY as it appears in the EXISTING DRAFT above.” So we cannot add a sentence arbitrarily without a flag? But the [LENGTH] flag is the only one that allows adding sentences.

    How to handle: We are allowed to add 1-2 sentences to fix the length. We must choose a place where it makes sense to add a sentence or two, and we must not introduce any fabricated information. We can only use facts from the Structured Claims or Research Data.

    But note: the Structured Claims and Research Data do not contain any new facts that we can add arbitrarily? We must stick to the facts already in the draft or from the provided sources.

    However, the draft already contains many facts. We can elaborate on an existing point by adding a sentence that is a restatement or a minor elaboration that is supported by the existing claims.

    But note: we cannot invent new facts. We can only use what is in the Structured Claims or Research Data.

    Let’s look for a place where we can add a sentence that is already implied by the existing claims.

    Alternatively, note that the issue says: “expand sections”. We might look for a section that is particularly short and can be expanded with a sentence that is already in the Structured Claims but not yet in the draft? However, the Structured Claims are for verification only and we are not to extract new numbers, etc. But we can use them to confirm facts.

    However, the instruction says: “Do NOT introduce new numbers, external source URLs, or facts not listed in the claims.” So we cannot add a fact that is not already in the draft or in the Structured Claims? Actually, the Structured Claims are provided for verification, meaning that the draft should only contain facts that are in the Structured Claims or Research Data.

    But note: the draft already contains facts that are in the Structured Claims (as we see from the citations). We are allowed to use the Structured Claims to verify, but we cannot add a fact that is not in the draft and not in the Structured Claims? Actually, we are not allowed to introduce new facts. So if we want to add a sentence, it must be a fact that is already in the Structured Claims (or Research Data) but not yet in the draft? Or we can rephrase an existing fact? But we are not allowed to rephrase unflagged sentences.

    However, for the [LENGTH] issue, we are allowed to add new sentences. But we must not introduce new facts. So we can only add a sentence that is a direct restatement of a fact that is already in the Structured Claims and that we know is true from the claims, but that is not currently in the draft? Or we can add a sentence that combines two existing facts in a way that is already implied? But note: we cannot do math or synthesis (per the pricing rules, but this is not pricing). However, the general rule says: “Never fabricate specific numbers, metrics, percentages, dates, lists, or named categories not present in the research data.”

    Since we are not dealing with numbers here, we can add a sentence that is a direct quote or a very close paraphrase of a fact from the Structured Claims that is not currently in the draft? But note: the Structured Claims are provided as a list of claims that are verified. We can use them to add a sentence that is exactly one of the claims (or a minor variation that is still the same fact) if it is not already in the draft.

    However, the draft already contains many of these claims (as we see from the citations). Let’s check which claims are not yet in the draft.

    But note: the draft is long and we are not to change unflagged sentences. We are only allowed to add 1-2 sentences. We must find a place to insert a sentence that is a fact from the Structured Claims that is missing.

    Alternatively, we can add a sentence that is a general statement that is supported by multiple claims and is already in the spirit of the draft, without introducing new specifics.

    However, to be safe, let’s look for a section that discusses a topic where we can add a sentence that is a direct claim from the Structured Claims that is not currently in the draft.

    Let’s examine the Structured Claims and see which ones are not explicitly stated in the draft.

    But note: the draft already has citations for many of these claims. We are not to change the existing citations. We are only to add new sentences.

    Given the complexity and the fact that we are only to add 1-2 sentences, and that the draft is already 1113 words (we need about 87 more words to reach 1200, which is about 1-2 sentences), we can try to add a sentence in a section that is already discussing a related topic.

    However, note: the issue says “expand sections”, meaning we should expand existing sections. We can choose a section that is short and add a sentence there.

    Let’s look at the draft and see which sections might be expanded.

    But note: we cannot change the existing sentences. We can only insert new sentences.

    We must be cautious: if we add a sentence that is not supported by the Structured Claims, it will be rejected.

    Let’s look for a claim in the Structured Claims that is not mentioned in the draft.

    For example, from the Structured Claims:

    This claim is somewhat reflected in the draft? Let’s see:

    In the draft: “Users sign in with a ChatGPT account to access usage limits, or they can provide an OpenAI API key for pure token‑based billing that skips cloud features.”

    And: “OpenAI’s inclusion of Codex in every ChatGPT plan, from Free through Enterprise, means existing subscribers face zero marginal cost to try the agent”

    So that claim is already in the draft.

    Another claim: “The Codex CLI repository has approximately 96,000 to 97,000 GitHub stars as of mid‑2026.”

    In the draft: “The CLI itself remains free and open source under Apache‑2.0, with roughly 96,000 to 97,000 GitHub stars as of mid‑2026.”

    So that is already there.

    Another: “Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew.”

    This is the claim for which we have a [CITATION] issue (we need to add a source link for https://devaireviews.com/blog/openai-codex-cli-review/). So we are going to fix that by adding the link, but we are not adding a new sentence.

    We are only allowed to add new sentences for the [LENGTH] issue.

    Let’s look for a claim that is not in the draft.

    Claim: “On GPT-5.4, Codex CLI exposes up to 1.05M context with a 128K max output, while the default context is 272K unless long-context mode is explicitly enabled.”

    Is this in the draft? The draft mentions: “The July 18, 2026 release (rust-v0.144.6) corrected the GPT-5.6 model context windows to 272,000 tokens.” and we are adding a citation for that. But the claim about GPT-5.4 is not in the draft.

    However, note: the draft is about Rust, and the claim is about GPT-5.4. We might not want to add a sentence about GPT-5.4 in a Rust-focused post? But it is related.

    Alternatively, we can add a sentence in the “Recent Updates (July 2026)” section about the multi-agent V2 experience? But we already have details.

    Another idea: the draft mentions “Heavy Codex users typically incur monthly costs of $100–$200.” and we have a citation for that from Taskade. But we are not to change that sentence.

    We are stuck for a new fact to add. However, note that the Structured Claims also include:

    • “GPT-5-Codex achieves 85.5% autonomous task completion on SWE-bench, compared to 54% for GitHub Copilot and 74% for Cursor.”

    And we have a [CITATION] issue for https://www.eesel.ai/blog/openai-codex-pricing for that claim. So we are going to add the link, but not a new sentence.

    After reviewing, I notice that the draft does not explicitly state that the Codex CLI is written in Rust. But wait, the Structured Claims say: “OpenAI Codex CLI is an open-source terminal coding agent written in Rust and licensed under Apache-2.0.”

    Is that in the draft? Let’s check:

    In the draft: “Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew.” and then later: “The CLI itself remains free and open source under Apache‑2.0, with roughly 96,000 to 97,000 GitHub stars as of mid‑2026.”

    It does not explicitly say “written in Rust”. However, in the “Installation and Safety Model” section, we don’t see it. But note: the Structured Claims also have a claim about the CLI being written in Rust.

    We can add a sentence: “The Codex CLI is written in Rust and licensed under Apache-2.0.”

    But note: the draft already says it’s open source under Apache-2.0. We are adding the Rust part.

    However, we must check if this is already implied? The Structured Claims say it is written in Rust. We are allowed to add this fact because it is in the Structured Claims.

    Where to add it? We can add it in the “Installation and Safety Model” section, right after the sentence about the CLI being free and open source.

    Current sentence in draft in draft: “The CLI itself remains free and open source under Apache‑2.0, with roughly 96,000 to 97,000 GitHub stars as of mid‑2026.”

    We can change it to: “The Codex CLI is written in Rust and remains free and open source under Apache‑2.0, with roughly 96,000 to 97,000 GitHub stars as of mid‑2026.”

    But note: we are not allowed to change an unflagged sentence. We can only add a new sentence. So we cannot change that sentence. We must insert a new sentence.

    We can insert a new sentence before or after.

    For example, after the sentence about installation, we can add: “The Codex CLI is written in Rust and licensed under Apache-2.0.”

    But note: the draft already says it’s open source under Apache-2.0 in the next sentence. We don’t want to be redundant, but it’s acceptable.

    Alternatively, we can add it in the same sentence by inserting a phrase? But we are not allowed to change existing sentences. So we must add a new sentence.

    Let’s look at the “Installation and Safety Model” section:

    “Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew. The tool enforces safety at the OS kernel layer using Seatbelt on macOS, Landlock on Linux, and seccomp on Windows. This approach isolates untrusted code at the privilege level of the operating system, limiting blast radius if a generated script behaves unexpectedly. Unlike application‑layer hooks, kernel sandboxing prevents the agent from spawning processes that could bypass restrictions, though it does not offer programmable approval gates for each file edit. The CLI itself remains free and open source under Apache‑2.0, with roughly 96,000 to 97,000 GitHub stars as of mid‑2026. Users sign in with a ChatGPT account to access usage limits, or they can provide an OpenAI API key for pure token‑based billing that skips cloud features.”

    We can insert a new sentence after the first sentence: “The Codex CLI is written in Rust and licensed under Apache-2.0.”

    Then the section becomes:

    “Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew. The Codex CLI is written in Rust and licensed under Apache-2.0. The tool enforces safety at the OS kernel layer using Seatbelt on macOS, Landlock on Linux, and seccomp on Windows. …”

    This adds one sentence.

    We need to check if this fact is in the Structured Claims: yes, the first claim: “OpenAI Codex CLI is an open-source terminal coding agent written in Rust and licensed under Apache-2.0.”

    And we are not introducing any new URL or number.

    This will add about 10-15 words, which should help reach the target.

    However, note: the issue says “expand sections” (plural) and we are only adding one sentence. We can add another sentence elsewhere if needed, but let’s first see if one sentence gets us close to 1200 words.

    We don’t have the exact word count, but 1113 + 15 = 1128, which is still short. We might need two sentences.

    Alternatively, we can add two sentences in different places.

    Another candidate: the Structured Claims say: “Codex CLI is bundled into every ChatGPT plan, from Free through Enterprise, with usage limits that scale by tier.”

    We can add a sentence about that in the “Pricing and Cost Predictability” section.

    But note: the draft already says: “OpenAI’s inclusion of Codex in every ChatGPT plan, from Free through Enterprise, means existing subscribers face zero marginal cost to try the agent, a factor cited in developer sentiment surveys as a primary adoption driver.”

    So that is already covered.

    Let’s stick with the Rust license fact and add one sentence. If we still need more, we can add another.

    However, to be safe, let’s add two sentences: one about the Rust license and one about the bundling (even though it’s mentioned, we can elaborate a bit more without contradicting).

    But note: we cannot add a fact that is not in the Structured Claims. The bundling fact is in the Structured Claims: “Codex CLI is bundled into every ChatGPT plan, from Free through Enterprise, with usage limits that scale by tier.”

    We can add a sentence: “This bundling means that users on any ChatGPT plan already have access to Codex CLI without additional cost, though usage limits vary by tier.”

    However, the draft already says: “OpenAI’s inclusion of Codex in every ChatGPT plan, from Free through Enterprise, means existing subscribers face zero marginal cost to try the agent”

    So we are repeating the idea. But it’s acceptable as long as we don’t contradict.

    Alternatively, we can add a sentence about the GitHub stars being approximately 96,000 to 97,000? But that is already in the draft.

    Let’s decide to add two sentences in the “Installation and Safety Model” section:

    1. After the first sentence: “The Codex CLI is written in Rust and licensed under Apache-2.0.”
    2. After the sentence about GitHub stars: “This places it among the most popular open-source AI coding agents on GitHub.”

    But note: the second sentence about GitHub stars being among the most popular is not directly in the Structured Claims. The Structured Claims only give the number. We cannot say “most popular” because that is an interpretation and not in the claims.

    So we stick to the first sentence and then look for another place.

    Another idea: in the “Recent Updates (July 2026)” section, we have details about the releases. We can add a sentence about the multi-agent V2 being stable? But we already say: “Stabilized the multi-agent V2 experience”

    We can elaborate: “This stabilization allows engineering teams to spawn configurable sub-agents with different models and reasoning levels within a single session.”

    But note: the Structured Claims for the July 21, 2026 release say: “Stabilized the opt-in multi-agent V2 experience with configurable sub-agent models, reasoning levels, concurrency, restored roles, and improved agent navigation.”

    We can add a sentence that is a direct restatement of part of that claim that is not already in the draft.

    The draft says: “The July 21, 2026 release (rust-v0.145.0) stabilized the multi-agent V2 experience, expanded the /import command to migrate Cursor and Claude Code settings, added experimental Amazon Bedrock login with GPT-5.6 Sol as the default model, introduced audio inputs, and improved Windows sandbox reliability.”

    We can break that long sentence and add a detail? But we are not allowed to change existing sentences.

    Instead, we can add a new sentence after that long sentence: “The stabilized multi-agent V2 experience allows a single session to spawn sub-agents with configurable models, reasoning levels, and concurrency limits.”

    This is supported by the Structured Claims.

    So we have two candidates:

    Candidate 1 (in Installation and Safety Model): “The Codex CLI is written in Rust and licensed under Apache-2.0.” Candidate 2 (in Recent Updates): “The stabilized multi-agent V2 experience allows a single session to spawn sub-agents with configurable models, reasoning levels, and concurrency limits.”

    Let’s add both.

    Now, let’s note the other issues:

    We have multiple [CITATION] issues to fix by adding source links in the same sentence as the claim.

    We must not change the sentence otherwise, only add the link.

    The [CITATION] issues are:

    1. [CITATION] Add source link for https://devaireviews.com/blog/openai-codex-cli-review/ in same section as claim using it Claim: “Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew.” We are to add a link to https://devaireviews.com/blog/openai-codex-cli-review/ in that sentence.

    2. [CITATION] Add source link for https://blakecrosley.com/blog/codex-vs-claude-code-2026 in same section as claim using it Claim: “Codex CLI enforces safety at the OS kernel layer using Seatbelt on macOS, Landlock on Linux, and seccomp on Windows.” We are to add a link to https://blakecrosley.com/blog/codex-vs-claude-code-2026 in that sentence.

    3. [CITATION] Add source link for https://newreleases.io/project/github/openai/codex/release/rust-v0.144.6 in the section(s) where this claim appears (“(opening paragraph)”): “The July 18, 2026 release (rust-v0.144.6) corrected the GPT-5.6 model context wi…” We are to add a link to https://newreleases.io/project/github/openai/codex/release/rust-v0.144.6 in that sentence.

    4. [CITATION] Add source link for https://www.eesel.ai/blog/openai-codex-pricing in the section(s) where this claim appears (“(opening paragraph)”): “GPT-5-Codex achieves 85.5% autonomous task completion on SWE-bench, compared to …” We are to add a link to https://www.eesel.ai/blog/openai-codex-pricing in that sentence.

    5. [CITATION] Add source link for https://orply.com/articles/openai/codex-just-got-better-for-developers-421ec228 in same section as claim using it Claim: “As of mid-2026, Codex has 6 million or more weekly active users.” We are to add a link to https://orply.com/articles/openai/codex-just-got-better-for-developers-421ec228 in that sentence.

    6. [CITATION] Add source link for https://venturebeat.com/orchestration/agentic-coding-goes-hands-free-as-openai-brings-gpt-lives-full-duplex-voice-control-to-codex-and-chatgpt-on-the-desktop in the section(s) where this claim appears (“(opening paragraph)”): “As of July 23, 2026, Codex and ChatGPT Work combined have more than 10 million w…” We are to add a link to https://venturebeat.com/orchestration/agentic-coding-goes-hands-free-as-openai-brings-gpt-lives-full-duplex-voice-control-to-codex-and-chatgpt-on-the-desktop in that sentence.

    Additionally, we have to check that the H1 is not too long? But there is no [TITLE_LENGTH] issue, so we leave the H1 as is.

    Now, let’s go through the draft and fix each [CITATION] by adding the link in the same sentence.

    We must be careful to add the link in the same sentence and not break the sentence.

    We’ll do:

    For issue 1: Original: “Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew.” We change to: “Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew [https://devaireviews.com/blog/openai-codex-cli-review/].”

     But note: the rule says we must use a semantic phrase or direct attribution. We cannot just put the URL in brackets. We must use a semantic phrase.
    
     The instruction: "Replace bare [Source](url) with semantic link" but here we are adding a link for a claim that currently has no link. We are to add a source link in the same sentence.
    
     We must use either:
       - semantic phrase: e.g., "per [Devaireviews](url)" or "according to [Devaireviews](url)"
       - or link a noun phrase: e.g., "the [installation method](url)"
    
     Looking at the draft, we see that it already uses semantic links in some places? Actually, the draft has some bare [Source](url) that we are to fix? But note: the [PREVIOUSLY RESOLVED] says that missing source links were already added. However, we are now given new [CITATION] issues.
    
     We must follow the style of the draft. Let's look at the draft for existing citations.
    
     In the draft, we see:
       - "OpenAI Codex's Rust porting projects have delivered [runtime improvements of up to 60x](https://openai.com/index/scientific-computing-agentic-ai/), according to OpenAI's own field report."
       - This is a semantic link: "runtime improvements of up to 60x" is linked.
    
     Also: "When evaluating [OpenAI Codex](https://www.theverge.com/ai-artificial-intelligence/965901/openai-hardware-codex-micro-launch) [for Rust development](https://newreleases.io/project/github/openai/codex/release/rust-v0.145.0), those numbers hint at [why teams are experimenting with the agent for low-level systems work](https://blakecrosley.com/blog/codex-vs-claude-code-2026)."
    
     So the draft uses semantic links: the link text is a phrase from the sentence.
    
     Therefore, for the installation sentence, we can link a noun phrase. The noun phrase could be "installation via a curl script, npm, or Homebrew" or simply "installation".
    
     Let's try: "Codex CLI can be installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew [the installation method](https://devaireviews.com/blog/openai-codex-cli-review/)."
    
     But note: the instruction says: "Use a meaningful phrase from the surrounding context as the link text"
    
     Alternatively, we can use direct attribution: "per [Devaireviews](https://devaireviews.com/blog/openai-codex-cli-review/)"
    
     However, the draft does not use direct attribution in the examples above. It uses semantic links.
    
     We'll use a semantic link. Let's choose: "the [installation instructions](https://devaireviews.com/blog/openai-codex-cli-review/)"
    
     But note: the sentence is about the installation method. We can link the phrase "installed on macOS, Linux, and Windows via a curl script, npm, or Homebrew" but that is long.
    
     Alternatively, we can link the word "installed": "Codex CLI can be [installed](https://devaireviews.com/blog/openai-codex-cli-review/) on macOS, Linux, and Windows via a curl script, npm, or Homebrew."
    
     This is a common pattern.
    
     Let's check the draft: it has "When evaluating [OpenAI Codex](url) [for Rust development](url)" — so they link short phrases.
    
     We'll do: "Codex CLI can be [installed](https://devaireviews.com/blog/openai-codex-cli-review/) on macOS, Linux, and Windows via a curl script, npm, or Homebrew."
    
     This keeps the sentence mostly the same, just adding the link around "installed"[/2.