Part 6 · Inside a Production Coding Agent

ToolKind Provides Default Read-Only Semantics

Tracing read-only defaults and capability filtering boundaries from the enum and is_read_only()

THE QUESTION THIS PAGE ANSWERS

ANSWER FIRST

What is the key idea behind “ToolKind Provides Default Read-Only Semantics”?

Tracing read-only defaults and capability filtering boundaries from the enum and is_read_only()

DECISION RULE

Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.

TRY NEXT

Write one question you could answer with evidence after trying this idea.

WATCH FOR

A conclusion that sounds complete but leaves the key assumption untested.

Learning Objective Accurately identify real ToolKind branches, remember that Task returns false and there is no TaskOutput kind in the source code, and explain the boundary between read-only classification and full permission decisions.
Core Visual · Instructional Decision Diagram
ToolKindSemantic Type is_read_only()Kind Default Tool OverrideToolMetadata Env ControlRules · Sandbox · Hook User ControlInteractive Approval Final Exec DecisionAllow · Deny · Ask
Instructional decision diagram: illustrates multi-layer control relationships, not a single function call chain.
Real Classification Branches

is_read_only() == true

ReadSearchLspListDirListMemorySearchMemoryGetWebSearchWebFetchEnterPlanExitPlanAskUser

These kinds default to read-only. Individual tools can still override this default via their own metadata.

is_read_only() == false

EditDeleteWriteMoveExecutePlanTaskSkillSearchToolUseToolMonitorGoalUpdate

This branch also includes background tasks, media generation, deployment, and more. Task is explicitly in the false branch.

Boundary Note: is_read_only describes the default side-effect semantics; it alone does not imply "auto-execute" or "must prompt." Command rules, workspace permissions, sandboxes, Hooks, and user approval all affect the final outcome. In the display layer, the label for Execute is Run Command.
Real Source Code Evidence
crates/codegen/xai-grok-tools/src/tool_taxonomy.rs · Lines 37–113 (excerpt)
pub fn presentation_name(self) -> &'static str {
    match self {
        ToolKind::Execute => "Run Command",
        /* other presentation_name branches omitted */
    }
}

pub fn is_read_only(self) -> bool {
    match self {
        ToolKind::Read
        | ToolKind::Search
        | ToolKind::Lsp
        | ToolKind::ListDir
        | ToolKind::List
        | ToolKind::MemorySearch
        | ToolKind::MemoryGet
        | ToolKind::WebSearch
        | ToolKind::WebFetch
        | ToolKind::EnterPlan
        | ToolKind::ExitPlan
        | ToolKind::AskUser => true,
        ToolKind::Edit
        | ToolKind::Delete
        | ToolKind::Write
        | ToolKind::Move
        | ToolKind::Execute
        | ToolKind::Plan
        | ToolKind::BackgroundTaskAction
        | ToolKind::WaitTasksAction
        | ToolKind::KillTaskAction
        | ToolKind::Skill
        | ToolKind::Task
        | ToolKind::ImageGen
        | ToolKind::VideoGen
        | ToolKind::ImageToVideo
        | ToolKind::ReferenceToVideo
        | ToolKind::DeployApp
        | ToolKind::SearchTool
        | ToolKind::UseTool
        | ToolKind::Monitor
        | ToolKind::GoalUpdate
        | ToolKind::Other => false,
    }
}
Source snapshot note: Based on the local repository at grok-build-main, files crates/codegen/xai-grok-tools/src/types/tool.rs and tool_taxonomy.rs, verified on 2026-07-17. Comments in the excerpt explicitly mark the omitted portions.
Class Exercise
02

Identify the classification, then complete the permission context

Analyze Task, Execute, and WebFetch individually. First write the kind's default read-only value and display label, then list the four control signals that must be checked before final execution.

Takeaway: ToolKind::is_read_only() provides a reusable kind-level default. Task is false, there is no TaskOutput kind in the source, and the unified label for Execute is Run Command. Full permission evaluation requires reading further runtime environment and user control signals.

How “Core Visual · Instructional Decision Diagram” becomes executable

“These kinds default to read-only.” is not about a magic phrase. It is about giving the model enough information to know who the work is for, what must be done, and what counts as acceptable.

Background sets direction; constraints set the boundary

“This branch also includes background tasks, media generation, deployment, and more.” shows why a useful request separates the task, audience, source material, output format, and constraints. Without background, the model guesses. Without acceptance criteria, fluent text is not evidence that the task is complete.

More words do not guarantee a better result

Turn “Analyze Task , Execute , and WebFetch individually.” into a small experiment: change only one of background, requirements, or constraints while keeping the rest fixed, then observe which layer actually changes the output.

From “Core Visual · Instructional Decision Diagram” to “is_read_only() == true”

“Core Visual · Instructional Decision Diagram” grounds the problem in “ToolKind Semantic Type is_read_only() Kind Default Tool Override ToolMetadata Env Control Rules · Sandbox · Hook User Control Interactive Approval Final Exec Decision Allow · Deny · Ask Instructional decision d…”. “is_read_only() == true” then moves it toward “These kinds default to read-only. Individual tools can still override this default via their own metadata”. Together, they show that the lesson is not just a conclusion to remember, but a claim with conditions.

Carry the judgment into the next situation

Build a request layer by layer: task and audience first, material and output rules next, constraints and acceptance checks last. Change one layer at a time so you know what actually helped.

  • “Core Visual · Instructional Decision Diagram”: ToolKind Semantic Type is_read_only() Kind Default Tool Override ToolMetadata Env Control Rules · Sandbox · Hook User Control Interactive Approval Final Exec Decision Allow · Deny · Ask Instructional decision d…
  • “is_read_only() == true”: These kinds default to read-only. Individual tools can still override this default via their own metadata
  • “The closing point”: Analyze Task , Execute , and WebFetch individually. First write the kind's default read-only value and display label, then list the four control signals that must be checked before final execution

The final “The closing point” brings the discussion to “Analyze Task , Execute , and WebFetch individually. First write the kind's default read-only value and display label, then list the four control signals that must be checked before final execution”. The useful thing to carry forward is knowing which judgments must be revisited when input, scale, or risk changes.

Mark as learned Your reading progress updates automatically
← PreviousNext →

Keep reading

The next useful article in the thread.

ARTICLE DISCUSSION

Leave one useful thought here.

Keep the idea that clicked, the question that stayed open, or a small note for the next learner.

Discussing ToolKind Provides Default Read-Only Semantics Inside a Production Coding Agent
3discussionsArticle discussion · synced with the Circle
View in the learning circle
AM
Asha MorganContent editor
INSIGHTField note

I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.

ARTICLE DISCUSSION7 helpful
LH
Lin HarperIndie developer
INSIGHTInsight

After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.

ARTICLE DISCUSSION5 helpful
KM
Kiki MooreProduct operations
QUESTIONQuestion

When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.

ARTICLE DISCUSSION4 helpful