+
+
+ Confirm tool calls
+
+
+ When on, every tool call pauses for your approval in the chat before
+ it runs.
+
+
+
+
+ );
+}
+
function McpServersSection() {
const mcpEnabledForChat = useChatRuntimeStore((s) => s.mcpEnabledForChat);
const setMcpEnabledForChat = useChatRuntimeStore(
diff --git a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
index 8f0767b7b8..9b85e56e9d 100644
--- a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
+++ b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
@@ -28,6 +28,7 @@ export const CHAT_TOOLS_ENABLED_KEY = "unsloth_chat_tools_enabled";
export const CHAT_CODE_TOOLS_ENABLED_KEY = "unsloth_chat_code_tools_enabled";
export const CHAT_IMAGE_TOOLS_ENABLED_KEY = "unsloth_chat_image_tools_enabled";
export const CHAT_MCP_ENABLED_KEY = "unsloth_chat_mcp_enabled";
+export const CHAT_CONFIRM_TOOL_CALLS_KEY = "unsloth_chat_confirm_tool_calls";
export const CHAT_WEB_FETCH_TOOLS_ENABLED_KEY =
"unsloth_chat_web_fetch_tools_enabled";
@@ -301,6 +302,26 @@ type ChatRuntimeStore = {
codeToolsEnabled: boolean;
imageToolsEnabled: boolean;
mcpEnabledForChat: boolean;
+ /**
+ * When on, every tool call pauses for an explicit allow/deny in the
+ * chat before it runs.
+ */
+ confirmToolCalls: boolean;
+ /**
+ * Per-session set of tool names the user chose to auto-approve via
+ * "Always allow". Keyed by thread/session id so allowing a tool in one
+ * chat does not silently auto-approve it in another. Not persisted
+ * across reloads.
+ */
+ alwaysAllowToolsBySession: Map