Repository navigation
Describe the guard's three checks in the server instructions, and drop the keyword scope's exemption list - #215
Merged
Merged
Conversation
…of calling it incomplete Directory review asked, alongside the guard extension that landed in #213 and #214, that the server instructions "no longer describe the guard as incomplete". The financial-transactions paragraph still carried the pre-extension clause "that guard is a safeguard, not a complete filter", and the unit test pinned it. The paragraph now describes what an update call is checked against: by method name (the ICRC ledger methods, neuron management, and financial keywords as whole words, naming transfer, withdraw and swap as examples), by destination (the known financial-service canisters), and by the canister's own published Candid interface (ICRC-1/ICRC-2 methods make it a financial service; a missing or unreadable interface means no update call at all). It states the one thing none of the checks judges, a bespoke value-moving method under an unrelated name on a non-ledger canister, so the limit stays stated rather than implied away, and keeps the redirect. The keyword list, interface markers and canister ids are still not restated, for the same drift reason as before. The test now pins the three checks and the stated limit, pins the old clause out, and checks the three example keywords against the guard so the paragraph cannot name a keyword the guard does not refuse. The two submission docs that described the instructions are aligned. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PruVfYuaS7ZAgNBMTsuRP6
There was a problem hiding this comment.
🟡 Changes recommended
The new instructions incorrectly claim all financial-keyword method names are refused, omitting the control-handover exemptions and misleading clients about available operations.
1 open issue
What changed in this PR
Updates the server instructions to describe the financial guard extended in #213 and #214, replacing the “incomplete filter” wording while preserving the policy and its stated limit. Guard behavior is unchanged.
Changes:
- Describes checks by method name, destination, and published Candid interface.
- Updates assertions to require the new wording and verify the example keywords against the guard.
- Aligns both directory submission documents with the revised instructions.
| File | Description |
|---|---|
docs/openai-directory-submission.md |
Aligns the policy explanation with the three checks and stated limit. |
docs/anthropic-directory-submission.md |
Documents the revised instructions and keyword assertions. |
crates/imcp2-core/src/tools.rs |
Revises server instructions, explanatory comments, and regression assertions. |
Review effort: Balanced
…heck Review on #215 found the rewritten paragraph over-claimed: it said every method name carrying a financial keyword is refused, while the keyword check exempts the control-handover names (`transfer_ownership` and its camelCase spelling), which `exemptions_are_literal` pins. The paragraph now says so in general terms with the one example, and the test pins that example against the guard the same way it pins the three keywords, so the instructions cannot name an exemption the guard does not honour. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PruVfYuaS7ZAgNBMTsuRP6
The list held one name in two spellings, `transfer_ownership` and `transferOwnership`, kept on the OpenZeppelin `Ownable` convention alone: no mainnet interface declaring either could be found when review asked for sources. The list's own rule was that a name with no source does not get in, so it goes (at the maintainer's direction), and a name that carries a keyword is now refused whatever the app means by it. `financial_keyword` no longer consults a list; the module doc records that the exemption was tried and why it went; the tests pin the ownership spellings as refused (`no_name_is_exempt`), the keyword list's well-formedness check loses its exemption half, and the server instructions, their pinning test, the README and both directory submission docs no longer mention an exemption — the test now pins that the instructions mention none and that `transfer_ownership` is refused. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VP2vTGhAZfkTv1hwmKERA3
sea-snake
approved these changes
Oct 28, 2026
aterga
added a commit
that referenced
this pull request
Oct 28, 2026
All three crates share one version. The minor bump carries the financial guard's new scopes (#213, #214, #215): update calls that 0.5.1 allowed — any method name carrying a financial keyword, every update to a canister whose interface declares ICRC-1/ICRC-2 methods, and every update to a canister whose interface is missing or unreadable — are refused now, which is a behaviour change for anyone embedding the crate. Claude-Session: https://claude.ai/code/session_01PruVfYuaS7ZAgNBMTsuRP6 Co-authored-by: Claude <noreply@anthropic.com>
6 of 7 tasks
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
Directory review asked, alongside the guard extension that landed in #213 and #214, that the server instructions "no longer describe the guard as incomplete". The financial-transactions paragraph still carried the pre-extension clause "that guard is a safeguard, not a complete filter, so treat this policy, rather than the absence of a refusal, as the limit", and
financial_policy_is_a_server_instruction_not_a_descriptionpinned it.Two things happen here:
transfer_ownership/transferOwnership. Rather than document the exemption, it is removed: the two spellings were carried on the OpenZeppelinOwnableconvention alone, no mainnet interface declaring either was found, and the list's own rule was that a name with no source does not get in. A name that carries a keyword is now refused whatever the app means by it. This is a guard behaviour change, not only wording.Related issues
Follows #213 and #214 (the guard extension the review asked for) and #212 (the optional unknown-app suggestion). Closes the last item from the directory review's follow-up email.
Changes
Server instructions (
crates/imcp2-core/src/tools.rs):SERVER_INSTRUCTIONS: the financial paragraph describes the three checks: by method name (ICRC ledger methods, neuron management, financial keywords as whole words, namingtransfer,withdrawandswapas examples), by destination (the known financial-service canisters), and by the canister's own published Candid interface (ICRC-1/ICRC-2 methods make it a financial service; a missing or unreadable interface means no update call at all). It states the limit ("Not judged: a bespoke value-moving method under an unrelated name on a canister whose interface is not a ledger's") and keeps the redirect. The keyword list, interface markers and canister ids are still not restated, for the same drift reason as before.financial_policy_is_a_server_instruction_not_a_descriptionpins the three checks and the stated limit, pins the old clause out, checks the three example keywords againstcompliance::disallowed_update_method, and pins that the paragraph mentions no exemption and thattransfer_ownershipis refused. The existing policy-gate scan (model_readable_metadata_respects_marketplace_policy) covers the new text unchanged.Guard (
crates/imcp2-core/src/compliance.rs):EXEMPT_METHODSis removed andfinancial_keywordno longer consults a list; it is a pure whole-word match againstFINANCIAL_KEYWORDS.exemptions_are_literalbecomesno_name_is_exempt(both ownership spellings and three variants refused, with the by-name register);financial_keyword_matches_whole_words_onlygains the two spellings astransfermatches; the generic-names-stay-callable list drops them;keyword_and_exemption_lists_are_well_formedbecomeskeyword_list_is_well_formed.Docs:
README.md: the policy paragraph and thecanister_update_callrow say the keyword rule has no exemptions, sotransfer_ownershipis refused too.docs/anthropic-directory-submission.mdanddocs/openai-directory-submission.md: the sentences describing the keyword rule and what the instructions state are aligned.Testing
CI on the head commit (b6bd546):
test(cargo test --locked --workspace --all-targets),End-to-end (PocketIC),FormattingandScan for internal identifiersall green; Copilot re-review reports no open issues.Locally, on the first two commits:
cargo test --locked -p imcp2-core --lib: 203 passed, 0 failedcargo fmt --all -- --checkclean;cargo clippy -p imcp2-core --all-targets --lockedreports only pre-existing warnings (map_or,repeat().take(), a redundant closure), none in the changed linescargo build --locked --all-targetsfor the whole workspace was not run locally; CI'stestjob covers itnpm test --prefix monitoring/mcp-status(dashboard unchanged)Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01PruVfYuaS7ZAgNBMTsuRP6