janiussyafiq commented on code in PR #13622:
URL: https://github.com/apache/apisix/pull/13622#discussion_r3489758340


##########
apisix/plugins/ai-lakera-guard.lua:
##########
@@ -240,8 +240,7 @@ function _M.lua_body_filter(conf, ctx, headers, body)
     end
 
     if ctx.var.request_type == "ai_stream" then
-        -- alert (shadow) mode non-blocking
-        if conf.action == "alert" then
+        if conf.action == "alert" and conf.fail_open then

Review Comment:
   alert mode still take place, however if fail_open=false, then for streaming 
we will need to buffer the response since in case of a lakera error/timeout we 
adhere to block the response. if fail_open=true then we don't need to apply 
that buffering mechanism. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to