Guides

How to Gate Ad Spend in Your AI Agent Workflow with Spendict

By Dino S. · July 17, 2026 · 9 min read

Your AI agent can write a hundred ad variations before you finish your morning coffee. That’s the good news. The bad news: most of those ads are mediocre, and without a quality gate, your pipeline will happily queue them all up for spend.

This is the problem that gets expensive fast. A generative model that produces ad copy is not the same thing as a system that can reliably judge whether that copy will perform. Models are optimistic. They’ll produce something plausible-sounding and move on. What you need is a separate, deterministic layer that sits between “ad generated” and “ad approved for spend” — one that applies fixed rules, returns a clear verdict, and doesn’t get talked out of it.

That’s exactly what Spendict does. This guide walks through how to wire it into your AI agent workflow using MCP, the CLI, or REST, so every creative gets a run, fix_first, or kill verdict before a dollar moves.

Why prompt-engineering your own review doesn't hold up

The obvious first instinct is to add a review step inside your existing agent: “Before publishing, check if this ad is good.” You write a prompt, the model evaluates its own output, and it approves it. The problem is structural.

A model that generated the ad has already committed to it. Ask it to review the same output and you’re likely to get a confident thumbs-up, because the model has no reason to contradict itself. Even with a carefully written review prompt, the model can reason its way around a weak hook or a compliance issue. There’s no enforcement mechanism.

Spendict’s verdict engine is different because the server decides, not the model. Scores are recomputed server-side using fixed gating rules calibrated by performance marketers. The model proposes; the server rules. A bad ad cannot argue its way to a run verdict.

What Spendict actually scores

Before you integrate, it helps to know what the scoring engine evaluates. The core tool is assess_ad_creative, and it scores across seven dimensions:

  • Hook — does the opening line stop the scroll?
  • Angle — is the creative angle differentiated, or is it generic?
  • Clarity — can a reader understand the offer in one pass?
  • Audience resonance — does the messaging match the intended audience?
  • Platform fit — is the format and tone appropriate for where this ad will run?
  • CTA — is the call to action clear and actionable?
  • Compliance — does the creative avoid policy violations for the target platform?

After scoring, the engine names the single predicted failure mode. Not a list of suggestions — one specific reason this ad is likely to underperform or get rejected. That makes the output immediately actionable inside an automated pipeline.

The verdict is one of three values: run, fix_first, or kill. Your agent reads the verdict and routes accordingly. No parsing required.

Beyond creative scoring, Spendict also exposes audit_campaign_structure, analyze_campaign_performance, and strategize_targeting — tools that let you gate the entire campaign setup, not just the copy.

Option 1: MCP (recommended for Claude, Cursor, Codex, ChatGPT)

If you’re building inside Claude, Claude Code, Cursor, or another MCP-compatible environment, this is the fastest path. Spendict runs a remote MCP server over Streamable HTTP, and auth is OAuth — no API key to create or paste. Point your client at the endpoint, approve the sign-in once, and the four tools become available to your agent natively:

https://www.spendict.com/api/mcp

