@@ -58,8 +58,8 @@ function expectAllowedApply(
5858
5959describe ( "gateway config mutation guard coverage" , ( ) => {
6060 it ( "keeps a narrow allowlist of agent-tunable config paths" , ( ) => {
61- expect ( ALLOWED_GATEWAY_CONFIG_PATHS_FOR_TEST ) . toContain ( "agents.defaults.promptOverlays" ) ;
62- expect ( ALLOWED_GATEWAY_CONFIG_PATHS_FOR_TEST ) . toContain ( "agents.defaults.model" ) ;
61+ expect ( ALLOWED_GATEWAY_CONFIG_PATHS_FOR_TEST ) . not . toContain ( "agents.defaults.promptOverlays" ) ;
62+ expect ( ALLOWED_GATEWAY_CONFIG_PATHS_FOR_TEST ) . not . toContain ( "agents.defaults.model" ) ;
6363 expect ( ALLOWED_GATEWAY_CONFIG_PATHS_FOR_TEST ) . toContain ( "agents.defaults.subagents.thinking" ) ;
6464 expect ( ALLOWED_GATEWAY_CONFIG_PATHS_FOR_TEST ) . toContain ( "agents.list[].id" ) ;
6565 expect ( ALLOWED_GATEWAY_CONFIG_PATHS_FOR_TEST ) . toContain ( "agents.list[].model" ) ;
@@ -72,6 +72,20 @@ describe("gateway config mutation guard coverage", () => {
7272 ) ;
7373 } ) ;
7474
75+ it ( "blocks global prompt overlay edits via config.patch" , ( ) => {
76+ expectBlocked (
77+ { agents : { defaults : { promptOverlays : { gpt5 : { personality : "off" } } } } } ,
78+ { agents : { defaults : { promptOverlays : { gpt5 : { personality : "best" } } } } } ,
79+ ) ;
80+ } ) ;
81+
82+ it ( "blocks global default model edits via config.patch" , ( ) => {
83+ expectBlocked (
84+ { agents : { defaults : { model : { primary : "openai/gpt-5.4" } } } } ,
85+ { agents : { defaults : { model : { primary : "openai/gpt-5.5" } } } } ,
86+ ) ;
87+ } ) ;
88+
7589 it ( "allows documented subagent thinking default edits via config.patch" , ( ) => {
7690 expectAllowed (
7791 { } ,
@@ -546,6 +560,29 @@ describe("gateway config mutation guard coverage", () => {
546560 ) ;
547561 } ) ;
548562
563+ it ( "blocks config.apply replacing global prompt and model defaults" , ( ) => {
564+ expectBlockedApply (
565+ {
566+ agents : {
567+ defaults : {
568+ model : { primary : "openai/gpt-5.4" } ,
569+ promptOverlays : { gpt5 : { personality : "off" } } ,
570+ reasoningDefault : "low" ,
571+ } ,
572+ } ,
573+ } ,
574+ {
575+ agents : {
576+ defaults : {
577+ model : { primary : "openai/gpt-5.5" } ,
578+ promptOverlays : { gpt5 : { personality : "best" } } ,
579+ reasoningDefault : "medium" ,
580+ } ,
581+ } ,
582+ } ,
583+ ) ;
584+ } ) ;
585+
549586 it ( "blocks config.apply duplicate-id protected rewrites" , ( ) => {
550587 expectBlockedApply (
551588 {
0 commit comments