Skip to content

fix: strengthen ask mode prompt to prevent tool calls#314

Open
kiloconnect[bot] wants to merge 3 commits intodevfrom
fix/ask-mode-no-tool-calls
Open

fix: strengthen ask mode prompt to prevent tool calls#314
kiloconnect[bot] wants to merge 3 commits intodevfrom
fix/ask-mode-no-tool-calls

Conversation

@kiloconnect
Copy link
Contributor

@kiloconnect kiloconnect bot commented Feb 14, 2026

Problem

In the Kilo CLI's "ask" mode, Claude is attempting to call tools (e.g., editing files) even though ask mode should be read-only/conversational.

The existing ask mode prompt contained a soft guideline ("Do not edit files or execute commands; this agent is read-only") that was not emphatic enough to prevent models from attempting tool calls.

Root Cause

While the ask mode correctly configures permissions to deny write tools ("*": "deny" with specific read-only tools allowed), the system prompt didn't strongly enough instruct the model to avoid calling modification tools. The permission system filters out write tools from the tool list, but models can still hallucinate tool calls or attempt to use tools in unexpected ways.

Fix

Strengthened the ask mode prompt (packages/opencode/src/agent/prompt/ask.txt) with:

  • An explicit READ-ONLY mode declaration at the top
  • Clear enumeration of forbidden tool types (edit, write, patch, bash, etc.)
  • Explicit instruction to suggest switching to code mode when users request changes
  • Maintained the existing read-only tool allowances (file reading, searching, listing)

Changes

  • packages/opencode/src/agent/prompt/ask.txt — Rewrote the prompt to be more explicit and emphatic about the read-only constraint

Built for Marius Wichtner by Kilo for Slack

The ask mode prompt was too soft in its instruction to not edit files,
causing models to still attempt tool calls (file edits, shell commands).

Strengthened the prompt with explicit, emphatic instructions that the
model is in READ-ONLY mode and must not call any modification tools.
If users request changes, the model should explain what's needed and
suggest switching to code mode instead.
@kiloconnect
Copy link
Contributor Author

kiloconnect bot commented Feb 14, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/agent/prompt/ask.txt 3 Prompt references generic tool names ("bash", "patch", etc.) that may not match actual tool identifiers
Files Reviewed (1 files)
  • packages/opencode/src/agent/prompt/ask.txt - 1 issue

marius-kilocode and others added 2 commits February 16, 2026 15:11
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@@ -1,8 +1,13 @@
You are a knowledgeable technical assistant focused on answering questions and providing information about software development, technology, and related topics.

IMPORTANT: You are in READ-ONLY mode. You MUST NOT call any tools that modify files or execute commands. Do NOT use tools like edit, write, patch, bash, or any tool that creates, modifies, or deletes files. You may only use read-only tools (such as reading files, searching, and listing) to gather context for your answers.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prompt references generic tool names ("bash", "patch", "edit") that may not match actual tool identifiers

In this repo, the relevant tool names are things like execute_command and apply_patch. If the goal is to reliably prevent tool calls, consider explicitly naming the actual tools to avoid ambiguity/misinterpretation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant