lesson
60 min

Consent and Provenance

Map how data moves through an AI system, tie every use to a purpose people agreed to, and track where every record came from.

Objective

By the end of this lesson, you can draw a data flow map for an AI system, tie each use of data to consent, and attach provenance that lets code block uses people never agreed to.

Data flows are architecture

An AI system touches data in more places than most teams expect. For an intake assistant, client words may pass through:

  1. The web form or chat window.
  2. Your application server and its logs.
  3. A redaction step.
  4. A model provider (hosted API or managed service) and its logs.
  5. A retrieval index.
  6. An evaluation set, if you sample conversations for testing.
  7. Analytics dashboards.
  8. Backups.

Each stop is a copy. Each copy needs a reason, an owner, a retention period, and a deletion path. A data flow map draws all of them. Draw it before you build, and update it whenever the design changes.

Consent is tied to a purpose

Consent means a person agreed to a specific use of their data. It is not a blanket permission. "To receive services" does not cover "to train or improve AI models." A new purpose needs new consent, or the data stays out.

Good consent in community settings:

  • Plain language in the person's own language, read aloud if needed.
  • Separate choices for separate uses. Services never depend on agreeing to AI uses.
  • Easy to withdraw, with a real process to remove the data, including from indexes and test sets.
  • Recorded: what they agreed to, when, and on which version of the form.

Provenance travels with the data

Provenance is the record of where data came from, how it was collected, and what it may be used for. Attach it to records so code can enforce the rules.

Run it. Only r2 may be used to improve the AI. Then change the purpose to "service" and run again. Which records are usable now? Why is r4 still blocked?
Python 3
Ctrl+Enter to run | Tab to indent | Python runs in your browser via Pyodide

The first run downloads Python into your browser (several MB).

Documents need provenance too. For a RAG index, record each document's owner, date, version, and who may see it. Do not index documents whose origin or permissions you cannot confirm.

A national example

Quiz: Consent and provenance check

  1. 01A person withdraws consent for AI uses. Where must their data be removed?

    Choose one.

  2. 02Why should services never depend on agreeing to AI uses?

    Choose one.

Go deeper: Consent as signal: the first-party data layer you own

Ask. Answer. Build together.