In this lecture we unpack a systematic approach to secrets and sensitive data in ChatGPT Apps: where keys should live (
KMS,
Secrets Manager, env‑vars), why secrets don’t belong in the
system‑prompt and
_meta, how a secret’s lifecycle works (creation → storage → runtime injection → rotation), and how to organize
PII‑scrub (mask/remove/pseudonymize) for logs, traces, and APM (e.g., via
pino and
redact rules). Separately — secret scanning, actions after a leak, and common mistakes (e.g.,
NEXT_PUBLIC_ secrets and logging
Authorization).