Skip to content

feat(cli): review and apply saved SECURITY.md drafts - #489

Open
mldangelo-oai wants to merge 50 commits into
mdangelo/codex/security-policy-draftsfrom
mdangelo/codex/security-policy-command
Open

feat(cli): review and apply saved SECURITY.md drafts#489
mldangelo-oai wants to merge 50 commits into
mdangelo/codex/security-policy-draftsfrom
mdangelo/codex/security-policy-command

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Let an owner apply a SECURITY.md draft after reviewing it. Interactive generation shows the exact diff and asks before writing. --apply loads a saved draft without calling the model.

The remaining stack is #510 for shared command helpers, #536 for read-only drafting, and this PR for review and application. #485 and #505 have merged. The branch includes main through 8a531126.

Changes

# Review or edit the saved SECURITY.md first.
npx @openai/codex-security policy . --apply /path/outside/repository/policy
npx @openai/codex-security policy . --apply /path/outside/repository/policy --write

Use the original repository and --path when applying a component draft. --write requires an existing saved draft; it does not generate one.

  • Check that the draft belongs to the selected repository and component, and that the original and parent policies have not changed. Reject linked draft files and links that would also change another component's guidance or a separate reporting policy.
  • Write the exact draft the owner reviewed, keep any previous file, and verify that future scans can read the result. Report the recovery path if concurrent edits or an interrupted write need attention.
  • Retry verification without rewriting a draft that is already installed. If a retry fails, report that the policy is on disk but still needs verification. Preserve file permissions and support Windows filesystems without hard links.
  • Reuse the drafting step's policy-path code, expose the SDK apply methods, and test the installed package.

Testing

Checks on 8ecde8cb:

  • pnpm run types and pnpm run format: passed.
  • All 155 policy, API, and CLI policy tests passed. The full Bun suite also passed in normal order and with randomized seed 12345: 1,475 passed, 11 skipped, 0 failed in each run.
  • pnpm pack and the package checker: passed, including installed CLI/SDK and bundled-runtime smoke tests.
  • Three fresh native Codex reviews and an independent verifier: no actionable findings. Hosted Codex code and security reviews are also clean on this head.
  • GitHub CI: all required Linux, macOS, and Windows Node 22 checks passed, along with the rest of the Node matrix.

The first CI run exposed a test fixture that relied on a locally installed Python. The fixture now uses its known test interpreter. No test timeouts changed.

Risk and rollout

Merge #510 and #536 first. Applying replaces the selected SECURITY.md and may retain the previous file for recovery. It does not stage, commit, or publish the policy. After interrupted verification, rerun the same saved draft. Keep any reported recovery file until concurrent edits are reconciled. This adds no npm dependencies, does not change saved scan results, and does not publish a package.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

An existing automated review contains a report link that is visible only to its requester. That link and report are not reproduced here.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, b1de4d9394c8c8ef7a155d0246735405186c9a11.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: b1de4d9394

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: b1de4d9394

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/src/security-policy.ts

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 5c0acd8.

@mldangelo-oai mldangelo-oai changed the title feat(cli): generate and review SECURITY.md feat(cli): review and apply saved SECURITY.md drafts Aug 18, 2026
@mldangelo-oai
mldangelo-oai changed the base branch from main to mdangelo/codex/security-policy-drafts August 18, 2026 02:13

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, bfd731c49a5b591f423aad184262ada2d4f3f1f4, against the updated drafting base in #536.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: bfd731c49a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: bfd731c49a

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 8ecde8cbbe34a7fbb74ec7771a4a0bf54d80be78. The follow-up makes the CLI retry test use its fixture Python and preserves read-only permissions when installing a new policy.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 8ecde8cbbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 8ecde8cbbe

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copy link
Copy Markdown
Collaborator Author

@codex review

The final testing notes are updated. The head is still 8ecde8cbbe34a7fbb74ec7771a4a0bf54d80be78; both full test orders, package checks, and GitHub CI passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 8ecde8cbbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 8ecde8cbbe

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant