fix(ai-content-moderation): moderate the OpenAI developer role - #13780
fix(ai-content-moderation): moderate the OpenAI developer role#13780shreemaan-abhishek wants to merge 3 commits into
developer role#13780Conversation
The request-side extractors in the OpenAI Chat and Responses adapters matched `role == "system"` exactly, so a prompt placed in a `developer` message - OpenAI's replacement for `system` on newer models - reached the LLM unmoderated by ai-aliyun-content-moderation and ai-aws-content-moderation. Both roles carry the system prompt, so extract_system_content now collects them together and the existing `system` selector in request_check_roles covers both. No new schema value.
|
Heads-up for whoever merges second: this appends TEST 51/52 to |
# Conflicts: # t/plugin/ai-aws-content-moderation.t
|
Merged Since the AWS plugin is role-selective as of #13773, the AWS coverage is now meaningful rather than incidental:
The |
|
Added end-to-end coverage for the Responses API path in
Reverting |
Description
The request-side extractors in the OpenAI protocol adapters matched
role == "system"exactly, so text in adevelopermessage was never collected for moderation.developeris OpenAI's replacement forsystemon o1 and later models and on the Responses API, so a client can put instructions there and have them proxied to the LLM unchecked byai-aliyun-content-moderationandai-aws-content-moderation:{ "model": "gpt-5", "messages": [ { "role": "developer", "content": "..." }, { "role": "user", "content": "hi" } ] }Only
hiwas sent to the moderation service.Both roles carry the system prompt, so
extract_system_contentinopenai-chat.luaandopenai-responses.luanow collects them together, and the existingsystemvalue inrequest_check_rolescovers both. There is no new enum value and no schema change. Anthropic and Bedrock carry the system prompt inbody.systemand need no change;ai-lakera-guardusesextract_request_contentand was never affected.Behavior under the default
request_check_roles: ["user"]is unchanged:developerfollowssystem, so it is moderated only whensystemis selected.Which issue(s) this PR fixes:
N/A
Checklist