Repository navigation
Mark canister create/top-up as destructive: they spend user funds - #117
Merged
Merged
Conversation
icp_create_canister and icp_top_up_canister were annotated destructive_hint = false as "additive" writes: they add a canister or add cycles to one. That reads the wrong axis. Both spend the user's cycles or ICP — the funds leave the user's ledger accounts irreversibly, nothing in this tool surface can claw them back, and neither call is idempotent, so a client retry spends again. destructiveHint is what a client gates its confirmation prompt on, and its spec default is true: declaring false was an affirmative promise that a stray call costs the user nothing. Both are now destructive_hint = true, their descriptions open with a SPENDS-FUNDS warning telling the model to confirm with the user first, and the annotation test moves them into the destructive group with the reasoning recorded so they are not "corrected" back to additive later. Start/stop stay non-destructive: they change run state only, cost nothing, and each is undone by its counterpart. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TGhwpdTbUqQbR5AiiN8Ljw
There was a problem hiding this comment.
Pull request overview
Marks canister creation and top-ups as destructive because they irreversibly spend user funds.
Changes:
- Adds explicit fund-spending warnings to both tool descriptions.
- Sets
destructive_hint = true. - Updates annotation tests and rationale.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sea-snake
approved these changes
Aug 3, 2026
3 tasks done
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.
Summary
icp_create_canisterandicp_top_up_canisterwere annotateddestructiveHint: false, grouped with start/stop as "additive/reversible" writes: they add a canister, or add cycles to one. That reads the wrong axis. Both spend the user's cycles or ICP: the funds leave the user's cycles-ledger or ICP-ledger account irreversibly, nothing in this tool surface can claw them back, and neither call is idempotent — a retry spends again (the ICP path is explicitly best-effort, single-attempt).destructiveHintis what a directory client gates its confirmation prompt on, and the MCP spec's default for the hint istrue— so declaringfalsewas an affirmative promise that a stray call costs the user nothing. This matters directly for the directory submissions: both portals scan the descriptor, and an "incorrect action label" is a named rejection cause. Fixing it in the source (rather than overriding in a portal) keeps the listed server, the scan, and the review answers consistent.Start/stop stay non-destructive: they change run state only, cost nothing, and each is undone by its counterpart.
Related issues
Follows #116 (consent-screen terminology) in the pre-submission cleanup series; supports the directory submissions prepared in #109 and #115.
Changes
src/tools.rs:icp_create_canisterandicp_top_up_canister:destructive_hint = false→true, with a comment recording the reasoning at each annotation.Testing
cargo build --locked --all-targets— no new warningscargo test --locked --all-targets— 151 lib + 2 bin + 8 router tests pass (including the updated annotation test), re-run after rebasing ontomainwith Use Internet Identity's access-level wording in the runtime messages #116cargo fmt --all/cargo clippy --all-targets— not run: the toolchain here reformats ~380 untouched files, which would bury the changenpm test --prefix monitoring/mcp-status— n/a, dashboard unchangedChecklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01TGhwpdTbUqQbR5AiiN8Ljw
Generated by Claude Code