Moderation providers

Configure avatar content moderation with OpenAI’s moderation API.

Edit this page View Markdown

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:

  1. Check the image against maxAvatarSize (default 1 MB).
  2. Resize to 256x256 pixels and convert to WebP.
  3. If a moderation provider is configured, run the image through it.
  4. If approved (or no provider configured), hand the image to the upload provider.
  5. Delete the previous avatar, if any.

Type to search.