@@ -121,6 +121,7 @@ impl std::fmt::Display for RespondTo {
121121/// `session/request_permission` escalations may still cross ACP when the model
122122/// chooses manual approval for a specific call.
123123/// - `acceptEdits` — auto-approve file edits, still ask for other tools.
124+ /// - `bypassPermissions` — skip the permission flow entirely.
124125/// - `dontAsk` — never prompt; reject anything that would require permission.
125126/// - `plan` — planning-only mode (no tool execution).
126127#[ derive( Debug , Clone , Copy , PartialEq , clap:: ValueEnum ) ]
@@ -147,6 +148,9 @@ pub enum PermissionMode {
147148 /// Auto-approve file edits, still ask for other tools.
148149 #[ value( alias = "acceptEdits" ) ]
149150 AcceptEdits ,
151+ /// Skip the permission flow entirely.
152+ #[ value( alias = "bypassPermissions" ) ]
153+ BypassPermissions ,
150154 /// Never prompt; reject anything that would require permission.
151155 #[ value( alias = "dontAsk" ) ]
152156 DontAsk ,
@@ -163,6 +167,7 @@ impl PermissionMode {
163167 Self :: Default => "default" ,
164168 Self :: Auto => "auto" ,
165169 Self :: AcceptEdits => "acceptEdits" ,
170+ Self :: BypassPermissions => "bypassPermissions" ,
166171 Self :: DontAsk => "dontAsk" ,
167172 Self :: Plan => "plan" ,
168173 }
@@ -624,6 +629,7 @@ pub struct CliArgs {
624629 ///
625630 /// Desktop injects the resolved per-agent or fleet-wide value.
626631 /// Headless installations should leave this unset (defaults to `reject`).
632+
627633 #[ arg(
628634 long,
629635 env = "BUZZ_ACP_PERMISSION_POLICY" ,
@@ -1678,6 +1684,7 @@ mod tests {
16781684 Some ( PermissionMode :: DontAsk ) ,
16791685 )
16801686 . expect ( "test config" ) ,
1687+
16811688 respond_to : RespondTo :: Anyone ,
16821689 respond_to_allowlist : HashSet :: new ( ) ,
16831690 allowed_respond_to : Vec :: new ( ) ,
@@ -2478,21 +2485,29 @@ channels = "ALL"
24782485 fn test_permission_mode_wire_strings ( ) {
24792486 assert_eq ! ( PermissionMode :: Default . as_wire_str( ) , "default" ) ;
24802487 assert_eq ! ( PermissionMode :: AcceptEdits . as_wire_str( ) , "acceptEdits" ) ;
2488+ assert_eq ! (
2489+ PermissionMode :: BypassPermissions . as_wire_str( ) ,
2490+ "bypassPermissions"
2491+ ) ;
24812492 assert_eq ! ( PermissionMode :: DontAsk . as_wire_str( ) , "dontAsk" ) ;
24822493 assert_eq ! ( PermissionMode :: Plan . as_wire_str( ) , "plan" ) ;
24832494 }
24842495
24852496 #[ test]
24862497 fn test_permission_mode_is_default ( ) {
24872498 assert ! ( PermissionMode :: Default . is_default( ) ) ;
2499+ assert ! ( !PermissionMode :: BypassPermissions . is_default( ) ) ;
24882500 assert ! ( !PermissionMode :: AcceptEdits . is_default( ) ) ;
24892501 assert ! ( !PermissionMode :: DontAsk . is_default( ) ) ;
24902502 assert ! ( !PermissionMode :: Plan . is_default( ) ) ;
24912503 }
24922504
24932505 #[ test]
24942506 fn test_permission_mode_display ( ) {
2495- assert_eq ! ( format!( "{}" , PermissionMode :: DontAsk ) , "dontAsk" ) ;
2507+ assert_eq ! (
2508+ format!( "{}" , PermissionMode :: BypassPermissions ) ,
2509+ "bypassPermissions"
2510+ ) ;
24962511 assert_eq ! ( format!( "{}" , PermissionMode :: Default ) , "default" ) ;
24972512 }
24982513
@@ -2504,9 +2519,10 @@ channels = "ALL"
25042519 Some ( PermissionMode :: DontAsk ) ,
25052520 )
25062521 . expect ( "test config" ) ;
2522+
25072523 let s = config. summary ( ) ;
25082524 assert ! (
2509- s. contains( "permission_mode=dontAsk " ) ,
2525+ s. contains( "permission_mode=bypassPermissions " ) ,
25102526 "summary should include permission_mode, got: {s}"
25112527 ) ;
25122528 }
@@ -2524,7 +2540,7 @@ channels = "ALL"
25242540 }
25252541
25262542 #[ test]
2527- fn test_default_config_rejects_interactive_permissions ( ) {
2543+ fn test_default_config_uses_bypass_permissions ( ) {
25282544 let config = test_config ( SubscribeMode :: Mentions ) ;
25292545 assert_eq ! (
25302546 config. permission_config. effective_mode,
@@ -2540,6 +2556,7 @@ channels = "ALL"
25402556 let cases = [
25412557 ( "default" , PermissionMode :: Default ) ,
25422558 ( "accept-edits" , PermissionMode :: AcceptEdits ) ,
2559+ ( "bypass-permissions" , PermissionMode :: BypassPermissions ) ,
25432560 ( "dont-ask" , PermissionMode :: DontAsk ) ,
25442561 ( "plan" , PermissionMode :: Plan ) ,
25452562 ] ;
@@ -2554,12 +2571,14 @@ channels = "ALL"
25542571
25552572 #[ test]
25562573 fn test_permission_mode_value_enum_camel_case_aliases ( ) {
2557- // Operators may set env vars using the camelCase wire-format strings.
2558- // The #[value(alias)] attributes ensure these parse correctly.
2574+ // Operators may set env vars using the camelCase wire-format strings
2575+ // (e.g. BUZZ_ACP_PERMISSION_MODE=bypassPermissions). The #[value(alias)]
2576+ // attributes ensure these parse correctly.
25592577 use clap:: ValueEnum ;
25602578 let cases = [
25612579 ( "default" , PermissionMode :: Default ) ,
25622580 ( "acceptEdits" , PermissionMode :: AcceptEdits ) ,
2581+ ( "bypassPermissions" , PermissionMode :: BypassPermissions ) ,
25632582 ( "dontAsk" , PermissionMode :: DontAsk ) ,
25642583 ( "plan" , PermissionMode :: Plan ) ,
25652584 ] ;
@@ -2572,18 +2591,6 @@ channels = "ALL"
25722591 }
25732592 }
25742593
2575- #[ test]
2576- fn test_permission_mode_rejects_unattended_bypass ( ) {
2577- use clap:: ValueEnum ;
2578-
2579- for input in [ "bypass-permissions" , "bypassPermissions" ] {
2580- assert ! (
2581- PermissionMode :: from_str( input, true ) . is_err( ) ,
2582- "{input:?} must not disable the ACP permission boundary"
2583- ) ;
2584- }
2585- }
2586-
25872594 /// Helper: resolve idle_timeout_secs using the same precedence logic as Config::from_args.
25882595 /// Precedence: explicit --idle-timeout > --turn-timeout (deprecated) > `DEFAULT_IDLE_TIMEOUT_SECS`.
25892596 fn resolve_idle_timeout ( idle : Option < u64 > , turn : Option < u64 > ) -> u64 {
0 commit comments