Difference Between Adversarial-Review and Regular Review in the Codex Plugin

Regular review (/codex:review) provides a neutral, read-only code quality assessment, while adversarial review (/codex:adversarial-review) launches a steerable, aggressive examination that attempts to break confidence in the implementation by exposing design-level risks and hidden failure modes.

The openai/codex-plugin-cc repository provides two distinct code review commands that serve different validation purposes. While both leverage the Codex model to analyze repository changes, they differ fundamentally in their prompting strategy, output contracts, and intended use cases. Understanding the difference between adversarial-review and regular review in the Codex plugin helps developers choose the appropriate validation level for their code changes.

Core Architectural Differences

Command Goals and Intent

Regular review aims for neutral validation. It scans for bugs, style issues, and incremental improvements without challenging the underlying design assumptions. In contrast, adversarial review takes an opposing stance—it actively attempts to "break confidence" in the change by hunting for high-cost failure surfaces such as authentication flaws, data loss scenarios, and race conditions.

Prompt Contracts and System Instructions

The commands load different prompt templates from the plugins/codex/prompts/ directory. Regular review uses the standard review prompt defined in plugins/codex/commands/review.md, which provides generic instructions for code analysis. Adversarial review loads plugins/codex/prompts/adversarial-review.md, which explicitly instructs Codex to adopt an adversarial operating stance and prioritize attack-surface analysis over stylistic concerns.

User Steerability and Focus Text

This is where the functional divergence becomes most apparent. Regular review does not accept custom focus text; it evaluates only the repository diff selected by the target-selection logic. Adversarial review accepts free-form focus text after command flags, allowing users to direct the model toward specific design decisions. This text is interpolated into the prompt via the {{USER_FOCUS}} variable, making the review fully steerable.

Output Schema and Finding Bar

Regular review returns a standard structured JSON defined in review-output.schema.json, potentially including style suggestions and low-impact findings. Adversarial review returns a stricter JSON contract that filters out stylistic feedback through a <finding_bar> mechanism. It only reports material, adversarial findings and requires a needs-attention flag for any substantive risk. If no critical issues are found, it returns an approve status.

Practical Usage Examples

Run a regular review for routine code quality checks:

/codex:review --background

Launch an adversarial review challenging a specific caching strategy:

/codex:adversarial-review --base main \
    challenge whether the chosen caching strategy handles network partitions

Use adversarial review to hunt for race conditions specifically:

/codex:adversarial-review --background look for race conditions

Implementation Details in the Source Code

Both commands route through the same entry point in plugins/codex/scripts/codex-companion.mjs. At line 534, the runtime distinguishes between the two modes using a kind parameter:

  • Regular review: kind === "review"
  • Adversarial review: kind === "adversarial-review" (lines 534-562)

The job-control logic in scripts/lib/job-control.mjs stores this metadata, enabling the UI to display appropriate labels and apply the correct prompt template. The adversarial command defined in plugins/codex/commands/adversarial-review.md specifically references the adversarial prompt template, while the regular command in plugins/codex/commands/review.md uses the standard template.

Summary

  • Regular review (/codex:review) provides neutral, read-only validation suitable for quick sanity checks and routine code quality passes.
  • Adversarial review (/codex:adversarial-review) offers steerable, aggressive risk hunting that challenges design assumptions and exposes high-cost failure modes.
  • Key differentiator: Adversarial review accepts custom focus text via {{USER_FOCUS}} interpolation, while regular review uses a fixed prompt.
  • Output distinction: Adversarial review uses a stricter JSON contract with needs-attention flags, filtering out stylistic feedback that regular review includes.
  • Source files: The distinction is implemented in codex-companion.mjs (line 534) and tracked in job-control.mjs via the kind parameter.

Frequently Asked Questions

Can I use adversarial review for every code change?

While technically possible, adversarial review is computationally more intensive and produces focused output on high-risk issues. Reserve it for significant architectural changes, security-sensitive code, or when you need to validate assumptions. Use regular review for routine incremental updates and style checks.

How does the focus text parameter work in adversarial review?

After specifying standard flags like --base or --background, you can append free-form text that Codex uses to steer the analysis. This text replaces the {{USER_FOCUS}} placeholder in plugins/codex/prompts/adversarial-review.md, allowing you to direct the model toward specific concerns like "check for SQL injection vectors" or "verify thread safety."

What happens if adversarial review finds no material issues?

According to the output contract defined in the source code, when no substantive risks are identified, the adversarial review returns an approve status rather than an empty finding list. This differs from regular review, which may return various low-priority suggestions even when no critical bugs exist.

Are the command-line flags identical between the two review types?

Both commands support --base <ref>, --wait, and --background flags. However, adversarial review uniquely accepts trailing focus text after these flags, while regular review ignores any additional text beyond the flags.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →