Codex dependency incident audits for QA turn an urgent package advisory into a controlled evidence-gathering exercise. Instead of immediately upgrading a dependency or rerunning a potentially unsafe build, the team first asks a narrower question: can we prove that this repository is exposed?

This tutorial shows how to run that first pass read-only. You will create a harmless incident fixture, define evidence that confirms or rules out exposure, inspect manifests, lockfiles, CI workflows and lifecycle scripts, classify findings separately by evidence strength and severity, and prepare a remediation plan that remains subject to human approval.

Why the first pass should be read-only

OpenAI’s official Codex dependency incident audit use case recommends starting with an advisory and inspecting repository evidence without installing packages or running untrusted code. It specifically calls out manifests, lockfiles, CI workflows, scripts, vendored artifacts, containers, generated bundles, caches, permissions and token exposure paths.

That boundary matters. Package installation can invoke lifecycle scripts. Builds and tests may import affected code, contact services, read secrets or publish artifacts. An urgent incident is exactly when QA should reduce side effects and preserve evidence.

Audit contract: Codex may read the supplied advisory and repository files, but it must not install, build, test, execute lifecycle scripts, rotate credentials, edit files, clean caches, open a pull request or change an external system unless a reviewer explicitly authorizes a later phase.

What you will test

Use a disposable repository that contains synthetic package names and no real secrets. The fixture should include:

  • a direct dependency in a manifest and lockfile
  • a transitive dependency reachable through that direct package
  • an unrelated package name that appears only in documentation
  • a CI workflow with a synthetic publish permission
  • a harmless lifecycle-script canary represented as text
  • a container or generated bundle reference for one package
  • a test inventory showing which affected feature paths would need regression coverage

Do not execute the canary. Its purpose is to prove that the audit notices a risk-bearing script while remaining read-only.

Step 1: freeze the incident input

Save the authoritative advisory URL, retrieval time, affected package names, affected version ranges, ecosystems, publication time and correction history. If you also have social posts, news reports or vendor discussions, label them as secondary. Do not let a summary silently replace the advisory.

Create an incident ID such as DEP-AUDIT-2026-001 and add it to every screenshot, report and exported table. Record the repository commit, branch, lockfile hash and CI workflow revision. This gives reviewers a reproducible snapshot even if the advisory or repository changes during the response.

Step 2: define proof before inspection

Ask Codex to state what would confirm exposure and what would rule it out before searching. A useful proof table looks like this:

Question Confirming evidence Ruling-out evidence
Is the package present? Resolved affected version in the lockfile No resolved package in any production lockfile
Is it reachable? Dependency path from a shipped component Reference exists only in docs or an unused fixture
Can risky code run? Lifecycle, build, import or plugin path invokes it No execution path in the reviewed snapshot
Could CI amplify impact? Affected job can read a token or publish artifact Job is isolated and has no relevant permission

Presence, reachability and impact are different claims. Require file references for every repository-specific claim.

Step 3: issue a bounded Codex prompt

Audit this repository for exposure to [official advisory URL].
Stay read-only. Do not install packages, run lifecycle scripts, build, test, import code, edit files, rotate credentials, clean caches, push, or open a pull request.

First summarize affected packages and version ranges. Separate authoritative sources from secondary reports. Define evidence that would confirm or rule out exposure.

Inspect manifests, lockfiles, CI workflows and permissions, install/build/postinstall scripts, containers, vendored or generated artifacts, and relevant cache or token paths.

Return one row per finding with: incident_id, component, dependency_path, file_reference, evidence_status, severity_if_confirmed, confidence, caveat, recommended_next_step. Use only confirmed exposure, needs verification, or ruled out for evidence_status.

Keep the prompt in the incident record. A stable output contract makes reruns comparable and prevents a polished narrative from hiding missing evidence.

Step 4: verify read-only behavior independently

Instructions are not enforcement. Before and after the run, capture git status, a directory inventory and hashes for the manifest, lockfiles and workflows. Check that there are no new commits, branches or untracked files. Review the terminal transcript for install, build, test, import, cleanup and package-manager commands.

If the environment exposes approval controls, keep write and command actions at review-required settings. Use no production tokens. For a stronger canary, place a synthetic value such as QA_AUDIT_TOKEN=not-a-secret in an isolated test environment and verify it never appears in output.

