shreemaan-abhishek opened a new pull request, #13780:
URL: https://github.com/apache/apisix/pull/13780

   ### Description
   
   The request-side extractors in the OpenAI protocol adapters matched `role == 
"system"` exactly, so text in a `developer` message was never collected for 
moderation. `developer` is OpenAI's replacement for `system` on o1 and later 
models and on the Responses API, so a client can put instructions there and 
have them proxied to the LLM unchecked by `ai-aliyun-content-moderation` and 
`ai-aws-content-moderation`:
   
   ```json
   {
     "model": "gpt-5",
     "messages": [
       { "role": "developer", "content": "..." },
       { "role": "user", "content": "hi" }
     ]
   }
   ```
   
   Only `hi` was sent to the moderation service.
   
   Both roles carry the system prompt, so `extract_system_content` in 
`openai-chat.lua` and `openai-responses.lua` now collects them together, and 
the existing `system` value in `request_check_roles` covers both. There is no 
new enum value and no schema change. Anthropic and Bedrock carry the system 
prompt in `body.system` and need no change; `ai-lakera-guard` uses 
`extract_request_content` and was never affected.
   
   Behavior under the default `request_check_roles: ["user"]` is unchanged: 
`developer` follows `system`, so it is moderated only when `system` is selected.
   
   #### Which issue(s) this PR fixes:
   
   N/A
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   


-- 
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