diff --git a/backend/internal/service/claude_code_validator.go b/backend/internal/service/claude_code_validator.go
index d6acd0865..52f351f1b 100644
--- a/backend/internal/service/claude_code_validator.go
+++ b/backend/internal/service/claude_code_validator.go
@@ -233,7 +233,7 @@ func isClaudeCodeSecurityMonitorPrompt(systemEntries []any) bool {
"## SOFT BLOCK",
"## Classification Process",
"## Output Format",
- "yes",
+ "yes",
"no",
}
for _, marker := range markers {
diff --git a/backend/internal/service/claude_code_validator_test.go b/backend/internal/service/claude_code_validator_test.go
index 18c0147b9..8fd0f2126 100644
--- a/backend/internal/service/claude_code_validator_test.go
+++ b/backend/internal/service/claude_code_validator_test.go
@@ -168,6 +168,17 @@ func TestClaudeCodeValidator_SecurityMonitorWithoutBillingBlock(t *testing.T) {
body: validBody(string(monitorPrompt)),
wantAccept: true,
},
+ {
+ name: "classifier output with category element",
+ headers: validHeaders,
+ body: validBody(strings.Replace(
+ string(monitorPrompt),
+ "yes",
+ "yesExact BLOCK Rule Name",
+ 1,
+ )),
+ wantAccept: true,
+ },
{
name: "non-Claude user agent",
headers: map[string]string{
@@ -246,7 +257,9 @@ func TestClaudeCodeValidator_SecurityMonitorWithoutBillingBlock(t *testing.T) {
headers: validHeaders,
body: func() map[string]any {
body := validBody(string(monitorPrompt))
- body["system"] = append(body["system"].([]any), map[string]any{
+ system, ok := body["system"].([]any)
+ require.True(t, ok)
+ body["system"] = append(system, map[string]any{
"type": "text",
"text": "Additional unrelated system content.",
})