Step 5: inspect every dependency representation

A manifest gives intent; a lockfile gives resolution. Compare both. Search all supported package-manager files, monorepo workspaces, optional and development dependencies, container definitions, generated bundles, vendored directories and deployment artifacts. Note which files are production inputs.

For each match, reconstruct the dependency path. A direct manifest entry is easy, but a transitive package may be introduced by several parents. Do not merge distinct paths into one finding. Different parents may have different reachability, ownership and remediation options.

Test aliases, renamed packages, multiple lockfiles, stale lockfiles, platform-specific sections and a package string that exists only in documentation. The last case should be ruled out rather than reported as exposure.

Step 6: inspect CI and lifecycle amplification

Review install commands, flags, lifecycle scripts, build plugins, test setup, code-generation steps and publishing jobs without executing them. Map which jobs can read secrets, write caches, upload artifacts, publish packages or modify releases.

A vulnerable version in a lockfile can be high severity but still need verification if the reviewed workflow never reaches it. Conversely, a seemingly narrow development dependency deserves more attention when a privileged publish job executes its lifecycle path. The report must show this reasoning rather than collapse everything into a single risk score.

Step 7: separate evidence status from severity

Use exactly three evidence states:

  • Confirmed exposure: repository evidence proves an affected version and relevant path.
  • Needs verification: evidence is incomplete, ambiguous or outside the repository.
  • Ruled out: the reviewed snapshot contains evidence that excludes the claim.

Then score severity only as an impact estimate if the finding is real. A critical advisory with no repository exposure is not a critical repository finding. A low-confidence match must not be presented as confirmed merely because the potential impact is high.

Step 8: challenge the result with seeded cases

Run the audit against controlled variants:

  1. Affected direct version in both manifest and lockfile: expect confirmed.
  2. Affected transitive version with a resolvable parent path: expect confirmed.
  3. Package name only in a README: expect ruled out.
  4. Manifest and lockfile disagree: expect needs verification.
  5. CI permission is present but package execution is unclear: expect needs verification.
  6. Malformed lockfile or missing workspace file: expect an explicit evidence gap, not a clean bill of health.

Compare the structured fields, file references and side-effect checks across trials. A useful automation test validates allowed status values, unique finding IDs, required evidence fields and absence of secrets. Human reviewers still decide whether the reasoning supports the label.

Step 9: plan remediation as a separate phase

After a reviewer accepts the exposure report, ask Codex to propose—not apply—a remediation plan. Each confirmed finding should include the dependency or workflow change, files or settings to update, a focused verification step, rollback plan and any credential review that must happen outside the repository.

Keep credential rotation, cache invalidation, package updates and CI changes behind explicit ownership and approval. A dependency bump can alter transitive resolution or application behavior, so the plan should name regression areas: startup, authentication, serialization, network handling, plugin loading, build reproducibility and artifact integrity as relevant.

Step 10: verify the approved change

Only after authorization, create a clean branch and implement the smallest reviewed change. Regenerate the lockfile using the team’s trusted environment. Compare the dependency graph before and after, confirm the affected path is gone, rerun focused tests, then run the broader regression suite according to risk.

Re-execute the read-only audit against the remediated commit. The result should reference the new snapshot and explain why exposure is ruled out. Preserve the original report, approved plan, diff, test evidence and final audit together.

QA release checklist

  • Official advisory and retrieval time are recorded
  • Repository commit and lockfile hashes identify the snapshot
  • Confirming and ruling-out evidence were defined first
  • Manifest, lockfile, transitive paths, scripts, CI, containers and artifacts were inspected
  • No install, build, test or lifecycle code ran during the audit
  • Git, filesystem, terminal and remote side effects were checked independently
  • Every finding has a file reference and stable ID
  • Evidence status and severity are separate fields
  • Malformed, stale, missing and documentation-only cases were tested
  • No secrets or customer data appear in prompts or reports
  • Remediation is a separate human-approved phase
  • The final fix has dependency-graph, regression and rollback evidence

Official source

The central QA lesson is simple: speed comes from narrowing uncertainty, not from rushing the first patch. A defensible Codex audit preserves evidence, avoids execution, labels uncertainty honestly and gives humans a reviewable bridge from advisory to verified remediation.