Repository navigation
docs: correct tool permission examples and read-only guidance (refs #212) - #215
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 PR Review: #215 docs: correct tool permission examples and read-only guidanceDocs and examples only, with nothing in Overall: looks good. The
|
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. v4 also adds the missingtool-errorcase, so denied calls show up in the output.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(1390 tests passed),npm run format:check,npm run buildandgit diff --checkall passed.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.