warn on auto_approve policy keys that match no registered tool #33
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
During Phase 2 verify, the separator switch left a footgun in
auto_approvepolicy: if the user's config has["boltzmann.list_dir"] = true(old dotted form) and aish's matcher expects["boltzmann__list_dir"], the dotted key silently does not apply. User gets confirm prompts they didn't expect, with no diagnostic.Same risk shape applies if a user typos a tool name or specifies a server alias that isn't connected:
Ask
At aish startup, after MCP sessions are connected and
tools_schema()is populated, walkconfig.mcp.auto_approvekeys and:<alias>__<tool>exists intools_schema. If not, log[aish] auto_approve key '<key>' matches no registered tool.<alias>__*): check the alias has at least one connected session. If not, log similar.Logged once at startup. Non-fatal. Users get a clear signal that their policy file has stale or typo'd entries.
Bonus
If adopted, this also catches the case where someone re-adds a server later (
:mcp connect ...) and their startup-time auto_approve entries for that alias suddenly start mattering — re-run the validation after:mcp connectlands a new session.