Short answer: classify the complete image request before generation, return a small JSON decision, and attach the classifier and image calls to the same tenant ledger. The useful design choice is a cost boundary, not a particular moderation endpoint.
For a logistics product, that ledger matters. A carrier, warehouse operator, and internal support team may all send prompts through one image feature, while their review rates and prompt sizes differ. If classification is an invisible helper call, the team cannot explain why one tenant's monthly AI spend moved. I prefer a notebook-to-prod path that makes the policy contract, the tenant key, and the eval record explicit from the first example.
The gate runs before the image job enters the queue. It receives the exact text that will be sent to the image model: the user's description, a selected style, a negative prompt, and any template fields. It emits allow, review, or block. Only allow can create an image job.
That boundary is non-negotiable.
How should a Node.js pipeline moderate text prompts for image generation?






