Skip to content

Bind plugin hook approval to plugin contents - #54619

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/faaf7658210d8adb2534ddd614c72ec993920840
Oct 16, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/faaf7658210d8adb2534ddd614c72ec993920840

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Bind plugin hook approval to plugin contents

Why

A plugin's scripts can change without changing its hook declaration. Declaration-only approval therefore lets changed plugin code run under an existing hook approval.

What changed

  • Fingerprint plugin bundle contents and include the content hash in the approval value returned by hooks/list. Persist it as trusted_content_hash, keeping trusted_hash compatible with older clients.
  • Verify contents before each command or MCP hook execution, within the hook's timeout, and require renewed approval when approved contents change.
  • Migrate legacy declaration-only approvals to a shared, immutable content baseline per plugin and config home.
  • Exclude generated Python bytecode, .venv, and .egg-info entries from fingerprints. Run app-server hook listing on blocking tasks.

Testing

Extend integration coverage for plugin upgrades and rollbacks requiring approval, same-turn script changes preventing further hook execution, shared legacy approval baselines, and generated Python artifacts preserving trust.

## Why

A plugin's scripts can change without changing its hook declaration. Declaration-only approval therefore lets changed plugin code run under an existing hook approval.

## What changed

- Fingerprint plugin bundle contents and include the content hash in the approval value returned by `hooks/list`. Persist it as `trusted_content_hash`, keeping `trusted_hash` compatible with older clients.
- Verify contents before each command or MCP hook execution, within the hook's timeout, and require renewed approval when approved contents change.
- Migrate legacy declaration-only approvals to a shared, immutable content baseline per plugin and config home.
- Exclude generated Python bytecode, `.venv`, and `.egg-info` entries from fingerprints. Run app-server hook listing on blocking tasks.

## Testing

Extend integration coverage for plugin upgrades and rollbacks requiring approval, same-turn script changes preventing further hook execution, shared legacy approval baselines, and generated Python artifacts preserving trust.

GitOrigin-RevId: faaf7658210d8adb2534ddd614c72ec993920840
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/faaf7658210d8adb2534ddd614c72ec993920840 branch from 8ebca31 to 2bf2bdf Compare October 16, 2026 14:38
@copyberry
copyberry Bot merged commit 2bf2bdf into main Oct 16, 2026
5 of 8 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/faaf7658210d8adb2534ddd614c72ec993920840 branch October 16, 2026 14:38
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-16T14:38:36.672266Z 8ebca31 PR opened
ℹ️ 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.

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants