From 2f8674471b27cc8c72c7ff5777903faa6d15f793 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Fri, 27 Mar 2026 12:06:52 +0100 Subject: [PATCH] Fix one-argument-per-line style in prompt injection guardrail Signed-off-by: Bryan Frimin --- pkg/agent/guardrail/prompt_injection.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/agent/guardrail/prompt_injection.go b/pkg/agent/guardrail/prompt_injection.go index d100934ff..1ed0a0dc9 100644 --- a/pkg/agent/guardrail/prompt_injection.go +++ b/pkg/agent/guardrail/prompt_injection.go @@ -56,7 +56,9 @@ func (g *PromptInjectionGuardrail) Check(ctx context.Context, messages []llm.Mes return &agent.GuardrailResult{Tripwire: false}, nil } - resp, err := g.client.ChatCompletion(ctx, &llm.ChatCompletionRequest{ + resp, err := g.client.ChatCompletion( + ctx, + &llm.ChatCompletionRequest{ Model: "gpt-4o-mini", Messages: []llm.Message{ { @@ -70,12 +72,15 @@ func (g *PromptInjectionGuardrail) Check(ctx context.Context, messages []llm.Mes }, MaxTokens: new(10), Temperature: new(0.0), - }) + }, + ) if err != nil { // If the classifier fails, allow the message through rather than // blocking legitimate users. The system prompt hardening and // tool-level authorization provide defense in depth. - g.logger.WarnCtx(ctx, "prompt injection classifier failed, allowing message through", + g.logger.WarnCtx( + ctx, + "prompt injection classifier failed, allowing message through", log.Error(err), ) return &agent.GuardrailResult{Tripwire: false}, nil