Spec Tests: The QA Layer Every AI Marketing Agency Stack Needs
See how AI marketing agencies use automated spec tests to catch AI content errors before campaigns go live, protecting brand reputation at full scale.
14 January 2026Team COEY

Marketing automation is now continuous deployment for content. Your team is still stuck in “vibes-based QA.”
Somewhere this week, a marketer signed off on a landing page tweak using intuition: “Eh, looks fine.” Everything else in your automation universe is relentless and deterministic: webhooks, API calls, event streams, triggers that fire at 3 a.m. Yet content delivery is still powered by hand waving and hope.
Here’s the catch: this operational mismatch quietly destroys ROI on “AI-driven marketing.” It is rarely because the models are dumb. It is because teams treat text assets like sandcastles instead of hardened, testable code. No spec, no tests, no shared definition of “correct.” That is like deploying code with no linter and blaming your editor for compile errors.
COEY Deep Dive Thesis: The smart money in AI-powered marketing is moving from “smarter SwarmGPTs” to spec-driven content . Treat every piece of marketing collateral as a deployable artifact with visible, executable requirements and pass or fail reporting. If it cannot be tested, it should not be automated.
AI agents now operate directly in your production CMS layer
We have graduated from “click to generate copy” widgets. Platforms are embedding marketing AI agents with content creation and governance roles directly in the CMS workflow. This is not theoretical. Acquia’s latest SaaS CMS announcement highlights built-in AI agents designed to assemble sites and scan for governance issues as part of the publishing flow.
The vendor arms race is not the lesson. The point is simple: AI is shaping not just your drafts, but your published reality. If AI can touch production content, your risk profile changes fast. Production pipelines now need the same discipline software teams have relied on for decades: contracts, gates, and tests.
Your “definition of done” is incomprehensible to software
Marketers still sign off work with rules like:
“It fits our voice.”
“Legal will not complain.”
“SEO seems adequate.”
“I think all links work.”
These are not specs. They are vibes. Automation does not interface with vibes. Modern content lands in CRMs, ESPs, CMSs, and ad platforms, places where unchecked errors become incidents and recalls. If “done” is not machine-testable, your only quality control is public failure at scale.
Spec tests are not QA checklists. They are interface contracts
Spec tests are not style guides. They are not tasks in someone’s project tool. They are executable contracts that define, in machine terms, what it means for an asset to safely pass through your automation stack.
Shift your mental model:
A landing page is a deployable object. It must satisfy schema rules before shipping.
An email journey is a directed graph. Messages and triggers must obey constraints and policies.
An ad set is an object with platform rules, field-level guardrails, and budget limits.
How to write a spec in modern marketing automation
Specs are enforceable gates. Most fall into three buckets:
1) Structural specs
All required fields are populated.
Output matches an established schema.
Markup is valid and required blocks exist.
2) Truth specs
Every factual claim is tied to an approved source_id .
Pricing is validated against a live offer or product database.
Referenced features exist in the active catalog.
3) Action specs
No asset can publish without passing staging.
CRM updates are limited to allowed fields and create audit trails.
Budget changes obey guardrails and trigger review above a threshold.
Spec tests in the automation stack: reference table
| Stack layer | Output | Spec test role |
|---|---|---|
| Generation | Drafted assets and proposed changes | Blocks confident nonsense from entering production |
| Spec tests | Structured pass or fail report | Eliminates silent regressions and enforces compliance |
| Writeback | Updates to CMS, CRM, ESP, ad platforms | Prevents mistakes from contaminating production systems |
AI pilots fail because human review does not scale
There is a favorite executive fantasy: “We will cut agency spend if we automate content creation.” Maybe, but you will not cut review unless you change the system. Automation floods the pipeline, making review, not writing, the bottleneck. If humans still review every word, you built a faster funnel into the same old bottleneck.
Automation-first does not mean human-free. It means humans handle real exceptions while the system auto-handles the rest because requirements are testable by machines.
What real automation-first workflows have in common
Winning teams route spec failures instead of stalling work. Passing artifacts flow forward. Failures return structured error reports, not vague feedback threads.
[Trigger]
offer_updated | campaign_approved | asset_uploaded | segment_changed
[Assemble]
ingest: contract terms | claims registry | consent rules | brand policy
[Generate]
output: structured asset only
[Spec Tests]
schema_ok | links_check | claims_valid | consent_verified | risk_classified
[Route]
auto_publish_low | review_medium | escalate_high
[Write]
CMS | ESP | Ads | CRM
[Record]
archive: asset diffs | approvals | failure reports | audit logs
What marketers actually spec test: concrete examples
Landing page spec tests
No more than one H1 and it is non-empty.
All CTAs use domains in the allowlist.
All numeric claims are tied to an approved source_id .
UTM parameters follow enforced conventions.
Minimum accessibility checks like alt text and heading order.
Email campaign spec tests
Subject lines stay within channel limits.
Unsubscribe links are functional and accurate.
Consent checks pass for audience and channel.
No blacklisted language for regulated verticals.
All embedded links resolve and do not return 404.
CRM writeback spec tests
Only permitted fields can be written.
Stage transitions require explicit confidence and evidence.
New records include required regulated identifiers.
A minimal schema and spec report you can implement
Spec tests scale when assets are structured. Here is a minimal “campaign asset” JSON and a pass or fail report.
{
"asset": {
"asset_type": "landing_page",
"locale": "en-US",
"title": "Special Offer 2026",
"h1": "Save More Now",
"blocks": ["intro", "features", "cta"],
"cta_url": "https://offers.example.com/jan",
"claims": [{"text": "20% faster", "source_id": "datapoint1234"}],
"risk_tier": "low"
}
},
{
"spec_report": {
"asset_type": "landing_page",
"status": "fail",
"failures": [
{"test": "claims_sourced", "reason": "Numeric claim missing source_id"},
{"test": "cta_domain_allowlist", "reason": "CTA domain not approved"}
]
}
}
Hybrid workflows demystified: spec tests enable human review where it matters
The world is not split between fully autonomous and fully manual. Spec-driven automation enables selective review.
| Risk tier | Automation handles | Humans handle |
|---|---|---|
| Low | Generate, spec test, publish | Periodic audits and exception review |
| Medium | Generate, spec test, queue for diff-based review | Approve diffs and approve test exceptions |
| High | Generate, spec test, block auto-publish | Mandatory claims, policy, and compliance review |
This is the COEY worldview: spec testing as a governance primitive
If you are a Deep Dives regular, you know we obsess over automation governance: contracts, critics, logs, and risk-based routing. Spec tests are not an add-on. They are the glue between “LLM can generate content” and “it is safe to let it into production.”
For more on the governance stack, see:
AI Workflow Firewalls: Marketers’ New Must-Have
The Marketing Data Contract Era
When AI Should Shut Up: Abstention Stack
Common failure modes (spicy edition)
Thinking “structured output” means “safe output”
Valid JSON is a prerequisite for testing. It is not proof of accuracy, safety, or compliance.
All your tests are linters in disguise
If you only test field presence and length constraints, you built a linter. Real spec tests also validate claims, policies, pricing, and actions.
No receipts, no accountability
If you cannot answer what changed and why, you cannot debug or explain anything to Legal or leadership. Store approval receipts and test logs as a default part of the pipeline.
Implementation playbook: minimal steps, maximum coverage
You do not need to spec test every asset today. Start where velocity and impact intersect, where mistakes are loud.
Choose one pipeline
Offer-driven landing page variant production.
High-churn lifecycle email series.
Paid social creative generation at scale.
Write ten tests that matter
3 structural: required fields and blocks, valid output, link health checks
5 truth: claim validation, pricing checks, consent checks, approved domains, catalog checks
2 action: mandatory staging, tightly controlled write permissions
Route results, do not just reject
Pass: auto-stage or publish for low-risk assets
Fail: emit structured reports that pinpoint the issue
Ambiguous: abstain from auto-publish and escalate to a human
COEY’s hard take: automation-first is reality, not a pitch deck
AI in marketing is not about better inspiration via prompt. It is about shipping content through governed workflows in platforms now capable of automating at the publishing layer. If you are still running on vibes-based review, you will ship a mistake at scale. Not if, when.
Spec tests are the new baseline: turning “seems fine” into “proven compliant.” Only then do humans gain leverage. If your automation stack can generate, it can test. If it cannot test, it should not publish.