Skip to content

refactor(plugin): port security policy resolution to TypeScript - #799

Open
kmbroai wants to merge 8 commits into
dev/kyleb/python-free-windows-wide-pathsfrom
dev/kyleb/python-free-policy-resolver
Open

refactor(plugin): port security policy resolution to TypeScript#799
kmbroai wants to merge 8 commits into
dev/kyleb/python-free-windows-wide-pathsfrom
dev/kyleb/python-free-policy-resolver

Conversation

@kmbroai

@kmbroai kmbroai commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the Python SECURITY.md resolver and its tests with a typed helper bundled alongside the MCP runtime. Policy discovery and root-to-leaf guidance use the existing Node launcher.

Changes

  • Enforce scan-root containment and preserve symlink and junction behavior, byte limits, UTF-8 handling, home expansion, inventory ordering, accepted arguments, and output formats.
  • Preserve POSIX path bytes and Windows UTF-16 process values and paths; establish Windows ancestry by comparing native volume and file identities while walking parent directories.
  • Invoke launch_codex_security_mcp[.cmd] --helper resolve-security-md --repo PATH [--list | --scope PATH] [--out PATH], defaulting to stdout. Limit the SDK's Python interpreter instruction to .py helper scripts.
  • Keep operator guidance focused on accepted options, quoted tilde paths, and output behavior. Replace complete Markdown snapshots with semantic source/content/order assertions and dedicated framing checks.
  • Retain the compatible path resolver after native realpath comparisons showed different existing-file parent behavior. Remove the completed characterization probe and describe the active TypeScript policy helper in the native documentation.

Testing

  • SDK/MCP type checks, formatting, CI-tool compilation, Rust formatting, both MSVC-target Clippy checks, Ruff, portable source checks, and all nine checker tests passed.
  • Focused policy/launcher tests passed: 34 passed, with five Windows-only tests skipped locally. All 12 adapter normalization tests passed.
  • Windows x64/arm64 CI exercises the actual helper and native binding, including directory-identity checks for scope and policy paths. The raw-path proof also runs on Node 20 and 22.
  • Existing behavioral tests retain argument parsing, home expansion, file-parent resolution, missing-path, symlink-cycle, ordering, and raw-byte coverage.

Risk and rollout

Stacked on #798. The helper entrypoint changes from the Python script to the shared launcher, with callers updated together. Previously accepted arguments and home expansion remain supported intentionally. GNU Linux file/.. compatibility requires retaining the existing resolver; native realpath is not a drop-in replacement. Other Python helpers remain for subsequent migration slices. There are no new top-level CLI flags.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 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
🔒 Security Review Completed 2026-09-07T11:36:06.721490Z 90e02bd New commits

Security findings

Blocking findings (1)

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

@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 1eb78b2 to 7a77479 Compare September 3, 2026 18:28
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 7a77479 to 2228b64 Compare September 3, 2026 19:19
Comment thread plugins/codex-security/mcp-app/src/helpers/posix-path.ts
Comment thread plugins/codex-security/mcp-app/src/helpers/resolve-security-md.ts
Comment thread plugins/codex-security/mcp-app/src/helpers/resolve-security-md.ts
Comment thread sdk/typescript/tests-ts/security-policy-helper.test.ts Outdated
Comment thread plugins/codex-security/references/security-guidance.md
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 2228b64 to 0216913 Compare September 4, 2026 22:46
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 0216913 to ad511ed Compare September 4, 2026 23:50

@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: ad511edcbb

ℹ️ 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 plugins/codex-security/scripts/launch_codex_security_mcp

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed the exact current head and reconciled all prior threads. The compatibility behavior is well covered; the remaining comments are nonblocking simplification and documentation cleanup.

Comment thread plugins/codex-security/native/proof.mts Outdated
Comment thread plugins/codex-security/mcp-app/src/helpers/resolve-security-md.ts
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from ad511ed to 9986e31 Compare September 5, 2026 01:25
Comment thread plugins/codex-security/references/security-guidance.md Outdated
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 9986e31 to 90e02bd Compare September 7, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants