fix(agentloop): wire AllowedPaths into sandbox MountDirs for bash access#223
fix(agentloop): wire AllowedPaths into sandbox MountDirs for bash access#223birdmanmandbir merged 5 commits intomainfrom
Conversation
All subagents need bash to run git diff, flicknote get, ls, etc. The ttal tools config was missing it while claude-code config had it.
Convert cfg.AllowedPaths into read-only sandbox.Mount entries when building ExecConfig so the seatbelt sandbox policy includes file-read* rules for project directories. Previously bash commands were denied filesystem access to project dirs because MountDirs was never populated.
PR ReviewScope: Changes in this PR only — Critical IssuesNone. Important Issues[loop.go:80-84] When var mounts []sandbox.Mount
for _, p := range cfg.AllowedPaths {
mounts = append(mounts, sandbox.Mount{Source: p, Target: p, ReadOnly: true})
}[loop.go:80-84] No validation of The current callers always pass validated absolute paths, but for _, p := range cfg.AllowedPaths {
if p == "" || !filepath.IsAbs(p) {
return nil, fmt.Errorf("agentloop: AllowedPaths entry %q must be a non-empty absolute path", p)
}
}Suggestions[loop_test.go] Missing test for nil/empty
[loop_test.go] No combined The existing Positive Observations
VERDICT: LGTMThe core fix is correct. The two important issues above are worth addressing — the nil-vs-empty-slice is a quick one-liner and the validation guard matches the existing style in |
… empty slice - Replace make([]sandbox.Mount, len(...)) with var + append so nil AllowedPaths produces nil MountDirs (not a non-nil empty slice) - Validate each AllowedPaths entry is a non-empty absolute path before constructing mounts — returns an early error matching the existing guard pattern in Run() - Add tests: nil AllowedPaths, invalid path errors, combined SandboxEnv+AllowedPaths
Triage UpdateFixed
|
Summary
ttal explore --projectbash tool was blocked by seatbelt sandbox — the project directory had nofile-read*rulescfg.AllowedPathswas never converted tosandbox.Mountentries inExecConfigwhen building it inloop.goAllowedPathsentry to a read-onlysandbox.Mount(Source == Target, as required by seatbelt)Changes
pkg/agentloop/loop.go: populateExecConfig.MountDirsfromcfg.AllowedPathswithReadOnly: truepkg/agentloop/loop_test.go: addTestRun_AllowedPathsInMountDirs— verifies mounts are present in the context ExecConfig afterRun()Test plan
TestRun_AllowedPathsInMountDirsfails before fix, passes aftermake test)make ci)