Skip to content

Commit afba59a

Browse files
feat(cli): configure policy engine from existing settings (#8348)
1 parent ec0acc4 commit afba59a

File tree

7 files changed

+1149
-2
lines changed

7 files changed

+1149
-2
lines changed

packages/cli/src/config/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { resolvePath } from '../utils/resolvePath.js';
4343
import { appEvents } from '../utils/events.js';
4444

4545
import { isWorkspaceTrusted } from './trustedFolders.js';
46+
import { createPolicyEngineConfig } from './policy.js';
4647

4748
// Simple console logger for now - replace with actual logger if available
4849
const logger = {
@@ -489,6 +490,8 @@ export async function loadCliConfig(
489490
approvalMode = ApprovalMode.DEFAULT;
490491
}
491492

493+
const policyEngineConfig = createPolicyEngineConfig(settings, approvalMode);
494+
492495
const interactive =
493496
!!argv.promptInteractive || (process.stdin.isTTY && question.length === 0);
494497
// In non-interactive mode, exclude tools that require a prompt.
@@ -574,6 +577,7 @@ export async function loadCliConfig(
574577
fullContext: argv.allFiles || false,
575578
coreTools: settings.tools?.core || undefined,
576579
allowedTools: argv.allowedTools || settings.tools?.allowed || undefined,
580+
policyEngineConfig,
577581
excludeTools,
578582
toolDiscoveryCommand: settings.tools?.discoveryCommand,
579583
toolCallCommand: settings.tools?.callCommand,

0 commit comments

Comments
 (0)