Interfaze

logo

Beta

pricing

docs

blog

sign in

Get Started

Introduction

Examples

Vision

Concepts

Resources

Integrations

Guardrails & NSFW Detection

copy markdown

Programmatically define guardrail rules for both text and image content.

Guard Categories

The Guard system supports the following safety codes which can be added to your system prompt telling the model to block or filter out content that matches the code.

CodeDescription
S1Violent Crimes
S1_IMAGEGore (Image)
S2Non-Violent Crimes
S3Sex-Related Crimes
S4Child Sexual Exploitation
S5Defamation
S6Specialized Advice
S7Privacy
S8Intellectual Property
S9Indiscriminate Weapons
S10Hate
S11Suicide & Self-Harm
S12Sexual Content
S12_IMAGENudity (Image)
S13Elections
S14Code Interpreter Abuse
S15_IMAGENSFW (Image)
ALLAll categories

How to Enable Guardrails

To enable content safety guardrails, include the guard configuration in your system prompt using the following format:

OpenAI SDK

Vercel AI SDK

LangChain SDK

...

Output

...

Common Guardrail Examples

Basic Safety Guardrails

...

Comprehensive Content Filtering

...

Image Safety Detection

...

Guardrail response

...