---
title: "Choose moderation providers"
description: "Check images with Azure AI Content Safety, ask OpenAI's moderation for a second opinion, and match known abuse material with Project Arachnid Shield, over one set of categories and thresholds, with a statement of reasons for every decision."
canonical_url: "https://nuxt-backend.dev/docs/build/ai/content-safety/providers"
---
# Choose moderation providers

> Check images with Azure AI Content Safety, ask OpenAI's moderation for a second opinion, and match known abuse material with Project Arachnid Shield, over one set of categories and thresholds, with a statement of reasons for every decision.

Version: nuxt-backend 0.6.x · Tab: Build · Kind: how-to · Status: experimental

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

- **You get:** images checked by a provider made for it, a second opinion where a score is close, known abuse material stopped before anything else sees it, one set of categories and thresholds across providers, and a statement of reasons for every decision.
- **You do:** create each provider's account, set its key on the deployment, and name the providers in `setupAi({ moderation })`.

[Content safety](https://nuxt-backend.dev/docs/build/ai/content-safety) checks text with a safety model through your gateway. That model reads images too where the Convex AI Gateway serves Llama Guard 4, but a model of its kind is no image moderation service: it scores no nudity in artwork, and it knows no list of known abuse material. The providers on this page take the images instead.

## Name the providers

```ts [backend/ai.ts]
import { arachnidShield, azureContentSafety, openaiModeration, setupAi } from 'nuxt-backend/ai'

export const ai = setupAi(components, {
  billing,
  moderation: {
    images: [azureContentSafety({ region: 'francecentral' })],
    secondOpinion: openaiModeration(),
    knownAbuse: arachnidShield(),
    policy: { version: '2026-11-08' },
  },
})
```

A check then runs in this order:

1. **The known-abuse match**, on every image, before any other provider sees its bytes. A match blocks the content whatever `block` says, escalates it, sends the image nowhere else, and records its SHA-256, never the image. Only an explicit "no known match" clears an image: an answer Shield gives with no classification it knows refuses the content as unchecked. `knownAbuse` needs `log`, so `setupAi` refuses it beside `log: false`.
2. **The text classifier** reads the text, and **the image providers** read the images. With no image provider named, the classifier reads the images too, as before. No image provider here judges `minors_sexual` in an image, so a classifier that reads images (Llama Guard 4 on the Convex AI Gateway) also reads them for that one category, and only its `S4` counts.
3. **The second opinion**, only when a score sits just under its threshold (within 0.15). It can raise a score, never lower one.

Any provider flagging a category blocks it. A provider that fails, times out or answers something it cannot read refuses the content as unchecked (`unavailable`, reason `provider_refused`), which a job tries again. Each provider's key goes on the deployment, named after what it does:

<table>
<thead>
  <tr>
    <th>
      Provider
    </th>
    
    <th>
      Factory
    </th>
    
    <th>
      Env
    </th>
    
    <th>
      Reads
    </th>
    
    <th>
      Notes
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Azure AI Content Safety
    </td>
    
    <td>
      <code>
        azureContentSafety({ region })
      </code>
    </td>
    
    <td>
      <code>
        CONTENT_SAFETY_ENDPOINT
      </code>
      
      , <code>
        CONTENT_SAFETY_KEY
      </code>
    </td>
    
    <td>
      Text, images
    </td>
    
    <td>
      Hate, sexual, violence and self-harm at 4 severities for images, artwork included. Your own resource, in the region you choose; inputs are neither stored nor trained on. Images up to 4 MB and 7200 px a side: a larger one is refused <code>
        invalid_input
      </code>
      
       (reason <code>
        too_large
      </code>
      
      ), naming the stage, so downscale a model's output before you check it. No check for abuse material
    </td>
  </tr>
  
  <tr>
    <td>
      OpenAI moderation
    </td>
    
    <td>
      <code>
        openaiModeration()
      </code>
    </td>
    
    <td>
      <code>
        SECOND_OPINION_KEY
      </code>
    </td>
    
    <td>
      Text, images
    </td>
    
    <td>
      <code>
        omni-moderation-latest
      </code>
      
      , free. For images it scores sexual content, violence and self-harm only. Never send it suspected abuse material
    </td>
  </tr>
  
  <tr>
    <td>
      Project Arachnid Shield
    </td>
    
    <td>
      <code>
        arachnidShield()
      </code>
    </td>
    
    <td>
      <code>
        KNOWN_ABUSE_KEY
      </code>
    </td>
    
    <td>
      Images
    </td>
    
    <td>
      A hash match against known child sexual abuse material, from the Canadian Centre for Child Protection, free once your organization is vetted
    </td>
  </tr>
  
  <tr>
    <td>
      Llama Guard 4
    </td>
    
    <td>
      <code>
        text
      </code>
      
       (the default)
    </td>
    
    <td>
      Through your AI gateway
    </td>
    
    <td>
      Text, images
    </td>
    
    <td>
      The 14 MLCommons hazards. See <a href="https://nuxt-backend.dev/docs/build/ai/content-safety">
        Content safety
      </a>
    </td>
  </tr>
</tbody>
</table>

Planned, not built yet: Hive, Google Cloud's content safety (Vision SafeSearch), Amazon Rekognition and Sightengine for images, and Microsoft PhotoDNA as a second known-abuse match. None is exported until its adapter ships.

Sources: [Azure AI Content Safety](https://learn.microsoft.com/azure/ai-services/content-safety/overview), [OpenAI moderation](https://platform.openai.com/docs/guides/moderation), [Project Arachnid](https://www.projectarachnid.ca/). The Arachnid Shield adapter follows the service's published API, and has not been run against a live account yet.

## Read the categories

Every provider maps its answer onto one list, so `block`, `escalate` and the thresholds read the same whichever provider answered:

<table>
<thead>
  <tr>
    <th>
      Category
    </th>
    
    <th>
      Azure
    </th>
    
    <th>
      OpenAI
    </th>
    
    <th>
      Llama Guard 4
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        sexual
      </code>
    </td>
    
    <td>
      Sexual, severity 4 or more
    </td>
    
    <td>
      <code>
        sexual
      </code>
    </td>
    
    <td>
      S12
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        suggestive
      </code>
    </td>
    
    <td>
      Sexual, severity 2
    </td>
    
    <td>
      Not judged
    </td>
    
    <td>
      Not judged
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        minors_sexual
      </code>
    </td>
    
    <td>
      Not judged
    </td>
    
    <td>
      <code>
        sexual/minors
      </code>
      
      , text only
    </td>
    
    <td>
      S4
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        violence
      </code>
    </td>
    
    <td>
      Violence
    </td>
    
    <td>
      <code>
        violence
      </code>
      
      , <code>
        violence/graphic
      </code>
    </td>
    
    <td>
      S1
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        self_harm
      </code>
    </td>
    
    <td>
      SelfHarm
    </td>
    
    <td>
      <code>
        self-harm/*
      </code>
    </td>
    
    <td>
      S11
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        hate
      </code>
    </td>
    
    <td>
      Hate
    </td>
    
    <td>
      <code>
        hate/*
      </code>
      
      , text only
    </td>
    
    <td>
      S10
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        weapons
      </code>
    </td>
    
    <td>
      Not judged
    </td>
    
    <td>
      <code>
        illicit/violent
      </code>
      
      , text only
    </td>
    
    <td>
      S9
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        drugs
      </code>
    </td>
    
    <td>
      Not judged
    </td>
    
    <td>
      <code>
        illicit
      </code>
      
      , text only
    </td>
    
    <td>
      S2
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        csam_match
      </code>
    </td>
    
    <td>
      No
    </td>
    
    <td>
      No
    </td>
    
    <td>
      No: Arachnid Shield alone
    </td>
  </tr>
</tbody>
</table>

A category a provider cannot judge is kept as not judged, never as a score of 0: OpenAI answers 0 for `sexual/minors` in an image, and that never reads as safe.

A verdict carries `categories` (the shared ones at or above their threshold), `codes` (each provider's own, such as `S12` or `Sexual:6`), `scores` and `providers`. `block` and `escalate` take either:

```ts [backend/ai.ts]
moderation: {
  images: [azureContentSafety({ region: 'francecentral' })],
  block: ['sexual', 'minors_sexual', 'csam_match', 'S4'],
  escalate: ['minors_sexual'],
  thresholds: { violence: 0.6 },
}
```

The default thresholds suit an app that takes no sexual content, as card processors ask of AI image generation: `sexual` 0.3, `minors_sexual` 0.05, `suggestive` 0.7, and `violence`, `self_harm` and `hate` 0.5. At `stage: 'prompt'` or `stage: 'output'`, `sexual` and `suggestive` default to 0.05, any signal, since no hash list can help with what a model makes. A threshold you name wins there: an app that draws swimwear or a kiss in its comics sets `suggestive: 0.7`, or every such image Azure rates severity 2 is blocked. `minors_sexual` never goes above 0.05 at those stages.

With an image provider and no `block: 'all'`, `block` must cover `sexual` (or `S12`): child sexual abuse material no hash list knows is otherwise caught only where the classifier reads images, so `setupAi` refuses a policy that would let it through.

## Give people their statement of reasons

Every flagged check is recorded with the providers, the scores, the thresholds, your `policy.version`, and that it was decided by automated means. That is what the DSA's Article 17 asks a statement of reasons to hold. `getModerationStatement` gives it to the person the content came from, and to administrators:

```ts [backend/ai.ts]
export const { getCosts, listModerationFlags, getModerationStatement } = ai.api
```

```vue [app/pages/statement/[id].vue]
<script setup lang="ts">
import { api } from '#backend/api'

const route = useRoute()
const statement = useQuery(api.ai.getModerationStatement, () => ({ flagId: route.params.id as string }))
</script>
```

It answers `{ decision, automated, categories, providers, policyVersion, subject, stage, at }`. Your page adds the redress: how to appeal, and to whom.

Suspected child sexual abuse material gives the person who uploaded it no statement: a known-abuse match, and a flag on legal hold for `minors_sexual` or `S4` from a classifier. Telling them could warn them off an investigation, so report it to the authorities instead ([Follow the CSAM playbook](https://nuxt-backend.dev/docs/ship/compliance/moderation/csam-playbook)); an administrator still reads the statement. Whether to withhold it is a legal call for you, the operator: this is not legal advice.

## Know what the law asks

A small host in the EU owes, under the Digital Services Act:

- **Article 16:** a notice form anyone can use to report illegal content ([Moderate user content](https://nuxt-backend.dev/docs/ship/compliance/moderation)).
- **Article 17:** a statement of reasons for every restriction, as above.
- **Article 18:** a report to the authorities of any information about a crime that threatens someone's life or safety.
- **Article 14:** terms that describe the automated tools you moderate with.

Scanning uploads is not something the law asks of a host: the interim derogation (Regulation 2021/1232) covers interpersonal communications services only. Card processors and payment providers do expect it of an app that generates or hosts images. This is not legal advice.

## Check it

`npx nuxt-backend doctor` reports [`ai-moderation-providers`](https://nuxt-backend.dev/docs/reference/cli/diagnostics#ai-moderation-providers): each provider's keys on the deployment, a known-abuse match beside image checks, an EU region for Azure when `inferenceRegion: 'eu'` pins your processing there, and where new abuse material in an image is caught when no image provider judges minors.

In tests, `nuxt-backend/test` answers every provider with a fake: `TEST_UNSAFE('sexual')` in text or an image's bytes finds that category, `TEST_FAINT('violence')` finds it faintly, and `TEST_KNOWN_ABUSE` matches the list. No call leaves the test.

## Related

- [Content safety](https://nuxt-backend.dev/docs/build/ai/content-safety): the text classifier, and reports.
- [Moderate user content](https://nuxt-backend.dev/docs/ship/compliance/moderation): the DSA's notice form and appeals.
- [Follow the CSAM playbook](https://nuxt-backend.dev/docs/ship/compliance/moderation/csam-playbook): what to do when a match is found.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
