How to Build a 4-State Backend Moderation Pipeline — User-Generated Content
Description and use
<p>Use four durable states—<code>pending</code>, <code>review</code>, <code>allow</code>, and <code>block</code>—for a backend moderation pipeline, and publish no user-generated content until a typed decision has been validated. That is the operating rule for Node.js or Go. A chat-completions JSON response is evidence, not authorization; malformed output, timeouts, and ambiguous findings belong in the human-review queue rather than on the happy path.</p> <p><strong>Short answer:</strong> accept a code-review comment, assign an idempotency key, persist it as <code>pending</code>, ask a model fo
Problem
<p>Use four durable states—<code>pending</code>, <code>review</code>, <code>allow</code>, and <code>block</code>—for a backend moderation pipeline, and publish no user-generated content until a typed decision has been validated. That is the operating rule for Node.js or Go. A chat-completions JSON response is evidence, not authorization; malformed output, timeouts, and ambiguous findings belong in the human-review queue rather than on the happy path.</p> <p><strong>Short answer:</strong> accept a code-review comment, assign an idempotency key, persist it as <code>pending</code>, ask a model fo
Outcome
<p>Use four durable states—<code>pending</code>, <code>review</code>, <code>allow</code>, and <code>block</code>—for a backend moderation pipeline, and publish no user-generated content until a typed decision has been validated. That is the operating rule for Node.js or Go. A chat-completions JSON response is evidence, not authorization; malformed output, timeouts, and ambiguous findings belong in the human-review queue rather than on the happy path.</p> <p><strong>Short answer:</strong> accept a code-review comment, assign an idempotency key, persist it as <code>pending</code>, ask a model fo
Evidence
How to Build a 4-State Backend Moderation Pipeline — User-Generated Content
- Record date: 2026-10-13T17:40:59.220Z