MAHMOUD ABDELNABY
Career · CLI SCRIPT · 2

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.json
  • examples/unreviewed_ad_copy_sample.csv
  • LICENSE
  • README.md
  • reports/flagged_claims_report.csv
  • src/copy_guardrails.py
  • tests/test_guardrails.py

How to evaluate and use it

  1. Read the README first and confirm that the documented problem matches your use case.
  2. Inspect the listed files to find the data, tools, templates, and tests relevant to your task.
  3. Follow the repository’s Quick Start and check prerequisites before running commands.
  4. 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.

Related repositories