fix(agent-restrictions): restore EXPLORATION_AGENT_DENYLIST as default fallback for unknown agents
This commit is contained in:
committed by
YeonGyu-Kim
parent
da91c53536
commit
1e85a88db0
@@ -47,6 +47,8 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getAgentToolRestrictions(agentName: 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)
|
const stripped = stripInvisibleAgentCharacters(agentName)
|
||||||
return AGENT_RESTRICTIONS[stripped]
|
return AGENT_RESTRICTIONS[stripped]
|
||||||
?? Object.entries(AGENT_RESTRICTIONS).find(([key]) => key.toLowerCase() === stripped.toLowerCase())?.[1]
|
?? 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 {
|
export function hasAgentToolRestrictions(agentName: string): boolean {
|
||||||
const stripped = stripInvisibleAgentCharacters(agentName)
|
const restrictions = getAgentToolRestrictions(agentName)
|
||||||
const restrictions = AGENT_RESTRICTIONS[stripped]
|
return Object.keys(restrictions).length > 0
|
||||||
?? Object.entries(AGENT_RESTRICTIONS).find(([key]) => key.toLowerCase() === stripped.toLowerCase())?.[1]
|
|
||||||
return restrictions !== undefined && Object.keys(restrictions).length > 0
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user