Skip to content

feat(plugin): add checked SECURITY.md inputs - #564

Open
mldangelo-oai wants to merge 18 commits into
mainfrom
mdangelo/codex/policy-inputs
Open

feat(plugin): add checked SECURITY.md inputs#564
mldangelo-oai wants to merge 18 commits into
mainfrom
mdangelo/codex/policy-inputs

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

Policy drafting needs a checked view of the selected SECURITY.md, its inherited scanner guidance, and related policies. This adds that view to the bundled resolver so callers do not repeat discovery and path validation. It supplies the input-handling portion of #536 without adding a top-level codex-security policy command.

Changes

  • Add --inspect --scope <directory>, returning previousContent, root-to-scope guidance, and sorted repository-relative policyPaths.
  • Add scoped --list and repeatable --git-dir <directory> exclusions, with documentation for defaults, path bases, JSON fields, and Git metadata discovery.
  • Preserve ordinary read-only resolution for missing, broken, non-file, symbolic-link, hard-link, and directory-link cases while applying strict checks to the selected editable destination.
  • Share filesystem-identity containment, regular-file, UTF-8, and 1 MiB checks across resolver modes. Keep reporting policies separate from repository-wide scanner guidance.
  • Advance the bundled plugin from 0.1.22 to 0.1.23 and verify that cached plugin content is refreshed before the new resolver inputs are exposed.

Testing

  • bun test --timeout 30000 tests-ts/security-policy-inputs.test.ts: 14 passed, 0 failed.
  • bun test --timeout 30000 --seed 12345 ./tests-ts: 1,609 passed, 28 platform or opt-in skips, 0 failed across 89 files.
  • pnpm run types: passed.
  • pnpm run format: passed.
  • pnpm run build: passed.
  • Python AST parsing and git diff --check origin/main...HEAD: passed.
  • pnpm pack and node scripts/check-package.mjs <tarball>: passed with 255 archive entries. The check validated the public import, NodeNext types, CLI, 111 bundled plugin files, bundled Codex version, and a nested worker without global Codex.

Risk and rollout

Existing resolver modes remain available. Inspection does not edit policy files or authorize a later write. Callers must supply separate or shared Git metadata directories when applicable. The bundled plugin version changes, but this PR does not publish a package, add dependencies, or add a top-level CLI command. A later package release is required for consumers to receive the update.

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.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, d9e69cfaebcca679312571689410d8b57f2c36ae, against main.

@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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9e69cfaeb

ℹ️ 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".

Comment thread sdk/typescript/_bundled_plugin/scripts/resolve_security_md.py Outdated
@mldangelo-oai mldangelo-oai changed the title Share checked SECURITY.md inputs refactor(plugin): share checked SECURITY.md inputs Aug 18, 2026
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review August 20, 2026 21:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-22T15:13:48.504066Z 8b5a16a Manual request
🔒 Security Review Completed 2026-08-20T21:52:02.892900Z d9e69cf Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30a9b3f6f4

ℹ️ 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".

Comment thread sdk/typescript/_bundled_plugin/scripts/resolve_security_md.py
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 119439ba0edf99c2bc301e0cb17c3a5c824e957c, against main.

This head addresses the earlier hard-link and documentation findings, refreshes cached bundled plugins, skips absent optional reporting policies, and merges main through 7828456b. Both full-suite orders and the three-pass local review gate passed.

@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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 119439ba0e

ℹ️ 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".

Comment thread sdk/typescript/_bundled_plugin/scripts/resolve_security_md.py
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 61bfbdf8d3b83f2a224b3d8f6c3f2e00f391e91d, against main.

This follow-up addresses the dangling-policy-link finding: inspection rejects broken repository-local policy links while ordinary read-only resolution keeps its previous behavior. The regression was reproduced before the fix, and both full-suite orders and the three-pass local review gate passed.

@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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61bfbdf8d3

ℹ️ 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".

Comment thread sdk/typescript/_bundled_plugin/scripts/resolve_security_md.py
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 02ba96cf5e2d2065e6d881b460d3e25dc78fb92e, against main.

This head restores the existing file-only filter in ordinary read-only resolution while keeping inspection strict, and merges main through 4fbc859d. A 20-case compatibility comparison, both full-suite orders, and the three-pass local review gate passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 02ba96cf5e

ℹ️ 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".

@mldangelo-oai mldangelo-oai changed the title refactor(plugin): share checked SECURITY.md inputs feat(plugin): add checked SECURITY.md inputs Aug 21, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Aug 21, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head commit bdc337fa96e80ba52dd86876e64c56df7a295543 against main. Focus on the strict inspection versus legacy read-only resolver contract, filesystem-identity containment, Git metadata exclusion, link handling, documentation, and current-main merge semantics. Keep the public response limited to review results and public links.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review exact head commit bdc337fa96e80ba52dd86876e64c56df7a295543 against main. Focus on repository containment, Git metadata aliases, symbolic and hard links, editable-target checks, and whether inspected policy content can escape the requested repository boundary. Keep the public response limited to review results and public links.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdc337fa96

ℹ️ 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".

Comment on lines 154 to 155
if policy.is_file() or policy.is_symlink():
policies.append(policy.relative_to(root).as_posix())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep directory links out of the read-only inventory

When a repository contains a SECURITY.md symlink whose target is a directory, os.walk classifies that entry as a subdirectory, but this unconditional path probe now adds it because policy.is_symlink() is true. The legacy --list implementation skipped this case via the filenames check, and the documented inventory promises linked policy files rather than directory links; callers can therefore receive a non-file as a policy candidate. Preserve the strict inspection rejection while filtering directory links from read-only --list output.

Useful? React with 👍 / 👎.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Exact head: 8b5a16a8271ebedc4a3a41e96fc834d5e5e2f310.

@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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b5a16a827

ℹ️ 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".

chain = _policy_chain(root, directory)
selected = chain[-1]
contents = {selected: _read_policy(root / selected, root, git_dirs, editable=True)}
paths = set(list_security_md(root, directory, git_dirs))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate descendant directory policy entries

When --inspect --scope component encounters a descendant such as component/child/SECURITY.md that is a directory or a symlink/junction to one, os.walk classifies it as a subdirectory and the read-only inventory deliberately filters it out, so reusing that inventory here makes inspection succeed with the entry absent from policyPaths instead of enforcing the advertised regular-file and containment checks. Fresh evidence at this exact head is that the new regression covers only a directory link at the selected destination, which _read_policy(..., editable=True) rejects before this inventory runs; the same link below the selected scope is silently omitted. Keep the --list filtering, but separately surface these descendant entries for strict inspection validation.

AGENTS.md reference: sdk/typescript/AGENTS.md:L22-L24

Useful? React with 👍 / 👎.

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