Moderation providers
Configure avatar content moderation with OpenAI’s moderation API.
Moderation providers can reject inappropriate team avatars. Without one, rCTF accepts any image that passes the normal file and image checks.
Configuration
avatarsModeration: provider: name: moderation/openai options: apiKey: sk-... allowOnInternalError: true| Field | Type | Default | Description |
|---|---|---|---|
avatarsModeration.provider |
object |
- | Moderation provider configuration |
avatarsModeration.allowOnInternalError |
boolean |
true |
Whether to allow avatar uploads when the moderation API fails |
Tip
With the default allowOnInternalError: true{:ts}, avatar uploads continue when the moderation service is unavailable. Set it to false to reject uploads whenever moderation cannot complete.
Providers
moderation/openai
Uses OpenAI’s moderation API to check avatar images for policy violations.
avatarsModeration: provider: name: moderation/openai options: apiKey: sk-... model: omni-moderation-latest # Optional| Option | Environment Variable | Default | Description |
|---|---|---|---|
apiKey |
RCTF_MODERATION_OPENAI_API_KEY or OPENAI_API_KEY |
- | OpenAI API key |
model |
RCTF_MODERATION_OPENAI_MODEL |
omni-moderation-latest |
OpenAI moderation model |
The provider sends a 256-by-256 WebP copy of the avatar to OpenAI. rCTF rejects the upload when the moderation response flags the image.
Moderation pipeline
When a user uploads an avatar, the pipeline runs in this order:
- Check the image against
maxAvatarSize(default 1 MB). - Resize to 256x256 pixels and convert to WebP.
- If a moderation provider is configured, run the image through it.
- If approved (or no provider configured), hand the image to the upload provider.
- Delete the previous avatar, if any.