mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-15 07:30:53 +02:00
22 lines
570 B
Go
22 lines
570 B
Go
package handler
|
|
|
|
import "testing"
|
|
|
|
func TestHITLBuiltInWhitelistExemptsWriteFile(t *testing.T) {
|
|
h := &AgentHandler{}
|
|
req := h.hitlRequestWithMergedConfigWhitelist(&HITLRequest{
|
|
Enabled: true,
|
|
Mode: "approval",
|
|
})
|
|
|
|
manager := NewHITLManager(nil, nil)
|
|
manager.ActivateConversation("conversation-1", req)
|
|
|
|
if manager.NeedsToolApproval("conversation-1", "write_file") {
|
|
t.Fatal("write_file should use the built-in HITL exemption")
|
|
}
|
|
if !manager.NeedsToolApproval("conversation-1", "exec") {
|
|
t.Fatal("non-exempt tools should still require approval")
|
|
}
|
|
}
|