## Inspiration

I've spent nearly 20 years in the pharmaceutical sector, most of it in pharmacy operations, and more recently in EU MDR regulatory writing (CER, PMCF, PSUR). One thing I've seen again and again: advertising and marketing copy for pharmaceutical and medical device products goes through slow, manual compliance review before it can reach production — and mistakes are costly, both financially and to patient safety.

When I saw this hackathon's media & entertainment theme, I realized ad production for regulated health products is its own kind of "studio pipeline" — scripts have to be cleared before they can be shot, just like a film script goes through legal and standards review. I wanted to bring my regulatory background into an agentic workflow that could give marketing and compliance teams a fast first pass before human review.

What it does

Ad Script Clearance Agent is a compliance review tool for pharmaceutical and medical device advertising scripts. A user pastes or uploads a script, and the agent:

  • Identifies every specific health/medical claim in the text
  • Flags claims that are unsubstantiated, exaggerated, or missing required risk/safety disclosures
  • Returns a clear verdict — Approved, Needs Revision, or Rejected — with a severity level per flagged claim
  • Explains why each claim was flagged and recommends a specific fix
  • Saves every review to a database, so teams can track compliance history over time via a Dashboard (verdict breakdown, most common flagged claim types, recent activity)
  • Includes a Guidelines page explaining the compliance principles the agent checks against

How I built it

I built this end-to-end using Replit Agent, prompting in natural language to scaffold the app, then iterating with more specific prompts to add the Gemini API integration, database persistence, and a full visual redesign (Dashboard, Guidelines page, color-coded verdicts, example script chips for quick testing).

The backend calls the Gemini API to analyze submitted scripts against compliance principles (balanced risk-benefit presentation, no off-label promotion, no outcome guarantees, required safety disclosures) and returns structured JSON (verdict, summary, flagged claims), which is persisted to a production database and rendered in the review workspace.

Challenges I ran into

  • Deployment vs. dev environment mismatches: My first fix (updating the Gemini model name) worked in the dev preview but the published/live deployment kept failing with HTTP 502 errors. It turned out the deployed server needed its own explicit rebuild and redeploy cycle — editing source code alone wasn't enough.
  • Environment/secrets sync: Replit deployments keep production secrets separate from workspace secrets, which cost me some debugging time until I confirmed the Gemini API key was actually synced to the live deployment.
  • Daily/monthly usage limits: As a non-technical builder relying entirely on Replit Agent (no manual coding background), I hit free-tier usage limits more than once mid-build, which taught me to write more complete, all-in-one prompts instead of iterative back-and-forth requests — a real lesson in efficient agentic prompting.

What I learned

Even without a traditional coding background, I could take an idea rooted in deep domain expertise (pharmaceutical regulatory compliance) all the way to a deployed, working, tested application by prompting an AI agent effectively — and by learning to debug systematically (logs, deployment settings, production vs. dev environments) even without reading code line by line.

Share this project:

Updates