fix(agent-restrictions): restore EXPLORATION_AGENT_DENYLIST as default fallback for unknown agents

This commit is contained in:
Brandon Webb
2026-03-26 10:42:14 -04:00
committed by YeonGyu-Kim
parent da91c53536
commit 1e85a88db0

View File

@@ -47,6 +47,8 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
}
export function getAgentToolRestrictions(agentName: string): Record<string, boolean> {
// 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<string, bool
}
export function hasAgentToolRestrictions(agentName: string): boolean {
const stripped = stripInvisibleAgentCharacters(agentName)
const restrictions = AGENT_RESTRICTIONS[stripped]
?? Object.entries(AGENT_RESTRICTIONS).find(([key]) => key.toLowerCase() === stripped.toLowerCase())?.[1]
return restrictions !== undefined && Object.keys(restrictions).length > 0
const restrictions = getAgentToolRestrictions(agentName)
return Object.keys(restrictions).length > 0
}