Skip to content

Introduction to Arcjet Content Moderation

Arcjet content moderation evaluates untrusted text for harmful content before it is stored, displayed, or forwarded to another service. Use it on user messages, tool-call results, and model outputs at the same action boundary as Agent guards.

What is Arcjet? Arcjet is the runtime security platform that ships with your code. Enforce budgets, stop prompt injection, detect bots, and protect personal information with Arcjet's AI security building blocks.

Content moderation is a Guard rule. There is no protect() / HTTP-request variant. Call it from guard() in JavaScript or Python, or Guard in Go.

Use content moderation when you need a decision on text that is about to leave your control or be shown to a user, for example:

  • User-facing chat and support assistants — block harmful messages before they are stored or displayed.
  • Agent tool results and model outputs — scan generated text before it is forwarded to another tool, a customer, or a third-party API.
  • Moderation at the action boundary — the same guard() call can combine content moderation with rate limiting or prompt injection detection.

Content moderation answers a different question from prompt injection detection (hostile instructions aimed at the model) and sensitive information detection (PII and other regulated data). Combine them when a single untrusted string needs more than one check.

  1. You configure moderateContent() (JavaScript), ModerateContent() (Python), or GuardModerateContent (Go) once and reuse the rule.
  2. At the action boundary, bind the untrusted text and submit it with guard() / Guard.
  3. Arcjet returns ALLOW or DENY. A denial has reason MODERATE_CONTENT.
  4. The per-rule result is a binary detected / Detected verdict plus optional billing in text_units.

The result shape does not include per-category scores.

SDKPublic APINotes
JavaScript / TypeScriptmoderateContent()experimental_moderateContent is a deprecated alias.
PythonModerateContent()experimental_ModerateContent is a deprecated alias (DeprecationWarning).
GoGuardModerateContentExperimentalGuardModerateContent* aliases are deprecated until 1.0.

mode: "DRY_RUN" / ModeDryRun evaluates the rule without blocking. Use this to measure detections before switching to "LIVE".

Content moderation is priced based on usage, measured in text_units when the service reports billing. See the pricing page for details.

Discussion