DEV Community

Korvus
Korvus

Posted on

AI chat moderation in Roblox — by meaning, not a word list

Word-list chat filters break the moment someone types a s s a s s i n with spaces, or a slur spelled with a 0, or a perfectly innocent word that happens to contain a banned substring. You end up in an endless arms race patching your blocklist.

An AI model reads the meaning of a message, so it catches obfuscated toxicity and stops false-flagging harmless phrases.

One server-side call

local Cortex = require(game.ServerStorage.Cortex)
local ai = Cortex.new("YOUR_KEY")

local verdict = ai:ask(
    "You moderate a kids' game chat. Reply with exactly one word: SAFE or BLOCK.",
    message
)
if verdict == "BLOCK" then
    -- don't send it
end
Enter fullscreen mode Exit fullscreen mode

The reply is one word, so it's cheap: with Cortex you're billed on output tokens only, and repeated messages are served from cache for free — so moderating your whole chat costs a fraction of a Robux. You pay in Robux, no credit card, and the key stays server-side.

Tips

  • Give the model your game's context ("kids' game", "PvP trash-talk is fine") so it matches your tolerance.
  • Cache identical messages — spammers repeat themselves.
  • Log BLOCK verdicts so you can tune the prompt.

Free open beta and open-source kit: https://github.com/cortex-rbx/roblox-ai-kit · demo: https://cortex-rbx.github.io

Top comments (0)