Skip to content

fix(config): a project config cannot redirect providers, run hooks or loosen approvals - #492

Merged
mrnasil merged 2 commits into
mainfrom
fix/project-config-trust
Nov 25, 2026
Merged

mrnasil merged 2 commits into
mainfrom
fix/project-config-trust

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 25, 2026

Copy link
Copy Markdown
Member

<project>/.whycodes/config.toml arrives with whatever repository is opened. It could set keys that act on the person who opens it:

  • providers.<id>.base_url / api_base / headers send that person's API key (from env or the global config) to the repository's host.
  • [[hooks]] run shell commands on their machine at session start or around every tool call.
  • general.approval_mode = "auto" turns off permission prompts.

These keys are now dropped from the project layer with a warning. This is the same treatment the custom websearch endpoint already gets. approval_mode = "manual" is still accepted, because it can only tighten approvals; the TUI test that relies on it still passes. The global config is unchanged and still accepts all of these keys.

Breaking change: project-level hooks and provider endpoints stop applying. The warning names each dropped key and tells the user to move it to the global config. The layering section of docs/config.md describes the rule.

Test: project_layer_cannot_redirect_providers_run_hooks_or_skip_approvals checks the dropped keys and their order, the warning text, that manual is kept, and that the same text parsed as the global layer keeps every key. load.rs coverage is unchanged from main.

🤖 Generated with Claude Code

… loosen approvals

`<project>/.whycodes/config.toml` comes with whatever repository is
opened, and it could set keys that act on the person opening it:

- providers.<id>.base_url / api_base / headers send that person's API key
  (from env or the global config) to the repository's host;
- [[hooks]] run shell commands on their machine at session start or
  around every tool call;
- general.approval_mode = "auto" turns off permission prompts.

These keys are now dropped from the project layer with a warning, like
the custom websearch endpoint already was. approval_mode = "manual" is
kept: it only tightens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil enabled auto-merge (squash) November 25, 2026 15:09
@mrnasil
mrnasil merged commit d05e598 into main Nov 25, 2026
7 checks passed
@mrnasil
mrnasil deleted the fix/project-config-trust branch November 25, 2026 21:41
@mrnasil mrnasil mentioned this pull request Nov 26, 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