Sub topic 12
Privacy, compliance, and disclosure basics
This chapter assumes you can read short Python snippets, have written prompts for a generative AI assistant, and know the workflow anatomy from earlier chapters: inputs, steps, outputs, and review points. A workflow that runs every week sends the same kinds of data to a model every week. A privacy mistake in the template therefore repeats on every run. Governance is easier to build into the workflow once than to fix after launch.
This chapter is general guidance, not legal advice. Rules differ by country, industry, and company policy, so confirm specifics with your legal or privacy team.
What can go wrong
Three risks come up most often in marketing workflows.
- Personal data leaks into prompts. A list of customer names, emails, or purchase histories pasted into a prompt may leave your control. Depending on your vendor agreement, it may also be stored or used for training.
- Claims and content break rules. Generated copy can invent statistics, promise results, or make health or financial claims that regulators treat as advertising violations.
- Audiences are misled. Some channels and jurisdictions expect you to disclose AI-generated content, sponsorships, or automated interactions.
Minimize and redact inputs
The simplest control is to send the model less. Ask what each step needs. A subject-line step needs the offer and audience segment, not a customer list. Where personal data is unavoidable, strip it before the prompt is built.
The function below replaces email addresses and phone numbers with placeholders. Pattern matching is imperfect, so treat it as a safety net and not as your only control.
import re
EMAIL = re.compile(r"[\w.+-]+@[\w-]+\.[\w.-]+")
PHONE = re.compile(r"\+?\d[\d\s().-]{7,}\d")
def redact(text):
text = EMAIL.sub("[EMAIL]", text)
text = PHONE.sub("[PHONE]", text)
return text
note = "Contact Dana at [email protected] or +1 555 010 7788 about the renewal."
print(redact(note))Run it and the output is Contact Dana at [EMAIL] or [PHONE] about the renewal. Names still pass through, which shows why pattern-based redaction is not enough alone. Prefer to pass IDs or segment labels instead of names.
Where redaction sits in the workflow
Redaction belongs before the prompt is filled, and a claims check belongs after the model responds. Both sit outside the model, so they run the same way every time.
Check claims automatically
A rule-based check can catch phrases your compliance team has banned. It will not catch every problem, which is why a person still reviews the result.
RISKY_PHRASES = ["guaranteed", "cure", "risk-free", "#1", "clinically proven"]
def flag_claims(draft):
lowered = draft.lower()
return [p for p in RISKY_PHRASES if p.lower() in lowered]
draft = "Our guaranteed spring tune-up is risk-free."
issues = flag_claims(draft)
if issues:
print("Needs review:", issues)Keep the phrase list in the workflow's documentation and version it, as covered in the versioning chapter.
Disclosure
Disclosure means telling people when AI helped produce content or when they are talking to an automated system. Requirements vary. Check these for each channel and region:
| Situation | What to check |
|---|---|
| Published content | Platform rules and local law on AI-generated or synthetic media |
| Chatbots and automated replies | Whether users must be told they are not talking to a person |
| Testimonials and reviews | Generated testimonials presented as real customer opinions are deceptive |
| Sponsored or affiliate posts | Required endorsement labels still apply, whoever wrote the copy |
A disclosure rule is easy to build in. Add a field to the output schema, such as disclosure_required, and have the publishing step append the approved wording.
Common mistakes
- Pasting real customer exports into a prompt during testing. Use synthetic or anonymized test inputs.
- Trusting redaction that was never tested. Test it against sample records that contain edge cases.
- Using a tool your company has not approved. Confirm the vendor's data retention and training terms first.
- Leaving no record. Log which template version and inputs produced each published item, without logging raw personal data.
Exercise
A workflow drafts renewal reminder emails. Its input is a spreadsheet with customer name, email address, plan, and renewal date. Which fields should the prompt receive, and where would you place the claims check?
Show answer
Send only what the copy needs, such as plan and renewal date, plus a placeholder like {first_name} that the email tool fills in later, so the model never sees email addresses. Redact before the prompt is built. Run the claims check on the model's draft, before the human review checkpoint, so reviewers see any flagged phrases.
Exercise
Why is a regular-expression redaction function not enough as the only privacy control?
Show answer
Patterns match only formats you anticipated. The sample function misses names, addresses, and unusual number formats. It should be combined with data minimization (not sending the data at all), approved tools, and human review.