Skip to main content
This example demonstrates how to use Agno’s built-in OpenAI moderation guardrail with an Agent. This example shows how to:
  1. Detect and block content that violates OpenAI’s content policy
  2. Handle both text and image content moderation
  3. Configure moderation for specific categories
  4. Use both sync and async moderation checks
  5. Customize moderation models and sensitivity settings

Code

openai_moderation.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Install libraries

3

Run example