Guides

How to Add Ad Creative Compliance and Quality Checks to an AI Agent Pipeline

By Dino S. · July 20, 2026 · 8 min read

An AI agent that produces ad creative needs two guardrails before anything reaches a budget: a quality check (is this ad any good?) and a compliancecheck (will the platform even run it?). Most pipelines have neither. The agent writes, the ads queue, and you find out which ones were weak or non-compliant after they’ve spent — or after they’re rejected and the campaign stalls.

This guide wires both guardrails into an agent pipeline as a single step. The useful part is that quality and compliance aren’t two integrations — one call to Spendict returns both, deterministically, so the agent can branch on the result without a human in the loop.

Why quality and compliance are one step

They feel like separate problems — one is about performance, the other about policy — but in an automated pipeline they answer the same question: should this ad be allowed through?An ad with a dead hook wastes budget; an ad that trips a platform policy wastes budget too, because rejected creative spends nothing while it sits in review. Both are reasons to stop an ad before launch, so it’s cleaner to gate on both at once.

Spendict’s assess_ad_creative scores seven dimensions in a single call, and compliance_safety is one of them, alongside hook, angle, clarity, audience resonance, platform fit and CTA. It returns a deterministic verdict — run, fix_first, or kill — plus a list of specific compliance flags when it sees policy risk. One request, both guardrails.

Where the guardrail sits in the pipeline

The check goes exactly one place: after your agent generates a variant, before it’s queued for launch. Everything upstream (research, briefing, generation) stays as-is. Everything downstream (publishing, budget allocation) only ever receives ads that already cleared the gate.

  • Agent generates N ad variants from a brief.
  • Each variant is sent to assess_ad_creative — the quality-and-compliance guardrail.
  • The agent routes each variant by its verdict; only cleared ads move forward.

The call: one request, both checks

Over REST, it’s a single POST. Send the ad copy, the target platform, and the product context; the platform matters because compliance and platform fit are judged against where the ad will actually run.

POST https://www.spendict.com/api/v1/assess
Authorization: Bearer spd_live_YOUR_KEY
Content-Type: application/json

{
  "ad_copy": { "primary_text": "Struggling with adult acne? This 3-step routine clears it in 14 days, guaranteed." },
  "platform": "meta",
  "product_context": "DTC skincare subscription",
  "target_audience": "women 25-40 with acne-prone skin"
}

The response carries both signals — the quality scores and the compliance read:

{
  "launch_recommendation": "fix_first",
  "overall_score": 48,
  "dimension_scores": {
    "hook": 62, "angle": 70, "clarity": 75,
    "audience_resonance": 72, "platform_fit": 55, "cta": 60,
    "compliance_safety": 20
  },
  "predicted_failure_mode": "The 'guaranteed ... in 14 days' claim plus the 'struggling with adult acne?' opener risk a Meta rejection for unsupported claims and personal-attributes phrasing.",
  "compliance_flags": [
    "Absolute/guaranteed result claim ('clears it in 14 days, guaranteed') — likely unsupported-claims rejection",
    "Personal-attributes phrasing ('Struggling with adult acne?') — implies a health attribute about the viewer"
  ],
  "prioritized_fixes": [ /* the specific rewrites */ ]
}

Note the ad above scores wellon hook, angle and clarity — it’s decent creative — but compliance_safety is 20. A pure quality check would have waved it through. Because compliance is scored in the same pass, the verdict is fix_first, not run.

Routing on the result

Your agent reads one field — launch_recommendation — and branches. No parsing of scores required:

  • run → cleared both bars; add to the publish queue.
  • fix_first → a specific, addressable problem (quality or compliance); feed prioritized_fixes back to the generation step, rewrite, and re-assess.
  • kill → structurally broken; discard and move to the next variant.

Because the verdict is recomputed server-side from fixed gates, the same ad always returns the same result — so this branch is stable enough to automate against, and auditable when a client or a compliance reviewer asks why a creative was held.

Handling compliance flags specifically

Quality problems and compliance problems both land in fix_first, but you may want to treat them differently — a weak hook is a creative note, a policy flag is a risk. The response gives you what you need to split them:

  • compliance_safety is a low score (a likely-rejection ad can’t reach a run verdict, no matter how strong the rest is).
  • compliance_flags is a list of the specific tripwires — so your agent can log them, route flagged ads to a stricter review lane, or block them outright in a compliance-sensitive vertical.

A common pattern: auto-rewrite ordinary fix_first ads, but if compliance_flagsis non-empty, send the ad to a human queue instead of letting the generator try again — because “the model rephrased it” isn’t a defensible audit trail in fintech, health, or supplements. One important honesty note: Spendict flags likelypolicy risk against well-known tripwires; it is not an official platform tool and doesn’t make the final call — the ad platform does. Treat a clean compliance score as risk reduced, not risk eliminated.

Wiring it into your agent

The same guardrail reaches your pipeline four ways — pick the one that matches your stack:

  • MCP — for agent environments (Claude, Cursor, Codex): connect the server at https://www.spendict.com/api/mcp over OAuth, no key to paste, and assess_ad_creative becomes a native tool the agent can call.
  • REST — the POST /api/v1/assess above, for n8n or a custom backend.
  • CLInpm i -g spendict for local testing before you automate.
  • Skillnpx skills add spendict/skills so an agent gates creative automatically without being told to on every call.

One safeguard worth knowing for an automated loop: the quota check fires before inference, so a maxed-out key returns a structured error without a model call, and failed calls are refunded — your batch stops cleanly instead of running up surprise cost. And Spendict is verdict-only: it never touches your ad accounts, so adding this guardrail grants no write access to Meta, Google, or anywhere else.

Getting started

Install the CLI and run a few of your own ads through it to see the quality scores and compliance flags side by side — about five minutes, no pipeline changes. From there, the docs cover the MCP, REST and Skill paths in full, and the spend-gate guide walks the whole generate → gate → route loop end to end.

Frequently asked questions

How do I add compliance and quality checks to an AI agent pipeline?

Insert one call to Spendict's assess_ad_creative between your agent's generation step and its publish step. It scores seven dimensions — including a compliance_safety dimension — and returns a deterministic run / fix_first / kill verdict plus specific compliance flags, so the agent can route each variant without a human. It's reachable over MCP, REST, CLI, or a drop-in Skill.

Does a single check cover both quality and compliance?

Yes. assess_ad_creative returns quality scores (hook, angle, clarity, audience resonance, platform fit, CTA) and a compliance_safety score in the same response, along with a compliance_flags list of specific policy tripwires. You don't need two integrations.

Can an ad with strong creative still be held for compliance?

Yes — that's the point of scoring compliance in the same pass. A likely-rejection ad cannot reach a run verdict no matter how strong its hook or angle, because rejected creative spends nothing. The verdict comes back fix_first or kill with the tripwires named.

Is Spendict an official Meta or Google compliance tool?

No. Spendict flags likely policy risk against well-known tripwires and has no access to any ad platform. The final policy decision belongs to the platform. Treat a clean compliance score as reduced risk, not a guarantee of approval.

How do I keep compliance-flagged ads out of an automated rewrite loop?

Branch on the compliance_flags array: if it's non-empty, route the ad to a human review lane instead of feeding it back to the generator. In regulated verticals, 'the model rephrased it' isn't a defensible audit trail, so a human should sign off on flagged creative.

Is the check deterministic enough to automate against?

Yes. The verdict is recomputed server-side from fixed gates, so the same ad always returns the same result. That's what makes it safe to branch on in an unattended pipeline and auditable when someone asks why a creative was held.

← All guides