Skip to content

Implement Phase231-240 plugin trust enforcement - #22

Merged
mt4110 merged 7 commits into
mainfrom
feat/phase231-240-plugin-trust-v1
May 15, 2026
Merged

mt4110 merged 7 commits into
mainfrom
feat/phase231-240-plugin-trust-v1

Conversation

@mt4110

@mt4110 mt4110 commented May 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add signed plugin manifest verification and enforce-mode lockfile pinning for plugin execution.
  • Add plugin trust reports, sandbox capability artifacts, and permission validation for network/env/write path requests.
  • Bind signed manifests to canonical lockfile entry material, reject lockfile digest mismatches, and reject unknown manifest/lockfile fields before plugin execution.
  • Include plugin trust material in scan cache keys so manifest, lockfile, signature, artifact, sandbox, or permission changes invalidate cached results.
  • Document the plugin trust model, config fields, enforce behavior, and network-deny expectations.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • git diff --check

Notes

  • Unsigned, tampered, lockfile-mismatched, revoked-key, unknown-field, and network-denied plugin scenarios are covered by tests and fail before plugin execution in enforce mode.
  • patchgate_sellable_design_docs.zip remains untracked and is not part of this PR.

@mt4110 mt4110 self-assigned this May 15, 2026
@mt4110 mt4110 added the main mainブランチ label May 15, 2026
@mt4110
mt4110 marked this pull request as ready for review May 15, 2026 11:16
Copilot AI review requested due to automatic review settings May 15, 2026 11:16
@mt4110

mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI 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.

Pull request overview

This PR introduces a manifest-and-lockfile based "plugin trust v1" enforcement layer on top of the existing plugin signature support: in enforce mode, every plugin must be pinned by a signed TOML manifest and a JSON patchgate-plugin.lock, with verified artifact digests, key fingerprints, deny-by-default network/env/write permissions, and a generated trust report. Trust material is also folded into the scan cache key (bumped to v2) so any change in manifest, lockfile, signature, artifact, sandbox, or permissions invalidates cached results. Companion docs and example/policy files describe and propagate the new fields.

Changes:

  • New PluginManifest / PluginLockfile schemas plus verify_plugin_trust_material pipeline (signature, digest, lockfile-binding, permission checks) and a PluginTrustReport / PluginSandboxCapabilityArtifact surfaced on PluginInvocation.
  • Cache key bumped to v2 and extended with a plugin_trust dimension hashing manifest, lockfile, signature, command/arg files, and sandbox profile.
  • New plugins.lockfile_path config + entries[].manifest_path, validation updates (allow manifest_path instead of signature_path, dedupe entry ids), and documentation/examples for the trust model.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
crates/patchgate-core/src/runner.rs Core trust verification, manifest/lockfile parsing, permission resolution, isolated-network plumbing, new tests
crates/patchgate-core/src/model.rs Adds PluginTrustReport and PluginSandboxCapabilityArtifact, embeds trust on PluginInvocation
crates/patchgate-core/src/lib.rs Re-exports new model types
crates/patchgate-core/Cargo.toml Adds toml dep for manifest parsing
crates/patchgate-config/src/types.rs Adds lockfile_path and manifest_path config fields with defaults
crates/patchgate-config/src/lib.rs Validation: dedupe ids, require lockfile_path, accept manifest_path as signature material
crates/patchgate-cli/src/main.rs Plugin trust hash in cache key, schema version bump to v2, tests
config/policy.toml.example Adds lockfile_path to default policy template
docs/26_plugin_trust.md New plugin trust model doc
docs/02_config_reference.md, docs/04_recipes.md, docs/ARCHITECTURE.md, docs/SECURITY.md, docs/trust-boundary.md, sdk/README.md, examples/plugins/python-sample/README.md, mkdocs.yml Doc/nav updates referencing the new fields
Cargo.lock Lockfile entry for toml dep on patchgate-core

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/patchgate-core/src/runner.rs Outdated
Comment thread crates/patchgate-core/src/runner.rs Outdated
Comment thread crates/patchgate-core/src/runner.rs
Comment thread crates/patchgate-core/src/runner.rs Outdated
Comment thread crates/patchgate-cli/src/main.rs Outdated
Comment thread crates/patchgate-config/src/lib.rs
Comment thread crates/patchgate-core/src/runner.rs
Comment thread mkdocs.yml Outdated
Comment thread docs/26_plugin_trust.md
Comment thread examples/plugins/python-sample/README.md Outdated

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

ℹ️ 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 crates/patchgate-cli/src/main.rs Outdated
@mt4110

mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 2fb94f84b0

ℹ️ 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 crates/patchgate-core/src/runner.rs Outdated
@mt4110

mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 68a88ac3f6

ℹ️ 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 crates/patchgate-core/src/runner.rs Outdated
Comment thread crates/patchgate-core/src/runner.rs Outdated
@mt4110

mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

ℹ️ 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 crates/patchgate-cli/src/main.rs
@mt4110

mt4110 commented May 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@mt4110
mt4110 merged commit 2d9e70d into main May 15, 2026
18 checks passed
@mt4110
mt4110 deleted the feat/phase231-240-plugin-trust-v1 branch May 15, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main mainブランチ

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants