Skip to content

fix(sdk): bind workbench Git to a trusted executable - #467

Draft
mldangelo-oai wants to merge 37 commits into
mainfrom
mdangelo/codex/trust-repository-git-executable
Draft

fix(sdk): bind workbench Git to a trusted executable#467
mldangelo-oai wants to merge 37 commits into
mainfrom
mdangelo/codex/trust-repository-git-executable

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

Keep repository-controlled Git shims out of bundled Python scan helpers. The SDK
selects Git outside the scan and knowledge-base repositories, then passes that
binding to the workbench and MCP process. Python does not search its inherited
PATH for Git.

Changes

  • Select Git from the sanitized scan environment and protect the outermost scan
    repository plus canonical knowledge-base source repositories.
  • Revalidate the host-selected absolute executable in Python. Missing or stale
    bindings return the existing optional-Git status 127 without a PATH lookup.
  • Preserve native Windows executable aliases while rejecting batch targets.
  • Route rank and inventory probes through the shared Git runner, with repository
    hooks, filesystem monitors, external diff drivers, and text conversion disabled.
  • Merge current main, retain its concise README, remove a single-use fixture
    helper, and avoid an unrelated rewrite of the public environment helper.
  • Refresh the paired bundled-plugin version to 0.1.89. CODEX_SECURITY_GIT is
    generated runtime data, not a supported user setting.

Testing

Local first-pass verification:

  • Types, formatting, build, and Ruff checks passed.
  • Python 3.10 syntax checks passed for all four changed Python modules.
  • Ten affected test files: 339 passed, 17 skipped, no failures.
  • Final API/diff-ranking rerun after simplification: 136 passed, two skipped,
    no failures. Tests cover host/Python binding parity, knowledge-base sources,
    nested worktrees, unavailable Git, rank/inventory helpers, and Windows rules.

After merging main 01bd062, 295 Git-binding/runtime/API tests passed with
17 platform skips. Both real cache upgrades from 0.1.60 and 0.1.63 matched all
118 installed files and preserved credentials. Types/models, formatting,
build, static package validation and full installed-package smoke passed again.
The Git-binding implementation is unchanged by this final version-field merge.

The full suite and native Windows execution were not repeated. New-head CI is
left for the second pass, without delaying the remaining PR updates.

  • Final main refresh (fd98a90): package 0.1.21 includes the MCP launcher-permission fix; feature source and bundled payload are unchanged. Types/model generation, formatting, build, 28 focused package/report/launcher tests, static artifact verification and full installed-package smoke passed, including MCP initialization. CI was not awaited.

Risk and rollout

No new CLI flag, supported environment setting, dependency, npm version, or root
package export. The public pluginExecutionEnvironment signature is unchanged.
The SDK overwrites the internal Git binding for its children.

Git remains optional for directory scans, while diff scans still require it.
Safe operator Git and SSH settings remain available; repository execution hooks
stay disabled during probes. This remains a draft PR and publishes no release.

Public disclosure review

The current update and public PR surface have been reviewed. Existing automated
comments contain access-restricted report links, so the second attestation
remains unchecked.

  • 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.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@github-actions github-actions Bot added the bug Something isn't working label Aug 15, 2026

@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: 5dc0f1c298

ℹ️ 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/src/api.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 5dc0f1c298

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.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 9be47a60bb

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.

@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: 9be47a60bb

ℹ️ 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/src/api.ts Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_target.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 49000ab013

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.

@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: 49000ab013

ℹ️ 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/workbench_target.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_target.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 78123a7e99

ℹ️ 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: 78123a7e99

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, 743e32f028ab8bb71e5d2607f1b30832269aabba.

@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: 743e32f028

ℹ️ 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/src/api.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 743e32f028

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, c0142c5739652cff10467b6b5285ca5193c013a9.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: c0142c5739

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.

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

ℹ️ 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/src/api.ts Outdated

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 76b9e906611b3e9707d4e4b83f0e2bfad81419e7, after the additive main merge and compatibility fixes. Please check explicit Git and ripgrep settings, Windows path handling, Python Git probes, and the existing repository-input protections.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 76b9e90661

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

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review the current head 76b9e906611b3e9707d4e4b83f0e2bfad81419e7.

@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: 76b9e90661

ℹ️ 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/src/multiscan.ts Outdated
Comment thread sdk/typescript/src/api.ts Outdated

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 0552695. The additive follow-up fixes the launch-directory exclusion and checks bundled-ripgrep staging against all actual protected inputs. The affected tests, installed-package checks, strict TypeScript consumers, and both full suites pass. The PR remains draft.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 055269586a

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

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review the current head 055269586a148c0f0fc1fa08025deeb00ef3f434.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 055269586a

ℹ️ 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 fix(git): pin trusted executables across scan hosts fix(sdk): bind workbench Git to a trusted executable Aug 22, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review exact head 8f4f32a47b703c4f452e702d63fa708e91d22dbd against current main.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 8f4f32a47b703c4f452e702d63fa708e91d22dbd against current main.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 22, 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-22T07:02:13.148799Z 8f4f32a Manual request
ℹ️ 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

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

Copy link
Copy Markdown

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

Reviewed commit: 8f4f32a47b

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

@kmbroai kmbroai 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.

Critical review

Reviewed head 8f4f32a47b703c4f452e702d63fa708e91d22dbd, including the earlier executable-selection feedback.

Recommendation: keep this narrowed trusted-Git binding. No new blocking defect found in the reviewed changes. Host inspection is ineffective if the Python helper later performs a fresh PATH search inside the scan environment. Carrying the inspected invocation into the helper closes that gap without requiring a general tool-distribution subsystem.

Correctness and earlier comments

trusted_git_executable checks both lexical and canonical containment, preserves the invocation name for wrappers/multicall binaries, and validates native Windows invocation semantics without requiring an extension on the resolved native target. Missing/unusable binding returns the optional-Git failure status without executing the literal fallback string.

The host now retains the sanitized environment even when no executable is found. It derives protected roots from the selected filesystem inputs, not Git's configurable core.worktree, and carries the binding through .mcp.json. Inventory/ranking Git calls use the shared command wrapper with external diff/textconv disabled. This addresses the substantive earlier selection and invocation-path concerns.

The public CODEX_SECURITY_GIT configuration/disable proposal and bundled-ripgrep staging were removed. The current README correctly describes this variable as host-generated runtime data, so the old requests to preserve user overrides do not apply to the narrowed contract.

Simplification and limits

This is a good place to stop the abstraction: one inspected executable/environment pair and Python revalidation of the same binding. Do not reintroduce separate Git/ripgrep installers, broad launch-directory restrictions, or per-tool configuration flags without a demonstrated requirement.

The shared resolver still needs the distinction between a null executable and a sanitized environment; collapsing that back to null would recreate the earlier bug. Do not describe the binding as a cryptographic executable pin or a general sandbox—it establishes the selected trusted path under the repository-input threat model.

Verification

Ran four resolver/launcher/workbench suites: 13 passed, 2 skipped, 0 failed, then seven focused API/runtime Git integration cases: 7 passed, 0 failed. These include actual nested-repository shim rejection and an MCP launch with empty PATH. Linux, Bun 1.3.14 / Node 22.13.1 with cached dependencies. Native Windows alias behavior was source-reviewed but not executed on Windows; no model call occurred.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants