Claude Templates / C-tier · Discipline

Discipline

The AI Compliance Gate Playbook

Brand safety for AI-generated output: banned words, anti-tells, injection defense.

AI-COMPLIANCE-GATE-PLAYBOOK.md · 13 sections · 2,183 words · 16 KB · markdown

By Moe Ameen, founder of BILT · Published · Updated

The AI Compliance Gate Playbook puts a code-level check between a model and anything it publishes under a customer's name. Claude Code builds a per-format compliance matrix, a database-backed loader that falls back to defaults, a banned-word lint seeded with 50+ terms, an anti-AI-tell scorer, image-prompt composition that avoids double injection, length limits and a complianceUsed audit field on every generated row.

Key takeaways

  • Rules live in code and data, not only in the prompt.
  • Start from a 50+ word banned list; workspaces can override.
  • An anti-AI-tell pass scores phrasing that gives output away.
  • Every generated row records which rules applied.

If your app publishes model output under a customer's name, something has to stand between the model and the world. A banned-word lint, an anti-AI-tell pass, prompt double-injection prevention, and length defense: enforced in code, not in the prompt.

What does the AI Compliance Gate Playbook build?

It builds lib/compliance with defaults, a loader, an image-prompt composer and a lint module, plus a pre-render audit for video and blog scripts.

Each workspace gets a Persona Brief that the gate reads.

When does an app need an AI compliance gate?

It needs one as soon as it publishes AI output on a user's behalf, whether posts, images, emails or scripts.

Apps where a human edits every output before use can get by with a lighter check.

What do you need first?

No other playbook is required. You need your list of output formats, a Persona Brief per workspace, a brand identity record and a starting banned-word list.

Decide which formats get which checks; the matrix is per format and per phase.

What's inside

What does the playbook give you?

When to use it

Any app that publishes AI output on a user's behalf.

Build these first

Nothing. This one stands alone.

Straight from the file

What does the writing look like?

Applies only to apps that generate AI content (Kompozy-class). If the app doesn't ship LLM/image/video output to end users, skip this playbook. Built from the BKE / Kompozy implementation. Reference repo: reference app.

Table of contents

Which sections does the file cover?

  1. 0. Use this spec
  2. 1. Why this matters
  3. 2. The Persona Brief (foundation)
  4. 3. Compliance matrix (per-format flags)
  5. 4. buildCompliantImagePrompt() — the composer
  6. 5. The double-injection footgun
  7. 6. Banned-word lint
  8. 7. Anti-AI-tells matrix
  9. 8. Length defense
  10. 9. Pre-render audit (video/blog scripts)
  11. 10. Auditable trail (complianceUsed)
  12. 11. Common pitfalls
  13. 12. Kickoff prompt

How do you run it?

Drop AI-COMPLIANCE-GATE-PLAYBOOK.md into your repo, then tell Claude Code: “Read AI-COMPLIANCE-GATE-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.

↓ Download the playbook

Who is this for, and who should skip it?

Best for

  • AI content apps that publish under customers' names
  • Products with brand-safety requirements
  • Teams fighting generic AI phrasing in output

Not ideal for

  • Apps where a person reviews every output
  • Legal or regulatory compliance programs (this is brand safety)
  • Apps that don't generate text or images
  • Builders who won't adapt paths: the file points to a reference app you won't have

What else do people ask?

What is the double-injection problem?

The AI Compliance Gate Playbook defines double injection as applying compliance blocks at the image step that the LLM step already baked into the scene description. Symptoms include carousel slides that each hold a five-panel collage, and the fix is includeFormatPrompt: false for Carousel, Blog and any format whose prompt reads like a writing brief.

How is the anti-AI-tell score calculated?

The AI Compliance Gate Playbook scores text as 100 minus (tells divided by words) times 600, floored at 0, counting tells across vocabulary, hedge, transition, structure and closing. It suggests blocking under 60, warning at 60-80 and shipping at 80 or above, set per workspace.

What should happen when a banned word gets through?

The AI Compliance Gate Playbook says to regenerate once or flag the row for review. It warns never to strip the word silently, because silent edits cost user trust during review.

How does it handle overly long image prompts?

The AI Compliance Gate Playbook hard-caps image prompts at 31,900 characters in the provider wrapper, logs every truncation and keeps the tail where the SCENE block sits. In the reference app, blog hero prompts hit about 35.9k characters against a 32k cap and failed four renders before anyone found the cause.

What is in the AI Compliance Gate Playbook download?

The AI Compliance Gate Playbook is a markdown file of about 2,200 words. It has TypeScript for the compliance matrix types, the composer call, the score formula, the length cap and the complianceUsed fingerprint, plus a sample of the default banned-word list and a six-item pre-render checklist.

How do we know this?

This page is based on the playbook file itself, AI-COMPLIANCE-GATE-PLAYBOOK.md, which Moe Ameen wrote from the Kompozy codebase (called BKE in the file). We read the file on November 4, 2026; the facts here come from it, not from independent testing in other codebases.

More discipline playbooks

← All 28 Claude templates