AI AGENTS

Pre-screen Replicate image prompts at the API gate

Intercepts inbound image-generation requests over a webhook, classifies each prompt against your content policy.

CategoryAI Agents
Enginesim
Difficultyintermediate
Triggerwebhook
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGeneration request arrives via webhookHTTP webhook
  • ActionClassify prompt against policy categoriesOpenAI
  • LogicBranch on whether any category exceeds threshold
  • ActionDispatch clean prompt to ReplicateReplicateReplicate
  • ActionLog verdict, scores, and prompt to PostgresPostgreSQLPostgres
  • OutputReturn prediction ID or rejection to callerHTTP webhook

What it does

This workflow sits in front of your Replicate image pipeline as a moderation gate. Every prompt your app submits is classified for policy violations (sexual, violent, hateful, self-harm, illegal) before any image is generated. Clean prompts pass through to Replicate; flagged prompts are rejected with a reason and never reach the model.

When to use it

Use it when end users can submit free-text prompts to an image generator and you need a hard guardrail before spending compute or risking unsafe output. It is the cheapest place to stop a bad request: before the model runs.

How it works

  1. 1A webhook receives the user's prompt, user ID, and request metadata.
  2. 2An OpenAI moderation classification scores the prompt against each policy category.
  3. 3A logic branch checks whether any category exceeds its threshold.
  4. 4If clean, the prompt is dispatched to Replicate to start the generation.
  5. 5Every verdict (allow or block) is written to Postgres with the prompt, scores, and timestamp.
  6. 6The webhook responds to the caller with either the prediction ID or a structured rejection.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect HTTP webhookTrigger any URL on agent actions.
  2. 2
    Connect OpenAIModels, embeddings, files.
  3. 3
    Connect ReplicateImage, video, and model inference.
  4. 4
    Connect PostgresAny Postgres URL — query, write, migrate.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.