Repository navigation
feat!: a command that grants access asks first, and its tool asks for a person - #571
Merged
Merged
Conversation
bim-ba
force-pushed
the
feat/grants-access
branch
from
October 10, 2026 16:58
303e21d to
824f2f3
Compare
… a person An operation that lets someone at data they could not reach says so beside its effect, `grants_access=True`, in its `endpoints.py`. Fourteen do today: access to a form and to a Wiki page, permissions of a Tracker queue and of an entity, access bindings of a DataLens workbook, collection and shared entry, the assignment of a licence, an embedding and its key (#556). Nothing else names them: no list of operations exists. From that one mark: - the CLI asks before it sends such a request, as before a delete, in words of its own ("this grants access"); `--yes` skips the question, and with no terminal the command exits 2 and says to pass `--yes`. `--dry-run` asks nothing. The help of the command says it. - the tool carries `_meta["anthropic/requiresUserInteraction"]`, which Claude Code answers by asking a person on every call, in every permission mode, and by denying the call where nobody can be asked. Its description says so in words for clients that do not read the key. Under `--tool-search` such a tool stays in the listing by its own name, with its mark, and the proxy that runs what the search found refuses it: behind the proxy there would be no entry for a client to read the mark from. - the SDK asks whoever gave it a `confirm`, and nobody otherwise. The three Tracker permission updates ask even when the body only takes rights away: the mark is of the operation. ARCH-3 holds it honest the way it holds effects: the contract test compares the mark of every tool with what its operation says, both ways, and the help of every command with the mark of its tool. BREAKING CHANGE: the fourteen commands that grant access ask for confirmation. A script that called one without a terminal now exits 2: before: ycli wiki access create 7 --role reader --user-uid 9001 after: ycli wiki access create 7 --role reader --user-uid 9001 --yes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bim-ba
force-pushed
the
feat/grants-access
branch
from
October 10, 2026 17:10
824f2f3 to
8646ab9
Compare
This branch was previously deployed
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.
A command that grants access now asks before it sends, as a delete does, and its MCP tool is marked so that the client asks a person. Decisions: #556 (1-A, 3: thirteen operations by metadata, 4-A), #495 (15).
The mark
An operation that lets someone at data they could not reach says so beside its effect, in its
endpoints.py:Endpoint(..., grants_access=True)orRPC(..., grants_access=True). Nothing else names these operations: there is no list of them insrc/.forms.access.grant,forms.access.updatewiki.access.create,wiki.access.updatetracker.queues.permissions_updatetracker.entities.permissions_update,permissions_update_directdatalens.{workbooks,collections,sharedentries}.access_bindings_updatedatalens.licensing.licenses_assigndatalens.embeds.create,datalens.embeds.updatedatalens.embeddingsecrets.createThirteen operations of the decision, fourteen endpoint functions. Not marked, as decided:
forms.surveys.publish, the revokes, andwiki.pages.updatewith an access policy in its body.What follows from it
POST …/pages/7/access — this grants access. Continue?… this grants access. Pass --yes to confirm; there is no terminal to ask on.--yes--dry-run_meta["anthropic/requiresUserInteraction"] = true, and one sentence in its description--tool-searchsearch_tools/call_toolthis tool grants access: call it by its own name, so that the client can ask a personconfirmis asked for these tooA delete keeps its own words ("this deletes data"). The three Tracker permission updates ask even when the body only takes rights away: the mark is of the operation, and their help says so.
The key a client reads
_meta["anthropic/requiresUserInteraction"], read from the vendor's page on 2026-10-10 (code.claude.com/docs/en/mcp, "Require approval for a specific tool"; Claude Code v2.1.214 or later):acceptEdits,autoandbypassPermissions, with no "don't ask again"; allow rules do not skip it;dontAskmode the call is denied, and with--permission-prompt-toolan allow becomes a deny. So a headless agent cannot grant access through these fourteen tools; the CLI with--yesis the way, after a person agreed;Under tool search (found in review)
ycli mcp start --tool-searchreplaces the listing with a search and a proxy that runs what was found. A client reads the mark from a tool's own entry, so behind the proxy nobody was asked:call_tool {"name": "wiki_access_create", …}sent the grant. Now the marked tools are read from their mark and kept in the listing, and the proxy looks at the mark of what it is asked to run. A write that grants nothing still goes through the proxy.Not changed here, a fact for ARCH-3: the proxy carries no annotations at all, so a delete run through
call_toolhas nodestructiveHinteither (measured:tracker_boards_deletethrough the proxy is sent).ARCH-3 changes, with its check (flagged)
ARCHITECTURE.md, ARCH-3, gains the rule and its check in this PR.grants_access; the sentence is in its description on the same conditionwiki_access_create: "the mark is False, the operation True"; the mark put onwiki_access_delete: "the mark is True, the operation False"test_the_help_of_a_command_says_it_grants_access_where_its_tool_is_markedtest_cli_guard.py--yes;--dry-runasks nobody, through the real entry pointtest_mcp_selection.py--read-onlytest_guard.pyWhy the reason is not a field of the plan:
--dry-runprints the plan, and the table formats derive columns from fields.Breaking change
The fourteen commands ask for confirmation. A script that called one without a terminal now exits 2.
SDK signatures and MCP input schemas do not change.
Shared documents and checks touched
ARCHITECTURE.md(ARCH-3),docs/en|ru/how-to/script-the-cli.md, theyandex-360skill and its rulesync renders, the generated CLI / MCP reference,docs/en|ru/how-to/use-in-ci.md, the help of--yeson every command,tests/contract/(one helper,confirmed(case), decides--yesin every contract test that runs a command: the four places intest_contract.pyandtest_output_formats.py).Verified
On this head, over main
97c329f3(0.139.0): ruff, ty, lint-imports (6 kept), ast-grep, pydoclint, gitleaks, rulesync and the generated reference without drift; the full suite: 7047 passed, 5 skipped, coverage 100 %.The live run below is of the first head of this PR; it was not repeated after the review fixes, which change the server under tool search, help texts and docs.
Live (2026-10-10, output kept): the seven scenarios that call a marked command. 5 passed, 4 skipped.
forms/form-contentaccess update(open to all),access grantaccess updateran;access grantskipped: needsGRANTEEtracker/queue-partsqueues permissions-updateGRANTEE)tracker/entity-partsentities permissions-update,-directGRANTEEwiki/page-contentaccess create,access updateGRANTEEdatalens/*(three scenarios)So one of the fourteen ran live here; CI runs the rest where the variables are set. The live runner passes
--yesto every step (e2e/runner.py), so the prompt itself and the no-terminal refusal are held by unit tests only, never by a live run.NOT RUN: the full live run over every service; any check in a real Claude Code session that the key produces the prompt (the vendor's page is the evidence).
🤖 Generated with Claude Code