AI AGENTS
Gate Replicate prompts with a self-hosted HuggingFace classifier
Screens submitted image prompts using a HuggingFace text-classification model instead of a third-party moderation API.
How it runs
The automated pipeline, trigger to output.
- TriggerPrompt submitted via webhookHTTP webhook
- ActionClassify prompt on HuggingFace endpointHugging Face
- LogicCompare top unsafe label to confidence floor
- ActionDispatch passing prompt to ReplicateReplicate
- ActionAppend label and decision to Postgres audit tablePostgres
- OutputRespond with prediction handle or denialHTTP webhook
What it does
This is a moderation gate for teams that prefer to run classification on their own HuggingFace inference endpoint rather than send prompts to a hosted moderation API. It applies a fine-tuned NSFW/toxicity text classifier to each prompt, blocks anything over your configured confidence floor, and only then lets Replicate generate.
When to use it
Reach for this when data-residency or model-control requirements rule out external moderation services, or when you have a domain-specific policy classifier you have trained yourself.
How it works
- 1A webhook receives the prompt and submitter identity.
- 2The prompt is sent to a HuggingFace text-classification endpoint, returning label probabilities.
- 3A logic step compares the top unsafe label against your confidence threshold.
- 4Prompts under the threshold are dispatched to Replicate for image generation.
- 5The classifier label, score, and final action are appended to a Postgres audit table.
- 6The caller receives the prediction handle or a typed denial response.
Set it up
What you configure once, before turning it on.
- 1Connect HTTP webhookTrigger any URL on agent actions.
- 2Connect Hugging FaceModels, datasets, spaces — the open-source hub.
- 3Connect ReplicateImage, video, and model inference.
- 4Connect PostgresAny Postgres URL — query, write, migrate.
- 5Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
- 6Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
- 7Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.
More AI Agents workflows
Custom Metrics Cardinality Spike Pager
A webhook from a Datadog monitor fires when custom-metric cardinality jumps; an agent pinpoints the offending metric and tag, estimates the added cost.
Sentry-to-Confluence Runbook Updater
When a Sentry issue is resolved, the agent finds the matching Confluence runbook page and proposes an inline update with the verified fix.
Stale Doc-PR Chaser for Runbook Gaps
On a daily schedule the agent finds runbook doc PRs that were opened from resolved incidents but never reviewed, summarizes what each one fixes.
Resolved Incident to Public Troubleshooting Doc
For customer-facing errors resolved in Sentry, the agent drafts a sanitized troubleshooting entry and opens a PR to your ReadMe documentation.
On-Call Runbook Gap Closer: Resolved Sentry Issues to Doc PRs
An agent reads each newly resolved Sentry issue, compares the actual fix against your existing runbook, and opens a GitHub PR adding the missing remediation steps.
Weekly On-Call Doc-Gap Digest
Each week the agent reviews every Sentry issue resolved in the last 7 days, ranks the ones whose runbook coverage is missing or thin.
Run it inside a business
This workflow drops into a full company template. Import the org, and this is one of the playbooks its agents run.

Run this workflow in your colony.
14-day trial. No DevOps. No Sales call. Provisioned in under a minute.
