> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnifence.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt moderation

> Screen text prompts for blocked terms and policy violations before AI generation

Prompt moderation evaluates a text prompt against your client's keyword blocklist and a
language-model prohibition check. A prompt the model judges prohibited is rejected, and the reason
is returned on the completed job.

## Input

Submit a `multipart/form-data` request with:

| Field         | Type   | Required | Description                              |
| ------------- | ------ | -------- | ---------------------------------------- |
| `text`        | string | Yes      | The text prompt to moderate.             |
| `webhook_url` | string | No       | URL to receive the result on completion. |

```bash theme={null}
curl -X POST https://api.omnifence.ai/api/v1/moderate/prompt \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "text=A sunset over the ocean"
```

## Pipeline

Prompt moderation runs two sequential steps:

1. **Blocked keyword check.** The text is scanned against the configured blocklist. A match ends the
   pipeline before any further processing.
2. **LLM prohibition check.** A language model reviews the prompt for policy violations. If it judges
   the prompt prohibited, the job is rejected with `is_prohibited: true` and a short `reason`.

## Output

```json theme={null}
{
  "is_prohibited": true,
  "reason": "The prompt requests sexual content involving a minor.",
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "type": "prompt",
  "status": "completed",
  "created_at": "2026-05-19T12:00:00.000Z",
  "completed_at": "2026-05-19T12:00:01.500Z"
}
```

When `is_prohibited` is `true`, `reason` explains why the prompt was prohibited. A prompt that
passes returns `is_prohibited: false` with no `reason`. See [decision logic](/moderation/decisions)
for how the prohibition decision is determined.
