A policy PDF governs nothing; a pipeline does. This playbook translates your AI-use policy into CI gates — secrets scanning, license and provenance scanning, dependency-hallucination checks, and coverage floors — rolled out in warn-then-block stages, with an exception path that keeps enforcement credible instead of resented.
Workflow area: Policy & Governance · Tier: Advanced · Hands-on time: ~45 minutes
Every AI policy fails the same way: it is announced, agreed with, and then outrun by a Tuesday deadline. Nobody pastes a secret into a prompt out of malice — they do it at 6 p.m. with a demo tomorrow. Enforcement beats goodwill not because your engineers are untrustworthy but because pipelines do not get tired, and a gate that catches the mistake before merge protects the engineer as much as the codebase.
Extract the checkable rules from the policy. Run the policy doc through Claude:
Here is our engineering AI-use policy: [PASTE POLICY].
Produce a table with columns: policy rule / can CI check it?
(YES, PARTIAL, NO) / concrete check / suggested tool class /
failure action (warn or block).
Be strict: "developers should review AI output carefully" is NOT
checkable — say NO. Secrets in diffs, license headers, unknown
dependencies, coverage drops, missing provenance labels ARE.
Do not invent tool names beyond well-known classes.
Good output separates the enforceable from the aspirational:
No secrets in prompts/commits | PARTIAL | diff secret scan | gitleaks-class | block
No copyleft contamination | YES | license scan | ScanCode/FOSSA | warn→block
Deps must exist + be mature | YES | registry age check | custom CI step | block
Coverage floor on ELEVATED | YES | coverage delta | coverage gate | block
"Review AI output carefully" | NO | — | culture, not CI | —
Stand up the four core gates. Secrets scanning (Gitleaks/TruffleHog-class) on every push — this one starts in block mode; a leaked key is not a teachable moment. License and provenance scanning (ScanCode/FOSSA-class) on new and changed dependencies, tuned to your license allowlist from pb-34. A dependency-hallucination check: every newly added package must exist in the registry, exceed an age threshold (e.g., 90 days), and clear a download floor — this is your defense against slopsquatting, where attackers pre-register the plausible package names models invent. Coverage floors on the risk tiers defined in pb-27.
Roll out warn-first, then ratchet. Two weeks in warn mode per gate (except secrets). Each week, triage the hits: true positives become your announcement material ("the gate caught three real issues before merge"); false positives get tuned out. Announce the block date in advance, in writing. Flipping a gate to block without a warn period is how gates die.
Build the exception path before the first exception. A policy-exception PR label plus a one-line justification, auto-logged to a review queue that you or a delegate clears weekly. No exception path means engineers bypass gates in the dark; a heavyweight one means the same thing with extra resentment. One label, one line, one weekly review.
Report gate health monthly. Hits, true-positive rate, exception count, and time-to-fix — at team aggregate. A gate with a 40% false-positive rate is a tax; fix it or kill it. A gate with zero hits for a quarter either finished its job (keep it, it is cheap) or is miswired (test it with a deliberate canary commit).
Gate logs contain per-engineer hit data — secrets caught, exceptions requested — and must feed process improvement only; publish the aggregation rule alongside the gates and never surface individual gate-hit counts in any performance context (pb-38 covers the telemetry contract).
A policy is what you wrote; the pipeline is what you meant — translate every checkable rule into a warn-then-block gate with an owner and an exception path, and let goodwill handle only what CI genuinely cannot.