TestProcAdapterEnforcesAgentPolicy pins the security promise: the adapter's supervisor uses the agent's CommandValidator, so a command the one-shot exec would refuse is refused here too — @proc is not a side door.
(t *testing.T)
| 81 | // supervisor uses the agent's CommandValidator, so a command the one-shot |
| 82 | // exec would refuse is refused here too — @proc is not a side door. |
| 83 | func TestProcAdapterEnforcesAgentPolicy(t *testing.T) { |
| 84 | cli := &ChatCLI{logger: zap.NewNop()} |
| 85 | t.Cleanup(cli.shutdownProcSupervisor) |
| 86 | a := &procToolAdapter{cli: cli} |
| 87 | |
| 88 | if _, err := a.Start("sudo rm -rf /", ""); err == nil { |
| 89 | t.Fatal("dangerous command must be refused by the shared validator") |
| 90 | } |
| 91 | } |