@@ -46,7 +46,7 @@ const BASH_DENY_RULES = [
4646 { id : "chmod-baudbot-source" , pattern : new RegExp ( `chmod\\b.*${ escapeRegex ( BAUDBOT_SOURCE_DIR ) } ` ) , label : "chmod on baudbot source repo" , severity : "block" } ,
4747 { id : "chown-baudbot-source" , pattern : new RegExp ( `chown\\b.*${ escapeRegex ( BAUDBOT_SOURCE_DIR ) } ` ) , label : "chown on baudbot source repo" , severity : "block" } ,
4848 { id : "tee-baudbot-source" , pattern : new RegExp ( `tee\\s+.*${ escapeRegex ( BAUDBOT_SOURCE_DIR ) } /` ) , label : "tee write to baudbot source repo" , severity : "block" } ,
49- { id : "chmod-runtime-security" , pattern : / c h m o d \b .* \/ ( \. p i \/ a g e n t \/ e x t e n s i o n s \/ t o o l - g u a r d | r u n t i m e \/ s l a c k - b r i d g e \/ s e c u r i t y ) \. / , label : "chmod on protected runtime security file" , severity : "block" } ,
49+ { id : "chmod-runtime-security" , pattern : / c h m o d \b .* \/ ( \. p i \/ a g e n t \/ e x t e n s i o n s \/ t o o l - g u a r d | r u n t i m e \/ s l a c k - b r i d g e \/ s e c u r i t y | o p t \/ b a u d b o t \/ c u r r e n t \/ s l a c k - b r i d g e \/ s e c u r i t y ) \. / , label : "chmod on protected runtime security file" , severity : "block" } ,
5050 // Credential exfiltration
5151 { id : "env-exfil-curl" , pattern : / \b e n v \b .* \| \s * ( c u r l | w g e t | n c ) \b / , label : "Piping environment to network tool" , severity : "block" } ,
5252 { id : "cat-env-curl" , pattern : / c a t \s + .* \. e n v .* \| \s * ( c u r l | w g e t | n c ) \b / , label : "Exfiltrating .env via network" , severity : "block" } ,
@@ -77,8 +77,8 @@ function isAllowedWritePath(filePath) {
7777const PROTECTED_RUNTIME_FILES = [
7878 `${ AGENT_HOME } /.pi/agent/extensions/tool-guard.ts` ,
7979 `${ AGENT_HOME } /.pi/agent/extensions/tool-guard.test.mjs` ,
80- `${ AGENT_HOME } /runtime /slack-bridge/security.mjs` ,
81- `${ AGENT_HOME } /runtime /slack-bridge/security.test.mjs` ,
80+ `/opt/baudbot/current /slack-bridge/security.mjs` ,
81+ `/opt/baudbot/current /slack-bridge/security.test.mjs` ,
8282] ;
8383
8484function isProtectedPath ( filePath ) {
@@ -307,7 +307,7 @@ describe("tool-guard: source repo protection (bash)", () => {
307307 assert . equal ( checkBashCommand ( `chmod a+w ${ AGENT_HOME } /.pi/agent/extensions/tool-guard.ts` ) . blocked , true ) ;
308308 } ) ;
309309 it ( "blocks chmod on runtime security.mjs" , ( ) => {
310- assert . equal ( checkBashCommand ( ` chmod 777 ${ AGENT_HOME } /runtime/ slack-bridge/security.mjs` ) . blocked , true ) ;
310+ assert . equal ( checkBashCommand ( " chmod 777 /opt/baudbot/current/ slack-bridge/security.mjs" ) . blocked , true ) ;
311311 } ) ;
312312} ) ;
313313
@@ -358,8 +358,8 @@ describe("tool-guard: workspace confinement (allow-list)", () => {
358358 it ( `allows write to ${ AGENT_HOME } /.pi/agent/skills/new-skill/SKILL.md` , ( ) => {
359359 assert . equal ( checkWritePath ( `${ AGENT_HOME } /.pi/agent/skills/new-skill/SKILL.md` ) , false ) ;
360360 } ) ;
361- it ( `allows write to ${ AGENT_HOME } /runtime/ slack-bridge/bridge.mjs` , ( ) => {
362- assert . equal ( checkWritePath ( ` ${ AGENT_HOME } /runtime/ slack-bridge/bridge.mjs` ) , false ) ;
361+ it ( "blocks write to /opt/baudbot/current/ slack-bridge/bridge.mjs" , ( ) => {
362+ assert . equal ( checkWritePath ( "/opt/baudbot/current/ slack-bridge/bridge.mjs" ) , true ) ;
363363 } ) ;
364364
365365 // BLOCKED: outside agent home
@@ -430,13 +430,13 @@ describe("tool-guard: protected runtime security files", () => {
430430 assert . equal ( checkWritePath ( `${ AGENT_HOME } /.pi/agent/extensions/tool-guard.test.mjs` ) , true ) ;
431431 } ) ;
432432 it ( "blocks write to runtime security.mjs" , ( ) => {
433- assert . equal ( checkWritePath ( ` ${ AGENT_HOME } /runtime/ slack-bridge/security.mjs` ) , true ) ;
433+ assert . equal ( checkWritePath ( "/opt/baudbot/current/ slack-bridge/security.mjs" ) , true ) ;
434434 } ) ;
435435 it ( "blocks write to runtime security.test.mjs" , ( ) => {
436- assert . equal ( checkWritePath ( ` ${ AGENT_HOME } /runtime/ slack-bridge/security.test.mjs` ) , true ) ;
436+ assert . equal ( checkWritePath ( "/opt/baudbot/current/ slack-bridge/security.test.mjs" ) , true ) ;
437437 } ) ;
438- it ( "allows write to runtime bridge.mjs (agent-modifiable )" , ( ) => {
439- assert . equal ( checkWritePath ( ` ${ AGENT_HOME } /runtime/ slack-bridge/bridge.mjs` ) , false ) ;
438+ it ( "blocks write to runtime bridge.mjs (immutable release path )" , ( ) => {
439+ assert . equal ( checkWritePath ( "/opt/baudbot/current/ slack-bridge/bridge.mjs" ) , true ) ;
440440 } ) ;
441441 it ( "allows write to runtime non-security extensions" , ( ) => {
442442 assert . equal ( checkWritePath ( `${ AGENT_HOME } /.pi/agent/extensions/auto-name.ts` ) , false ) ;
0 commit comments