Skip to content

feat(config): load a project's plugins only after it is trusted - #542

Merged
mrnasil merged 3 commits into
mainfrom
feat/trust-project-plugins
Dec 3, 2026
Merged

mrnasil merged 3 commits into
mainfrom
feat/trust-project-plugins

Conversation

@mrnasil

@mrnasil mrnasil commented Dec 3, 2026

Copy link
Copy Markdown
Member

What

A cloned repository could add commands the model can call and sign-in providers without the user agreeing to it:

  • <project>/.whycodes/plugins.toml
  • <project>/.whycodes/plugins/*/plugin.json (or manifest.json), including kind: "auth" plugins

These files now join the project trust record that already covers the project's MCP and LSP servers. They are left out until whycodes trust, and a changed manifest asks again. Global plugins are not affected.

How

  • config::trust lists the plugin files next to the config servers (one line per file, canonical JSON), so whycodes trust shows them and the store compares them.
  • Shell plugins: ToolExecutor::register_config_plugins and list_shell_plugins drop the project directory when it is not trusted.
  • Sign-in plugins: the three loaders (CLI, shell completion, TUI) skip the project folder when it is not trusted.
  • whycodes plugins prints the same notice as the TUI and whycodes serve.

Behaviour change

A project that ships plugins needs one whycodes trust after upgrading. A project already trusted for its servers is asked again once, because the record now includes its plugin files. WHYCODES_TRUST_PROJECT=1 still trusts everything.

Not covered

  • A script that a manifest points at is not part of the record; only the manifest is.
  • skills/ and agents/ inside project plugin packages are prompt text, not programs, and still load.

Tests

  • project_plugin_files_need_trust_too (config), project_plugins_wait_for_trust (tools), a_project_without_plugin_files_needs_no_trust (plugin)
  • Linux line coverage: whycodes-config, whycodes-plugin, whycodes-tools have no missed lines
  • fmt, workspace clippy -D warnings, budget scripts: ok

🤖 Generated with Claude Code

mrnasil and others added 3 commits December 4, 2026 01:55
A cloned repository could add commands the model can call
(.whycodes/plugins.toml, .whycodes/plugins/*/plugin.json) and sign-in
providers without the user agreeing to it. These files now join the
project trust record next to the MCP and LSP servers: they are left out
until `whycodes trust`, and a changed manifest asks again.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@mrnasil
mrnasil enabled auto-merge (squash) December 3, 2026 23:30
@mrnasil
mrnasil merged commit a4b4448 into main Dec 3, 2026
7 checks passed
@mrnasil
mrnasil deleted the feat/trust-project-plugins branch December 3, 2026 23:53
@mrnasil mrnasil mentioned this pull request Dec 3, 2026
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.

1 participant