mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 22:02:59 -07:00
fix(core): replace hardcoded non-interactive ASK_USER denial with explicit policy rules (#23668)
This commit is contained in:
@@ -285,6 +285,7 @@ export async function createPolicyEngineConfig(
|
||||
settings: PolicySettings,
|
||||
approvalMode: ApprovalMode,
|
||||
defaultPoliciesDir?: string,
|
||||
interactive: boolean = true,
|
||||
): Promise<PolicyEngineConfig> {
|
||||
const systemPoliciesDir = path.resolve(Storage.getSystemPoliciesDir());
|
||||
const userPoliciesDir = path.resolve(Storage.getUserPoliciesDir());
|
||||
@@ -524,7 +525,10 @@ export async function createPolicyEngineConfig(
|
||||
return {
|
||||
rules,
|
||||
checkers,
|
||||
defaultDecision: PolicyDecision.ASK_USER,
|
||||
defaultDecision: interactive
|
||||
? PolicyDecision.ASK_USER
|
||||
: PolicyDecision.DENY,
|
||||
nonInteractive: !interactive,
|
||||
approvalMode,
|
||||
disableAlwaysAllow: settings.disableAlwaysAllow,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user