The open-source agent harness - the runtime layer that turns an LLM into a working agent.
Restore default MCP tool approval to write and destructive (#895)
Chirag Jain33cbe52ff63f
diff --git a/.changeset/default-approval-write-destructive.md b/.changeset/default-approval-write-destructive.mdnew file mode 100644index 000000000..f7c43f131--- /dev/null+++ b/.changeset/default-approval-write-destructive.md@@ -0,0 +1,8 @@+---+"@truefoundry/trueforge-core": patch+"@truefoundry/trueforge-ui": patch+"@truefoundry/trueforge": patch+"@truefoundry/trueforge-sdk": patch+---++Default MCP tool approval to `@write` and `@destructive` again. Unlabeled tools still run without a pause unless named or covered by `@all`.diff --git a/.github/fern/openapi/openapi.json b/.github/fern/openapi/openapi.jsonindex 5b9fb098e..72da83522 100644--- a/.github/fern/openapi/openapi.json+++ b/.github/fern/openapi/openapi.json@@ -2712,9 +2712,10 @@},"require_approval_for_tools": {"default": [+ "@write","@destructive"],- "description": "Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `[\"@destructive\"]`.",+ "description": "Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `[\"@write\", \"@destructive\"]`.","items": {"$ref": "#/components/schemas/MCPServerApprovalToolSelector"},diff --git a/docs/create-agent/overview.mdx b/docs/create-agent/overview.mdxindex 96d39d681..5a4077f9c 100644--- a/docs/create-agent/overview.mdx+++ b/docs/create-agent/overview.mdx@@ -44,17 +44,17 @@ Each option below is part of the agent definition. The **Set in** line on each s<Accordion title="Tool approval" icon="user-shield">Some tool calls shouldn't run without a human's sign-off. **Tool approval** pauses the agent before such a call, shows the tool name and arguments, and resumes only after the user chooses **Allow** or **Deny** in the chat UI.- By default, the harness gates tools the MCP server marks **destructive** (`require_approval_for_tools` defaults to `["@destructive"]`). Read-only tools run autonomously. Add `@write` to also pause on tools the server marks as writes.+ By default, the agent asks for approval before tools the MCP server marks as **write** or **destructive** (`require_approval_for_tools` defaults to `["@write", "@destructive"]`). Read-only tools run on their own.<Note>- `@write` and `@destructive` match only tools the server annotates. A tool with no annotations, or one the server marks read-only (`readOnlyHint: true`), matches neither tag and runs without approval — even when the call changes state. Most MCP servers omit annotations, so treating those tools as write or destructive would pause on every call. To require approval anyway, name the tool or set `require_approval_for_tools` to `@all`.+ `@write` and `@destructive` only match tools the MCP server has labeled. Many servers skip labels, so those tools run without asking — even if they change data. To pause on a specific tool anyway, list it by name, or set `require_approval_for_tools` to `["@all"]`.</Note><Frame caption="The chat UI pauses on a sensitive tool call with Allow / Deny."><img src="/images/hitl.png" alt="Chat UI pausing on a tool call, showing the request payload with Allow and Deny buttons" /></Frame>- You can override which tools require approval per MCP server. In **Select MCP Tools**, the shield next to an enabled tool toggles approval for it, and the **Destructive Actions** header has an **Approval required** switch that covers all of them; via the API, set [`require_approval_for_tools`](#mcp_servers) to `@all`, `@write`, `@destructive`, or literal tool names.+ You can override which tools require approval per MCP server. In **Select MCP Tools**, the shield next to an enabled tool toggles approval for it, and the **Other Actions** / **Destructive Actions** headers each have an **Approval required** switch for that group; via the API, set [`require_approval_for_tools`](#mcp_servers) to `@all`, `@write`, `@destructive`, or literal tool names.<Frame caption="The shield on an enabled tool row toggles approval; the Selected Tools panel counts how many are gated."><img src="/images/mcp-tool-approval.png" alt="The Select MCP Tools dialog with a shielded web_search tool and a Selected Tools panel listing tools with approval badges" />@@ -361,10 +361,10 @@ Optional array. Each entry attaches a [configured MCP server](/mcp-servers) by n| `enable_tools` | `["@all"]` | API | Tools exposed to the agent: `@all`, `@read-only`, or literal tool names. || `disable_tools` | `[]` | API | Tools subtracted from the enabled set. || `preload_tools` | `[]` | API | Tools loaded eagerly into context while the rest stay deferred. |-| `require_approval_for_tools` | `["@destructive"]` | UI + API | Tools that pause for [human approval](#tool-approval): `@all`, `@write`, `@destructive`, or literal names. |+| `require_approval_for_tools` | `["@write", "@destructive"]` | UI + API | Tools that pause for [human approval](#tool-approval): `@all`, `@write`, `@destructive`, or literal names. || `preload` | `false` | UI + API | Load all tool schemas upfront instead of [on demand](/key-features/deferred-tool-loading). |-The `@read-only`, `@write`, and `@destructive` selectors are resolved from the tool annotations published by the MCP server. `@write` matches `readOnlyHint: false` when the tool is not destructive; `@destructive` matches `destructiveHint: true`. A tool with no annotations, or one the server marks read-only, matches neither selector and runs without an approval pause. Name the tool, or use `@all`, to gate it anyway.+`@read-only`, `@write`, and `@destructive` follow the labels the MCP server puts on each tool. Unlabeled tools (and tools marked read-only) are not covered by `@write` / `@destructive`, so they run without an approval pause. Gate them by name, or use `@all`.### `skills`diff --git a/docs/openapi.json b/docs/openapi.jsonindex 5b9fb098e..72da83522 100644--- a/docs/openapi.json+++ b/docs/openapi.json@@ -2712,9 +2712,10 @@},"require_approval_for_tools": {"default": [+ "@write","@destructive"],- "description": "Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `[\"@destructive\"]`.",+ "description": "Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `[\"@write\", \"@destructive\"]`.","items": {"$ref": "#/components/schemas/MCPServerApprovalToolSelector"},diff --git a/packages/trueforge-core/src/agent-session/schemas/agentSpec.ts b/packages/trueforge-core/src/agent-session/schemas/agentSpec.tsindex c5134870b..8aaa3c5d0 100644--- a/packages/trueforge-core/src/agent-session/schemas/agentSpec.ts+++ b/packages/trueforge-core/src/agent-session/schemas/agentSpec.ts@@ -92,12 +92,12 @@ const MCPServerRequestSchema = z.describe('Tools loaded eagerly into context while the rest stay deferred. A non-empty list implies `preload: false`.',),- // Tools that require human approval before execution. Default: @destructive only.+ // Tools that require human approval before execution. Default: @write + @destructive.require_approval_for_tools: z.array(RequireApprovalToolSelectorSchema).default(DEFAULT_REQUIRE_APPROVAL_FOR_TOOLS).describe(- 'Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `["@destructive"]`.',+ 'Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `["@write", "@destructive"]`.',),// Whether this server's tools are preloaded into context. Default: false.// When false, tools are discovered lazily and only `preload_tools` stay eager.diff --git a/packages/trueforge-core/src/core/mcp/ToolSelectorPolicy.ts b/packages/trueforge-core/src/core/mcp/ToolSelectorPolicy.tsindex ea1d69310..b9a5a1278 100644--- a/packages/trueforge-core/src/core/mcp/ToolSelectorPolicy.ts+++ b/packages/trueforge-core/src/core/mcp/ToolSelectorPolicy.ts@@ -107,8 +107,8 @@ export class ToolSelectorPolicy {/*** Whether the tool requires human approval. Honors `requireApprovalForTools` exactly: omit /- * undefined defaults to `@destructive` (constructor); an explicit list — including empty —- * is exact.+ * undefined defaults to `@write` + `@destructive` (constructor); an explicit list — including+ * empty — is exact.*/requiresApproval(toolName: string, annotations: ToolAnnotations | undefined): boolean {return toolRequiresApproval(toolName, annotations, this.requireApprovalForTools);diff --git a/packages/trueforge-core/src/core/mcp/toolSelectors.ts b/packages/trueforge-core/src/core/mcp/toolSelectors.tsindex d69d0be90..74e2654b5 100644--- a/packages/trueforge-core/src/core/mcp/toolSelectors.ts+++ b/packages/trueforge-core/src/core/mcp/toolSelectors.ts@@ -25,7 +25,7 @@ export const REQUIRE_APPROVAL_TOOLS_SELECTOR_TAGS = [TOOL_TAG_ALL, TOOL_TAG_WRITexport const DEFAULT_ENABLE_TOOLS: string[] = [TOOL_TAG_ALL];export const DEFAULT_DISABLE_TOOLS: string[] = [];export const DEFAULT_PRELOAD_TOOLS: string[] = [];-export const DEFAULT_REQUIRE_APPROVAL_FOR_TOOLS: string[] = [TOOL_TAG_DESTRUCTIVE];+export const DEFAULT_REQUIRE_APPROVAL_FOR_TOOLS: string[] = [TOOL_TAG_WRITE, TOOL_TAG_DESTRUCTIVE];function isToolTag(selector: string): selector is ToolTag {return TOOL_TAGS.includes(selector as ToolTag);diff --git a/packages/trueforge-sdk/src/api/types/McpServer.ts b/packages/trueforge-sdk/src/api/types/McpServer.tsindex 901e443f3..2b0f8ee06 100644--- a/packages/trueforge-sdk/src/api/types/McpServer.ts+++ b/packages/trueforge-sdk/src/api/types/McpServer.ts@@ -13,6 +13,6 @@ export interface McpServer {preload?: boolean;/** Tools loaded eagerly into context while the rest stay deferred. A non-empty list implies `preload: false`. */preloadTools?: TrueForge.McpServerToolSelector[];- /** Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `["@destructive"]`. */+ /** Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `["@write", "@destructive"]`. */requireApprovalForTools?: TrueForge.McpServerApprovalToolSelector[];}diff --git a/packages/trueforge-ui/src/atoms/draft/AgentMcpEditorContent.tsx b/packages/trueforge-ui/src/atoms/draft/AgentMcpEditorContent.tsxindex da297e7d8..0e5ee5fa7 100644--- a/packages/trueforge-ui/src/atoms/draft/AgentMcpEditorContent.tsx+++ b/packages/trueforge-ui/src/atoms/draft/AgentMcpEditorContent.tsx@@ -1,6 +1,6 @@'use client';-import { useEffect, useRef, useState } from 'react';+import { useState } from 'react';import { useMCPAuth } from '../../hooks/useMcpAuth.js';import { Icon } from '../../icons/Icon.js';@@ -29,19 +29,16 @@ import {approvedToolNames,DEFAULT_APPROVAL_SELECTORS,namedToolRequiresApproval,- sameSelectors,} from './mcpToolApprovals.js';import {+ MCP_TOOL_SECTION_APPROVAL_ALL_LABELS,MCP_TOOL_SECTION_ENABLE_ALL_LABELS,MCP_TOOL_SECTION_LABELS,MCP_TOOL_SECTION_ORDER,partitionMcpToolsBySection,type McpToolSectionId,} from './mcpToolSections.js';-import { TOOL_TAG_DESTRUCTIVE, TOOL_TAG_WRITE, toolMatchesSelectors } from './mcpToolSelectors.js';--/** Pre-change harness default; still present on mounts materialized before approval became destructive-only. */-const LEGACY_APPROVAL_SELECTORS = [TOOL_TAG_WRITE, TOOL_TAG_DESTRUCTIVE] as const;+import { toolMatchesSelectors } from './mcpToolSelectors.js';export type AgentMcpEditorContentProps = {spec: AgentSpec;@@ -240,33 +237,6 @@ export function AgentMcpEditorContent({});};- // Specs saved under the old default still carry `@write`+`@destructive`. Rewrite once tools are- // known so Other tools show (and run) without approval unless the user opts in.- const migratedLegacyApprovalRef = useRef(new Set<string>());- useEffect(() => {- if (!activeMount || tools.length === 0) return;- if (migratedLegacyApprovalRef.current.has(activeMount.id)) return;- const selectors = approvalSelectorsFromMount(activeMount.value);- if (!sameSelectors(selectors, LEGACY_APPROVAL_SELECTORS)) {- migratedLegacyApprovalRef.current.add(activeMount.id);- return;- }- migratedLegacyApprovalRef.current.add(activeMount.id);- const enabled = enabledToolsFromMount(activeMount.value);- const names = enabled === 'all' ? tools.map(tool => tool.name) : enabled;- onChange({- ...spec,- mcpServers: mcpMounts.map(item =>- item.id === activeMount.id- ? withApprovalSelectors(- activeMount.value,- approvalSelectorsAfterEnabling({ tools, selectors, newlyEnabledNames: names }),- )- : item.value,- ),- });- }, [activeMount, tools, mcpMounts, onChange, spec]);-const removeMount = (mountId: string) => {onChange({...spec,@@ -541,6 +511,10 @@ export function AgentMcpEditorContent({: sectionNames.filter(name => enabledTools.includes(name));const sectionApproved =sectionEnabledNames.length > 0 && sectionEnabledNames.every(name => approvedNames.has(name));+ const approvalAllLabel =+ sectionId === 'others' || sectionId === 'destructive'+ ? MCP_TOOL_SECTION_APPROVAL_ALL_LABELS[sectionId]+ : undefined;return (<div key={sectionId} className="mb-3">{showSectionHeader ? (@@ -554,7 +528,7 @@ export function AgentMcpEditorContent({{MCP_TOOL_SECTION_LABELS[sectionId]}</p><div className="flex shrink-0 items-center gap-3">- {sectionId !== 'destructive' || sectionEnabledNames.length === 0 ? null : (+ {approvalAllLabel === undefined || sectionEnabledNames.length === 0 ? null : (<label className="text-text-secondary flex shrink-0 cursor-pointer items-center gap-2 text-xs">Approval required<Switch@@ -562,7 +536,7 @@ export function AgentMcpEditorContent({onCheckedChange={required =>setToolsApproval({ toolNames: sectionEnabledNames, required })}- aria-label="Require approval for all destructive tools"+ aria-label={approvalAllLabel}/></label>)}diff --git a/packages/trueforge-ui/src/atoms/draft/mcpToolApprovals.ts b/packages/trueforge-ui/src/atoms/draft/mcpToolApprovals.tsindex b52e8a080..3b11ed039 100644--- a/packages/trueforge-ui/src/atoms/draft/mcpToolApprovals.ts+++ b/packages/trueforge-ui/src/atoms/draft/mcpToolApprovals.ts@@ -1,5 +1,4 @@import type { McpToolSelection } from '../../server/types.js';-import { mcpToolSectionId } from './mcpToolSections.js';import {TOOL_TAG_ALL,TOOL_TAG_DESTRUCTIVE,@@ -9,16 +8,16 @@ import {} from './mcpToolSelectors.js';/** Harness default applied when a mount omits `requireApprovalForTools`. */-export const DEFAULT_APPROVAL_SELECTORS: readonly string[] = [TOOL_TAG_DESTRUCTIVE];+export const DEFAULT_APPROVAL_SELECTORS: readonly string[] = [TOOL_TAG_WRITE, TOOL_TAG_DESTRUCTIVE];-/** Approval on by default only for destructive tools; Other/read-only stay off until toggled. */+/** Approval on by default for tools that match the harness default selectors. */export function defaultApprovalRequiredForTool(tool: McpToolSelection): boolean {- return mcpToolSectionId(tool) === 'destructive';+ return toolMatchesSelectors({ tool, selectors: DEFAULT_APPROVAL_SELECTORS });}/**- * Apply section defaults for tools that were just enabled: destructive → gated, everything else →- * auto-run. Rebuilds selectors from the full server tool list so class tags stay coherent.+ * Apply harness defaults for tools that were just enabled: write/destructive → gated, read-only /+ * unlabeled → auto-run. Rebuilds selectors from the full server tool list so class tags stay coherent.*/export function approvalSelectorsAfterEnabling({tools,@@ -38,8 +37,8 @@ export function approvalSelectorsAfterEnabling({else approved.delete(name);}const next = approvalSelectorsFor({ tools, approved });- // No destructive tools on this server → keep the omitted harness default instead of writing `[]`,- // so later-added destructive tools still pick up `@destructive`.+ // No write/destructive tools on this server → keep the omitted harness default instead of writing+ // `[]`, so later-added write/destructive tools still pick up the class tags.if (next.length === 0 && !tools.some(tool => defaultApprovalRequiredForTool(tool))) {return [...DEFAULT_APPROVAL_SELECTORS];}diff --git a/packages/trueforge-ui/src/atoms/draft/mcpToolSections.ts b/packages/trueforge-ui/src/atoms/draft/mcpToolSections.tsindex 9b667b7ef..b10eb168c 100644--- a/packages/trueforge-ui/src/atoms/draft/mcpToolSections.ts+++ b/packages/trueforge-ui/src/atoms/draft/mcpToolSections.ts@@ -51,6 +51,12 @@ export const MCP_TOOL_SECTION_ENABLE_ALL_LABELS: Record<McpToolSectionId, stringdestructive: 'Enable all destructive tools',};+/** Bulk approval toggle; omitted for read-only (auto-run by default). */+export const MCP_TOOL_SECTION_APPROVAL_ALL_LABELS: Record<Exclude<McpToolSectionId, 'read-only'>, string> = {+ others: 'Require approval for all other tools',+ destructive: 'Require approval for all destructive tools',+};+export function partitionMcpToolsBySection(tools: readonly McpToolSelection[],): Record<McpToolSectionId, McpToolSelection[]> {diff --git a/packages/trueforge-ui/test/atoms/draft/AgentMcpEditorContent.approvals.test.tsx b/packages/trueforge-ui/test/atoms/draft/AgentMcpEditorContent.approvals.test.tsxindex 3ee86a539..7a170684e 100644--- a/packages/trueforge-ui/test/atoms/draft/AgentMcpEditorContent.approvals.test.tsx+++ b/packages/trueforge-ui/test/atoms/draft/AgentMcpEditorContent.approvals.test.tsx@@ -54,12 +54,12 @@ const mountedSpec: AgentSpec = {};describe('AgentMcpEditorContent tool approvals', () => {- it('marks only destructive tools as approval-gated by default', () => {+ it('marks write and destructive tools as approval-gated by default', () => {renderEditor({ spec: mountedSpec, onChange: vi.fn() });expect(screen.getByRole('button', { name: 'Require approval for rename_item' })).toHaveAttribute('aria-pressed',- 'false',+ 'true',);expect(screen.getByRole('button', { name: 'Require approval for delete_item' })).toHaveAttribute('aria-pressed',@@ -111,7 +111,15 @@ describe('AgentMcpEditorContent tool approvals', () => {it('writes an empty list when the last gated tool is set to auto-run', () => {const onChange = vi.fn();- renderEditor({ spec: mountedSpec, onChange });+ renderEditor({+ spec: {+ model: { name: 'openai/gpt' },+ mcpServers: [+ { id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: ['@destructive'] },+ ],+ },+ onChange,+ });fireEvent.click(screen.getByRole('button', { name: 'Require approval for delete_item' }));@@ -126,12 +134,14 @@ describe('AgentMcpEditorContent tool approvals', () => {renderEditor({spec: {model: { name: 'openai/gpt' },- mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: [] }],+ mcpServers: [+ { id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: ['@destructive'] },+ ],},onChange,});- fireEvent.click(screen.getByRole('button', { name: 'Require approval for delete_item' }));+ fireEvent.click(screen.getByRole('button', { name: 'Require approval for rename_item' }));expect(onChange).toHaveBeenCalledWith({model: { name: 'openai/gpt' },@@ -153,29 +163,51 @@ describe('AgentMcpEditorContent tool approvals', () => {expect(onChange).toHaveBeenCalledWith({model: { name: 'openai/gpt' },- mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['@all'] }],+ mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: ['@destructive'] }],+ });+ });++ it('gates every other tool from the section toggle', () => {+ const onChange = vi.fn();+ renderEditor({+ spec: {+ model: { name: 'openai/gpt' },+ mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: [] }],+ },+ onChange,+ });++ fireEvent.click(screen.getByRole('switch', { name: 'Require approval for all other tools' }));++ expect(onChange).toHaveBeenCalledWith({+ model: { name: 'openai/gpt' },+ mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: ['@write'] }],});});- it('starts the destructive section toggle on and clears approval when switched off', () => {+ it('starts both write and destructive section toggles on and keeps write tools gated when destructive is switched off', () => {const onChange = vi.fn();renderEditor({ spec: mountedSpec, onChange });- const toggle = screen.getByRole('switch', { name: 'Require approval for all destructive tools' });+ const destructiveToggle = screen.getByRole('switch', { name: 'Require approval for all destructive tools' });+ const otherToggle = screen.getByRole('switch', { name: 'Require approval for all other tools' });- expect(toggle).toBeChecked();- fireEvent.click(toggle);+ expect(destructiveToggle).toBeChecked();+ expect(otherToggle).toBeChecked();+ fireEvent.click(destructiveToggle);expect(onChange).toHaveBeenCalledWith({model: { name: 'openai/gpt' },- mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: [] }],+ mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['@all'], requireApprovalForTools: ['@write'] }],});});- it('offers the section toggle only for destructive tools', () => {+ it('offers section approval toggles for other and destructive tools', () => {renderEditor({ spec: mountedSpec, onChange: vi.fn() });+ expect(screen.getByRole('switch', { name: 'Require approval for all other tools' })).toBeInTheDocument();expect(screen.getByRole('switch', { name: 'Require approval for all destructive tools' })).toBeInTheDocument();- expect(screen.getAllByText('Approval required')).toHaveLength(1);+ expect(screen.getAllByText('Approval required')).toHaveLength(2);+ expect(screen.queryByRole('switch', { name: /Require approval for all read-only/ })).not.toBeInTheDocument();});it('hides approval controls for tools that are not enabled', () => {@@ -192,7 +224,7 @@ describe('AgentMcpEditorContent tool approvals', () => {expect(screen.queryByRole('button', { name: 'Require approval for list_items' })).not.toBeInTheDocument();});- it('hides the destructive toggle when no destructive tool is enabled', () => {+ it('hides a section approval toggle when none of its tools are enabled', () => {renderEditor({spec: {model: { name: 'openai/gpt' },@@ -201,6 +233,7 @@ describe('AgentMcpEditorContent tool approvals', () => {onChange: vi.fn(),});+ expect(screen.getByRole('switch', { name: 'Require approval for all other tools' })).toBeInTheDocument();expect(screen.queryByRole('switch', { name: 'Require approval for all destructive tools' }),).not.toBeInTheDocument();@@ -244,8 +277,8 @@ describe('AgentMcpEditorContent tool approvals', () => {});expect(screen.getByText('Selected Tools (3)')).toBeInTheDocument();- expect(screen.getByText('3 selected · 1 need approval')).toBeInTheDocument();- expect(screen.getAllByText('approval')).toHaveLength(1);+ expect(screen.getByText('3 selected · 2 need approval')).toBeInTheDocument();+ expect(screen.getAllByText('approval')).toHaveLength(2);});it('enables every tool in a section from its Enable all switch', () => {@@ -260,7 +293,7 @@ describe('AgentMcpEditorContent tool approvals', () => {});});- it('turns approval off when selecting an Other tool even if the mount still gates @write', () => {+ it('keeps write approval when selecting an Other tool under the harness default', () => {const onChange = vi.fn();renderEditor({spec: {@@ -305,7 +338,14 @@ describe('AgentMcpEditorContent tool approvals', () => {expect(onChange).toHaveBeenCalledWith({model: { name: 'openai/gpt' },- mcpServers: [{ id: 'linear', name: 'Linear', enableTools: ['list_items', 'delete_item'] }],+ mcpServers: [+ {+ id: 'linear',+ name: 'Linear',+ enableTools: ['list_items', 'delete_item'],+ requireApprovalForTools: ['@destructive'],+ },+ ],});});});diff --git a/packages/trueforge-ui/test/atoms/draft/mcpToolApprovals.test.ts b/packages/trueforge-ui/test/atoms/draft/mcpToolApprovals.test.tsindex 50431da70..cdcfd053c 100644--- a/packages/trueforge-ui/test/atoms/draft/mcpToolApprovals.test.ts+++ b/packages/trueforge-ui/test/atoms/draft/mcpToolApprovals.test.ts@@ -33,17 +33,17 @@ describe('namedToolRequiresApproval', () => {});describe('approvalSelectorsAfterEnabling', () => {- it('ungates Other tools and keeps destructive tools gated', () => {+ it('keeps write and destructive tools gated when enabling them', () => {expect(approvalSelectorsAfterEnabling({tools,selectors: ['@write', '@destructive'],newlyEnabledNames: ['rename_item', 'delete_item'],}),- ).toEqual(['@destructive']);+ ).toEqual(['@write', '@destructive']);});- it('keeps the harness default when enabling tools on a server with no destructive class', () => {+ it('keeps the harness default when enabling tools on a server with no write/destructive class', () => {expect(approvalSelectorsAfterEnabling({tools: [unannotated],@@ -59,7 +59,7 @@ describe('approvalSelectorsFor', () => {const approved = approvedToolNames({ tools, selectors: [...DEFAULT_APPROVAL_SELECTORS] });approved.add('list_items');- expect(approvalSelectorsFor({ tools, approved })).toEqual(['@destructive', 'list_items']);+ expect(approvalSelectorsFor({ tools, approved })).toEqual(['@write', '@destructive', 'list_items']);});it('expands a class tag into names when one of its tools is ungated', () => {@@ -93,14 +93,18 @@ describe('approvalSelectorsFor', () => {describe('mount approval selectors', () => {it('reads the harness default when the mount omits the field', () => {- expect(approvalSelectorsFromMount({ name: 'linear' })).toEqual(['@destructive']);+ expect(approvalSelectorsFromMount({ name: 'linear' })).toEqual(['@write', '@destructive']);expect(approvalSelectorsFromMount({ name: 'linear', requireApprovalForTools: [] })).toEqual([]);});it('drops the field again when the selection matches the default', () => {const mount = { name: 'linear', requireApprovalForTools: ['@all'] };- expect(withApprovalSelectors(mount, ['@destructive'])).toEqual({ name: 'linear' });+ expect(withApprovalSelectors(mount, ['@write', '@destructive'])).toEqual({ name: 'linear' });+ expect(withApprovalSelectors(mount, ['@destructive'])).toEqual({+ name: 'linear',+ requireApprovalForTools: ['@destructive'],+ });expect(withApprovalSelectors(mount, [])).toEqual({ name: 'linear', requireApprovalForTools: [] });});});diff --git a/python/trueforge_sdk/src/trueforge_sdk/types/mcp_server.py b/python/trueforge_sdk/src/trueforge_sdk/types/mcp_server.pyindex 46d237306..539a3ca52 100644--- a/python/trueforge_sdk/src/trueforge_sdk/types/mcp_server.py+++ b/python/trueforge_sdk/src/trueforge_sdk/types/mcp_server.py@@ -39,7 +39,7 @@ class McpServer(UncheckedBaseModel):default=None)"""- Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `["@destructive"]`.+ Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `["@write", "@destructive"]`."""if IS_PYDANTIC_V2: