Sub topic 12
Privacy, compliance, and disclosure basics
This chapter assumes you know the workflow anatomy from earlier chapters: inputs, steps, outputs, and review points. It also assumes you can read short Python snippets. The chapter gives working practice, not legal advice. Rules differ by country, industry, and platform, so have your legal or privacy team confirm the details for your situation.
Why governance is part of the design
A reusable workflow runs many times, often unattended, and often on customer data. A mistake in a one-off chat affects one output. The same mistake in a workflow repeats on every run. If a template pulls a full customer record into every prompt, you have a privacy problem for every customer on the list.
Treat privacy, compliance, and disclosure as properties of the workflow design, like the input list and the output format. Decide them when you define inputs and outputs, then enforce them in code and in review.
Three questions drive the chapter:
- What data may enter a prompt, and which tool may receive it?
- What may the workflow publish or send, and under which rules?
- Who must be told that AI was involved, and how?
Classify the data before it reaches a prompt
Start with an inventory of every input in the workflow. Give each a class and a rule. A simple scheme is enough.
| Class | Examples | Rule for prompts |
|---|---|---|
| Public | Published blog posts, product pages, press releases | Allowed in any approved tool |
| Internal | Campaign briefs, unreleased launch dates, pricing plans | Approved tools only, with business-grade terms |
| Personal | Names, emails, phone numbers, purchase history, IP addresses | Minimize or remove. Use only if the tool and the legal basis allow it |
| Sensitive | Health, finances, children's data, precise location, government IDs | Do not send to a general-purpose model without explicit sign-off |
Personal data is any information that can identify a person, directly or in combination with other data. A first name alone may be harmless. A first name plus a city plus a purchase history can identify someone.
Keep the class next to each input in the workflow's documentation. That makes it easy for a reviewer to check whether the template asks for more than it needs.
Minimize and redact in code
Data minimization means sending only what the task needs. A subject-line workflow does not need an email address. A report summary does not need a customer's name.
Use an allowlist instead of a blocklist. An allowlist names the fields that may pass. A new column added to your export later stays out of the prompt until someone approves it. A blocklist lets new fields through by default.
Add a redaction pass for free text, such as pasted customer replies or survey comments, where personal data can hide.
import re
EMAIL = re.compile(r"[\w.+-]+@[\w-]+\.[\w.-]+")
PHONE = re.compile(r"\+?\d[\d\s().-]{7,}\d")
ALLOWED_FIELDS = {"first_name", "segment", "last_product_category"}
def minimize(record):
"""Keep only fields that the workflow's data inventory approves."""
return {k: v for k, v in record.items() if k in ALLOWED_FIELDS}
def redact(text):
"""Replace obvious emails and phone numbers in free text."""
text = EMAIL.sub("[EMAIL]", text)
return PHONE.sub("[PHONE]", text)
record = {
"first_name": "Maria",
"email": "[email protected]",
"segment": "commuter",
"last_product_category": "helmets",
}
comment = "Call Maria at +1 (555) 123-4567 or write to [email protected]."
print(minimize(record))
print(redact(comment))Running this keeps three fields from the record and prints the comment as Call Maria at [PHONE] or write to [EMAIL].
Pattern-based redaction is a safety net. It misses names, street addresses, and account numbers in unusual formats. It does not replace the allowlist. If a free-text field is likely to contain personal data, ask whether the workflow needs it at all.
Place minimize and redact as the first step of the workflow, before any template is filled. The model never sees the raw record, and later steps cannot reintroduce it by accident.
Check the tool, not just the data
The same prompt carries different risk depending on where it goes. Before a workflow handles anything beyond public data, confirm these points for the model provider and for every connected tool:
- Training use. Does the provider use your prompts and outputs to train its models? Business and API plans often say no by default, and consumer plans often differ. Read the current terms.
- Retention. How long does the provider keep prompts and outputs? Can you shorten it?
- Data processing agreement. If you send personal data, regulations such as the GDPR (the EU's data protection law) generally require a contract with the processor. It states what the provider may do with the data.
- Location. Where is the data processed and stored? Some rules restrict transfers across borders.
- Access. Who in your organization can see the prompts and logs? Use shared service accounts and the team's approved tools, not personal accounts.
Record the approved tools in the workflow documentation. A common failure is a team member who runs the workflow through a personal account because it is faster. The data inventory then says one thing and the practice says another.
Marketing rules that touch workflow output
Generated content is still your content. Your organization is responsible for what it sends and publishes, whoever or whatever drafted it. These rules matter most for marketing workflows.
Consent and lawful basis
Many regions require a legal reason to use personal data for marketing. Under the GDPR you need a lawful basis, often consent or legitimate interest. Email and SMS rules add their own requirements. Examples are the US CAN-SPAM Act (accurate sender information and a working unsubscribe) and the US TCPA (consent for marketing texts).
An AI workflow does not change these duties, but it can break them quietly. A workflow that personalizes emails from purchase history may use data in a way customers never agreed to. A workflow that mails a whole export may include people who unsubscribed. Put the suppression list check before the send step, not in the draft.
Claims, endorsements, and reviews
Advertising law requires claims to be truthful and supportable. Models invent statistics, features, and quotes with a fluent, confident tone. Treat any number, comparison, or testimonial in a draft as unverified until a person checks it against a source.
Regulators also treat fake reviews and fabricated endorsements as deceptive. The US FTC has rules against fake or AI-generated reviews and testimonials. Do not build a workflow that writes customer testimonials, or that invents quotes from named people.
Intellectual property
Check where your reference material comes from. Pasting a competitor's copyrighted article into a prompt and asking for a "rewrite" invites trouble. For images, confirm the license terms of the generation tool for commercial use. Keep a record of which tool made each asset.
Disclosure
Disclosure means telling your audience that AI helped make something. Requirements vary, and they are changing.
- Platform rules. Some social and advertising platforms require a label on realistic AI-generated or altered images, audio, and video. Check each platform's current policy before you schedule posts.
- Regulation. The EU AI Act includes transparency duties for AI-generated or manipulated media such as deepfakes, and for some AI-generated text published to inform the public. The obligations phase in over time, and exceptions apply, for instance for content under human editorial control. Confirm the current status with your legal team.
- Chat and automation. If customers talk to an AI chatbot, many rules and good practice call for telling them it is not a person.
- Client and employer contracts. Agencies in particular may owe clients a statement of how AI was used.
Decide a disclosure policy once, then build it into the workflow. For example, add a disclosure field to the structured output, set by a rule tied to the content type. A reviewer then confirms it at the review checkpoint, and the publishing step refuses to run without it.
import hashlib
import json
from datetime import datetime, timezone
DISCLOSURE_REQUIRED = {"image", "video", "audio"}
def check_disclosure(content_type, disclosure_text):
"""Block publication when a required label is missing."""
if content_type in DISCLOSURE_REQUIRED and not disclosure_text:
raise ValueError(f"{content_type} content needs an AI disclosure label")
def log_run(path, workflow, version, prompt, reviewer, disclosure_applied):
"""Append one audit record. Store a hash, not the prompt itself."""
entry = {
"time": datetime.now(timezone.utc).isoformat(),
"workflow": workflow,
"version": version,
"prompt_sha256": hashlib.sha256(prompt.encode("utf-8")).hexdigest(),
"reviewer": reviewer,
"disclosure_applied": disclosure_applied,
}
with open(path, "a", encoding="utf-8") as f:
f.write(json.dumps(entry) + "\n")
return entry
check_disclosure("image", "Image created with AI assistance.")
print(log_run("audit.jsonl", "weekly-social", "1.2.0",
"Write a post about spring service.", "j.rivera", True))The log stores a hash of the prompt, so you can later prove which prompt produced a result, without copying personal data into a second place. Log the workflow version, the reviewer, and the disclosure decision. If a complaint arrives months later, this record answers who approved what, and under which version.
Where the checks sit in the workflow
Each control belongs at a specific point. Controls placed late, such as a review that is supposed to catch personal data, fail because the data has already left your systems.
Common errors
- Sending the whole export. Someone pastes a full CRM file because it is easy. Fix it with the allowlist and a hard limit on record count.
- Secrets in prompts. API keys, passwords, and internal URLs end up in templates. Keep them in environment variables, never in prompt text or logs.
- Logs that leak. A detailed log that stores every prompt and reply becomes a second copy of your customer data. Hash prompts, and set a retention period for logs.
- Trusting the model to self-police. An instruction such as "do not include personal data" is not a control. Enforce rules in code before the call and in validation after it.
- Unverified claims at scale. A workflow that drafts 50 posts a week multiplies one invented statistic 50 times. Require source references in the structured output for any factual claim, and have a person check them.
- Prompt injection from inputs. Text pulled from the web, reviews, or emails can contain instructions aimed at the model. Treat that text as data. Do not give a workflow that reads untrusted text the power to send emails or publish without human approval.
- Stale rules. Platform policies and AI regulations change. Add a recurring review of the disclosure policy to the workflow documentation, with an owner and a date.
Summary of working rules
- Classify each input, and send only what the task needs.
- Enforce minimization and redaction in code, ahead of the template.
- Use approved tools with known retention and training terms.
- Keep consent, suppression, and claim checks outside the model.
- Build disclosure into the output structure and the review step.
- Log version, reviewer, and decisions, without copying personal data.
Exercise
A team builds a workflow that drafts personalized win-back emails. Each run sends the model the full CRM row for each customer, including email address, phone number, and support ticket text. Name three changes that reduce privacy risk, and say where in the workflow each change belongs.
Show answer
(1) At the start of the workflow, before any template is filled, apply an allowlist so only fields needed for personalization (for example first name, segment, last product category) reach the prompt. This removes the email address and phone number. (2) In the same early step, drop the support ticket text or run it through redaction, since free text often holds personal or sensitive details. (3) Before the send step, check the suppression and unsubscribe list so people who opted out receive nothing. Also acceptable: confirm that the model tool is approved, with retention and training terms that suit personal data, and log a prompt hash rather than the prompt.
Exercise
Your weekly social workflow now also produces AI-generated product images. Describe how you would add disclosure to the workflow so a missing label cannot reach publication.
Show answer
Add a disclosure field to the structured output, filled by a rule based on content type (images, video, and audio require a label). Show the field to the human reviewer at the review checkpoint. Add a check just before publishing that raises an error when a required label is empty, as check_disclosure does. Record the disclosure decision, workflow version, and reviewer in the audit log. Review platform policies on a schedule, because the label rules change.