Repository navigation
docs: correct tool permission examples and read-only guidance (refs #212) [v6] - #216
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @ben-vargas's task in 15s —— View job Review of PR #216I read the full diff against Verdict: looks good. I found no blocking issues. The changes are docs and examples only, and the What's good
Minor suggestions (non-blocking)
The CHANGELOG entry is accurate and sits correctly under Unreleased → Fixed. |
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.
Refs #212
Follow-up to #213/#214. Changes docs and examples only; nothing in
src/changes.What changed
examples/mcp-filesystem.tsis now actually read-only. It previously usedbypassPermissions, which approves every tool, so theallowedTools"restriction" did nothing andwrite_filesucceeded. It now usespermissionMode: 'dontAsk', with only the three MCP read tools pre-approved. The prompt ends with awrite_fileprobe aimed at a file inside a temporary directory created for that run.permissionDenialsmetadata records that exact tool call ID, there was no stream error, and no probe file exists.finallyblock removes only the run-owned directory.Deletewas never a Claude Code tool, and current CLIs no longer haveNotebookRead. Both are gone from both guides andtool-management.ts.LS(also not in the current CLI) is replaced in the current-version docs and examples, and kept in the 0.x guide, where it was a real tool.Write/Editis not read-only, because Bash can still write.tools: ['Read', 'Grep', 'Glob'], with MCP tools restricted separately.disallowedTools: ['Write', 'Edit', 'MultiEdit', 'NotebookEdit', 'Bash'], checked against the tools in@anthropic-ai/claude-code1.0.24.toolsis labeled "provider 2.3.0+ on 2.x, or 3.1.0+", anddontAsk"3.2.0+". The MCP pattern that works in every version is listing the server's write tools indisallowedTools.examples/README.md: the "MCP tool allowlists" wording is corrected. CHANGELOG entry under Unreleased → Fixed. No version bump.Example runs
Run from a scratch cwd with
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1set through the providerenv, using the/private/tmprealpath as the target.mcp__filesystem__write_filereturned a result, and the probe file existed after the run.list_allowed_directories,list_directoryandread_text_filereturned the file contents.write_filefailed with "Permission to use mcp__filesystem__write_file has been denied because Claude Code is running in don't ask mode". The run ended with "Write blocked: the permission system denied write_file, and no probe file was created", exited 0, and left no directory behind.tool-management.tsalso ran cleanly.Commands run
npm run lint,npm run typecheck,npm test(1156 tests passed),npm run format:check,npm run buildandgit diff --checkall passed (lint keeps 2 existing warnings).Independent review (Codex gpt-6-astra, xhigh)
dontAskwas recommended in the 1.x–2.x guide without a version label; the probe passed on file absence alone; cleanup was skipped when the stream threw.