feat(policy): explicitly allow web_fetch in plan mode with ask_user (#24456)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Adib234
2026-04-01 15:57:56 -04:00
committed by GitHub
parent 2d432c1489
commit 55f5d3923c
5 changed files with 17 additions and 7 deletions
+2 -2
View File
@@ -121,14 +121,14 @@ priority = 70
modes = ["plan"]
[[rule]]
toolName = ["ask_user", "save_memory"]
toolName = ["ask_user", "save_memory", "web_fetch"]
decision = "ask_user"
priority = 70
modes = ["plan"]
interactive = true
[[rule]]
toolName = ["ask_user", "save_memory"]
toolName = ["ask_user", "save_memory", "web_fetch"]
decision = "deny"
priority = 70
modes = ["plan"]
@@ -2929,6 +2929,12 @@ describe('PolicyEngine', () => {
priority: 70,
modes: [ApprovalMode.PLAN],
},
{
toolName: 'web_fetch',
decision: PolicyDecision.ASK_USER,
priority: 70,
modes: [ApprovalMode.PLAN],
},
{
toolName: '*',
decision: PolicyDecision.DENY,
@@ -2972,7 +2978,6 @@ describe('PolicyEngine', () => {
const excluded = engine.getExcludedTools(toolMetadata, allToolNames);
// These should be excluded (caught by catch-all DENY)
expect(excluded.has('shell')).toBe(true);
expect(excluded.has('web_fetch')).toBe(true);
expect(excluded.has('write_todos')).toBe(true);
expect(excluded.has('memory')).toBe(true);
// write_file and replace are excluded unless they have argsPattern rules
@@ -2988,6 +2993,7 @@ describe('PolicyEngine', () => {
expect(excluded.has('list_directory')).toBe(false);
expect(excluded.has('google_web_search')).toBe(false);
expect(excluded.has('activate_skill')).toBe(false);
expect(excluded.has('web_fetch')).toBe(false);
expect(excluded.has('ask_user')).toBe(false);
expect(excluded.has('exit_plan_mode')).toBe(false);
expect(excluded.has('save_memory')).toBe(false);