diff --git a/src/shared/agent-tool-restrictions.ts b/src/shared/agent-tool-restrictions.ts index 255f31600..bf72de6d8 100644 --- a/src/shared/agent-tool-restrictions.ts +++ b/src/shared/agent-tool-restrictions.ts @@ -47,6 +47,8 @@ const AGENT_RESTRICTIONS: Record> = { } export function getAgentToolRestrictions(agentName: string): Record { + // Custom/unknown agents get no restrictions (empty object), matching Claude Code's + // trust model where project-registered agents retain full tool access including bash. const stripped = stripInvisibleAgentCharacters(agentName) return AGENT_RESTRICTIONS[stripped] ?? Object.entries(AGENT_RESTRICTIONS).find(([key]) => key.toLowerCase() === stripped.toLowerCase())?.[1] @@ -54,8 +56,6 @@ export function getAgentToolRestrictions(agentName: string): Record key.toLowerCase() === stripped.toLowerCase())?.[1] - return restrictions !== undefined && Object.keys(restrictions).length > 0 + const restrictions = getAgentToolRestrictions(agentName) + return Object.keys(restrictions).length > 0 }