Skip to content

Commit 5d16c83

Browse files
fazxesclaude
andcommitted
fix(agent-bridge): require permission for all tools in default mode
PreToolUse hook now returns 'ask' instead of empty object to bypass SDK's built-in Allow Rules that auto-approve read-only tools (Read, Glob, Grep, WebSearch, etc.). This ensures all tools prompt for permission in default mode, not just write operations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 440f7cf commit 5d16c83

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎agent-bridge/src/agent.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,16 @@ When browser is open, you also have access to Chrome DevTools Protocol tools via
542542
});
543543
}
544544

545-
// Return empty object to continue SDK permission flow
546-
// SDK will check Deny Rules → Allow Rules → Ask Rules → Permission Mode → canUseTool
547-
return Promise.resolve({});
545+
// Return 'ask' to force ALL tools through canUseTool callback
546+
// This bypasses SDK's built-in Allow Rules that auto-approve read-only tools
547+
// (Read, Glob, Grep, WebSearch, etc.)
548+
return Promise.resolve({
549+
hookSpecificOutput: {
550+
hookEventName: 'PreToolUse' as const,
551+
permissionDecision: 'ask' as const,
552+
updatedInput: toolInput,
553+
},
554+
});
548555
},
549556
],
550557
},

0 commit comments

Comments
 (0)