In Claude that’s Settings → Connectors → Add custom connector; in Claude Code it’s one command (claude mcp add --transport http spendict https://www.spendict.com/api/mcp). Per-client steps are in the docs.

What this looks like in practice: your agent generates an ad variant. Before passing it to your publishing queue, it calls assess_ad_creative with the creative text, target platform, and audience description. Spendict returns a verdict object. If the verdict is run, the ad moves forward. If it’s fix_first, the agent can attempt a revision and re-score. If it’s kill, the variant is dropped and the next one is evaluated.

The model never overrides the verdict. It reads the result and acts on it.

Option 2: CLI (fastest for local testing)

If you want to test scoring before wiring it into a full pipeline, the CLI is the quickest way to see verdicts in action:

npm i -g spendict
spendict login

spendict assess \
  --platform meta \
  --product "your offer" \
  --text "your ad copy"

This is useful for validating your ad copy manually, testing what the engine flags, and understanding the scoring logic before you automate it. The CLI uses the same quota and the same scoring engine as MCP and REST. It’s not a lite version — same four tools, same gating rules, same verdicts.

Option 3: REST API (best for n8n, custom pipelines)

If you’re running automations in n8n or a custom backend, the REST interface gives you direct HTTP access with bearer-key authentication (create a key in the dashboard):

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

{
  "ad_copy": { "primary_text": "Your ad copy here" },
  "platform": "meta",
  "product_context": "what you sell, the offer",
  "target_audience": "DTC skincare buyers, 25-40F"
}

The response includes the verdict, dimension scores, and the predicted failure mode. Your pipeline reads the launch_recommendation field and routes the creative accordingly.

One important detail: the quota gate fires before inference. If your key has no remaining calls, the request returns a structured error immediately without triggering a model call — and failed calls are automatically refunded. No surprise charges mid-batch.

There’s a ready-made n8n version of this whole pattern — the ad-factory template on the n8n gallery — plus more detail on the n8n ads automation page.

Option 4: the agent Skill drop-in

If you’re working inside an agent environment that supports skill files — Claude Code, Cursor, Codex, or Gemini — one command adds Spendict to your agent’s capability set:

npx skills add spendict/skills

The skill calls Spendict over MCP or the CLI (connect once, see above), and from then on the agent gates ad creative automatically — you never have to say “use Spendict.” This is the lowest-friction option for developers who already have an agent workflow running.

Building the quality gate: a practical workflow

Here’s how a complete gated creative pipeline looks when Spendict is in the loop:

Step 1 — Generate. Your agent produces N ad variants based on a brief, product description, and target audience. This is the part your existing pipeline already handles.

Step 2 — Score. Each variant is passed to assess_ad_creative. The engine scores it and returns a verdict. This happens in parallel if your pipeline supports concurrent calls — scoring 20 variants takes roughly the same wall-clock time as scoring one.

Step 3 — Route.

  • run → add to the approved queue for publishing
  • fix_first → pass the creative and the failure mode back to the generation step for a targeted revision, then re-score
  • kill → discard and move to the next variant

Step 4 — Audit structure (optional but recommended). Before any approved creative goes live, run audit_campaign_structure to verify that budget allocation, audience setup, and bid strategy are sound. A good creative in a broken campaign structure still wastes money.

Step 5 — Monitor. Once campaigns are running, analyze_campaign_performance feeds live metrics into the engine to separate creative fatigue from structural problems. This tells you whether a declining CTR means the creative is worn out or the targeting has drifted — two different problems that need different fixes.

What this gate actually prevents

The practical value of this setup is clearest when you think about what happens without it. An AI agent running unchecked will produce ads with weak hooks (the model optimizes for plausibility, not scroll-stopping), mismatched CTAs (the offer and the button copy don’t align), platform policy violations (copy that would pass on Google but get rejected on Meta), and audience mismatch (the tone is right for the brand but wrong for the specific segment).

None of these failures are obvious from the creative text alone. They require applying structured criteria against the specific context of platform, audience, and campaign goal. That’s what Spendict’s scoring dimensions are built to catch.

The verdict isn’t a suggestion. It’s a gate. The ad either passes or it doesn’t.

Pricing and quota

The free tier includes 100 calls per month — enough to validate the integration and score your first batches of creative — with no credit card. Paid plans start at $19/month for 1,500 calls, $49/month for 5,000, and $199/month for 25,000. Every tool call counts equally, the quota check happens before inference, and failed calls are refunded. The full breakdown is on the pricing page.

A note on auditability

One thing worth understanding: because the verdict logic is deterministic and server-side, you get a consistent, auditable record of every scoring decision. The same creative, scored twice, returns the same verdict. This matters for agency operators who need to show clients why a creative was rejected, and for growth teams who want to track which failure modes their pipeline produces most often.

Prompt-based review doesn’t give you this. The model’s reasoning shifts with context, temperature, and phrasing. Spendict’s rules don’t.

Getting started

The fastest path is to install the CLI, run a few test scores against your existing ad copy, and see what the engine flags. That takes about five minutes and doesn’t require any pipeline changes. From there, the documentation covers the full MCP setup, REST API reference, and Skill integration in detail.

Your agent writes the ads. Spendict decides which ones run.

Frequently asked questions

What does Spendict's assess_ad_creative tool actually return?

It returns a verdict (run, fix_first, or kill), dimension scores across hook, angle, clarity, audience resonance, platform fit, CTA, and compliance, and the single predicted failure mode. The failure mode is a specific reason the ad is likely to underperform — not a general list of suggestions.

Can I use Spendict inside Claude Code or Cursor without writing custom integration code?

Yes. Spendict supports both MCP (Streamable HTTP with OAuth — no key handling) and a drop-in agent Skill (npx skills add spendict/skills). Either option makes the scoring tools available as native actions inside Claude Code, Cursor, Codex, and Gemini without HTTP boilerplate.

What happens if I run out of quota mid-batch?

The quota gate fires before inference, so a maxed-out key returns a structured error immediately without triggering a model call, and failed calls are automatically refunded. Your batch stops cleanly rather than producing partial results or unexpected charges.

Is Spendict's scoring deterministic? Will the same creative always get the same verdict?

Yes. The verdict engine runs server-side using fixed gating rules. The same input returns the same output every time. This is intentional — it makes verdicts auditable and prevents the model from reasoning around a bad creative.

Does Spendict have write access to my Meta or Google ad accounts?

No. Spendict is read and verdict only. It has no access to Meta, Google, TikTok, or any other ad platform. It scores creatives and returns verdicts; your pipeline handles publishing.

What's the difference between fix_first and kill?

fix_first means the creative has a specific, addressable problem — the failure mode is named and a revision is likely to pass. kill means the creative fails on multiple fundamentals that a revision is unlikely to fix; it's faster to regenerate. In an automated pipeline, fix_first routes back to the generation step; kill discards the variant entirely.

How does Spendict compare to adding a review prompt inside my existing agent?

A prompt-based review asks the model to evaluate its own output, which produces optimistic results. The model has no enforcement mechanism — it can reason around a weak hook or a compliance issue. Spendict's rules are fixed and server-side. The model cannot override them, which is the core difference between a review suggestion and an actual quality gate.

← All guides