+
+
+ Confirm tool calls
+
+
+ When on, local Studio tool calls pause for your approval before they
+ run. Provider-hosted tools are not gated here.
+
+
+
+
+ );
+}
+
function ChatTemplateFields() {
const defaultTemplate = useChatRuntimeStore((s) => s.defaultChatTemplate);
const override = useChatRuntimeStore((s) => s.chatTemplateOverride);
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 3ef63d2945..2f0e3027a8 100644
--- a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
+++ b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
@@ -34,6 +34,7 @@ export const CHAT_COLLAPSE_HTML_ARTIFACTS_KEY =
export const CHAT_ALLOW_ARTIFACT_NETWORK_ACCESS_KEY =
"unsloth_chat_allow_artifact_network_access";
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";
export const CHAT_RAG_SOURCE_KEY = "unsloth_chat_rag_source";
@@ -402,6 +403,29 @@ type ChatRuntimeStore = {
// autoInject = forced first-pass retrieval before answering.
ragAutoInject: RagAutoInject;
ragAutoInjectMinScore: number;
+ /**
+ * When on, local Studio tool calls pause for an explicit allow/deny in the
+ * chat before they run.
+ */
+ confirmToolCalls: boolean;
+ /**
+ * Per-chat set of tool names the user chose to auto-approve via "Always
+ * allow". Keyed by UI confirmation scope, not necessarily the backend
+ * sandbox session id. Not persisted across reloads.
+ */
+ alwaysAllowToolsBySession: Map