feat: Disable YOLO and AUTO_EDIT modes for untrusted folders (#7041)

This commit is contained in:
shrutip90 2025-08-25 17:30:04 -07:00 committed by GitHub
parent 2c6794feed
commit ae1f67df04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 451 additions and 55 deletions

View file

@ -564,6 +564,11 @@ export class Config {
}
setApprovalMode(mode: ApprovalMode): void {
if (!this.isTrustedFolder() && mode !== ApprovalMode.DEFAULT) {
throw new Error(
'Cannot enable privileged approval modes in an untrusted folder.',
);
}
this.approvalMode = mode;
}