Repository navigation
feat: Allow, Ask first or Off for each tool (#364) - #365
Merged
Merged
Conversation
Ask first holds a call until the owner approves it under Needs your OK; a yes in the chat is not enough. Like rehearsal, it wraps each changing tool's execute callback at registration, so the tool's own code never runs before the approval, including tools that sometimes skip their own preview (remove-block on one block). After the approval the app's confirm runs the call once, and the tool's own preview step is answered by it. - Off is the existing single-tool switch. - A changing tool that arrives after this ships (a later update, a plugin activated later) asks first until the owner chooses (R3). Every tool that exists on the first run keeps exactly what it does. - Recommended set: one click, only tightens, turns on drafts-only. - Context names the tools that ask first. Modes are protected options. - A spent, made-up or other tool's token never reaches the tool's code. Refs #364 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Settings → Advanced → "What each tool may do" replaces "Turn off single tools": each tool has Allow, Ask first or Off (read tools: Allow or Off), a New tag on a tool that arrived as Ask first, and a "Recommended set" row that applies the set in one click and reloads Safety, since it turns on "Publishing needs my OK". Needs your OK says when only the owner can approve a request. Readme feature line and 1.6.0 changelog. Refs #364 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #364 Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 tasks
This was referenced Oct 13, 2026
# Conflicts: # languages/saddle.pot # readme.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #364
What
Phase 2 of the product plan. Every tool has a mode, Allow, Ask first or Off, set by the owner in Settings → Advanced → "What each tool may do". A tool set to Ask first shows the owner the change and waits under Needs your OK on the Dashboard. It runs only after the owner approves it there; a "yes" in the chat is not enough. A Recommended set applies Ask first to plugins, themes, updates, settings and deletes in one click.
Why
Most of Phase 2 already existed (per-app roles, single-tool switches, the confirm gate, Needs your OK, drafts-only). The missing piece was ASK: a change the owner, not the chat, has to approve. The decisions are in #364.
How
Saddle_Tool_Modes(new). LikeSaddle_Rehearsal, it wraps each changingsaddle/*tool's execute callback at registration (wp_register_ability_args, priority 5, so rehearsal at 10 stays outermost). Until the owner approves, the tool's own code never runs. That matters for tools that sometimes skip their own preview (remove-blockon a single block runs at once). Covers MCP, the REST abilities endpoint, direct calls, Pro and the integrations.Saddle_Approval: the request stores its tool (_saddle_tool).consume_token()refuses a confirm for an Ask-first tool until the owner approved, without spending the token, so the same token works after the approval.run_approved()marks the approved run, so the tool's own preview inside it (delete-post, the drafts-only publish gate) doesn't ask a second time. Ask-first previews carryneeds_owner_approval,approve_atand instructions that say a chat yes doesn't count.gate()was split intorun_confirmed()andpreview(); behaviour for Allow tools is unchanged.saddle_disabled_abilities). Ask first lives insaddle_ask_abilities(autoloaded, small). Both are protected options, so no tool can change them; uninstall removes them.saddle_known_abilitiesrecords every changing tool on the site's first run (lazily, or onadmin_init). A changing tool missing from it later (a new Saddle version, a plugin activated later) asks first until the owner chooses. Tools that exist when a site updates keep exactly what they do.remove-block,divi-remove-module,divi-swap-image). It only tightens: Off stays Off, and it turns on "Publishing needs my OK". Never applied by itself.confirm_tokeninput when the schema is built (R4: new optional parameter only). The context names up to ten tools that ask first, in "What you are allowed to do".Testing
vendor/bin/phpunit: 1532 tests, 9060 assertions, 1 skipped (PHP 8.2). Newtests/tool-modes-test.php, 20 tests.vendor/bin/phpcs: no new findings.npm run lint:jsclean.npm run test:js: 345 passed.npm run buildcommitted.needs_owner_approval, nothing created; early confirm refused (saddle_awaiting_owner); owner approves under Needs your OK; same token creates the post once; reuse refused.WP_DEBUGon in the suite.Notes for review
includes/andadmin/src, plus tests, build and.pot). Fahim's "take whatever decision you need" covered it; flagging it anyway.uninstall.php(two option names added to the list).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.