AI-Generated Ad Copy Hallucination Guardrails & Assertion Validator
Catch AI ad copy hallucinations and fake discounts before launching ad spend. Rule-based assertion validator for advertising claims.
Problem it addresses
Develop a pure Python ad copy guardrails validator (copy_guardrails.py): 1) Ingests generated ad copy CSV files and a JSON configuration of authorized claims (Max Discount %, Allowed Shipping Terms, Return Window Days), 2) Flags unauthorized discount codes, extreme superlatives ('100% cure'), or hallucinated guarantees, 3) Outputs a pass/flagged CSV and terminal summary.
Who it is for
PRO operating in high-growth e-commerce, digital publishing, and direct-response marketing across Saudi Arabia, UAE, and Egypt.
What is inside
Key files listed in the README repository architecture:
config/authorized_offer_bounds.sample.jsonexamples/unreviewed_ad_copy_sample.csvLICENSEREADME.mdreports/flagged_claims_report.csvsrc/copy_guardrails.pytests/test_guardrails.py
How to evaluate and use it
- Read the README first and confirm that the documented problem matches your use case.
- Inspect the listed files to find the data, tools, templates, and tests relevant to your task.
- Follow the repository’s Quick Start and check prerequisites before running commands.
- Compare outputs with documented examples and review limitations before using them in a decision or client workflow.
Quick Start from the README: python -m unittest discover -s tests · python src/copy_guardrails.py --help
Scope and limitations
- Factual Assertion Validation: Compares generated copy against verified product specification sheets to catch fabricated features or false pricing.
- Regulatory Claims Screening: Flags unsubstantiated claims ('#1 Doctor Recommended', 'Guaranteed Cure') that trigger regulatory advertising penalties.
- Automated CI/CD Quality Gate: Integrates into content generation pipelines to block hallucinated copy before human editorial review.
This page summarizes the available documentation; it does not establish performance or business results. Verify data and prerequisites before use.