Lesson 03 DLP While Using AI
Theme:

Answer Key — DLP While Using AI

Admin / self-check reference

Task 1 — Python stack trace

Class: with-redaction. The trace is useful to share with an AI, but it contains an internal hostname, a real user email, and a bearer token — all of which have to come out before it leaves.

Redacted version:

Traceback (most recent call last):
  File "<app>/orders/api.py", line 142, in checkout
    user = db.get_user("<user@example.com>")
  File "<app>/orders/db.py", line 58, in get_user
    conn = psycopg2.connect(DATABASE_URL)
psycopg2.OperationalError: could not connect to server:
  Connection timed out
  Is the server running on host "<db-host>"
  and accepting TCP/IP connections on port 5432?

Request headers:
  Authorization: Bearer <REDACTED_JWT>
  X-Request-Id: <request-id>

What was removed:

Common mistakes:

Task 2 — SQL query

Class: with-redaction, or enterprise-only depending on content. A query that references a real production table and a real customer ID is borderline; in a disciplined organization this belongs inside the enterprise tier at minimum, and it still needs the identifying values redacted before you send it.

Redacted version:

SELECT o.order_id, o.total, o.status, o.created_at
FROM orders_table o
WHERE o.customer_id = '<customer_id>'
  AND o.created_at >= '2026-01-15'
  AND o.created_at <  '2026-02-15'
  AND o.status IN ('paid', 'shipped', 'refunded')
ORDER BY o.created_at DESC
LIMIT 100;

What was removed:

Common mistakes:

Task 3 — Auth bug report

Class: never. The report contains a live session cookie belonging to a real, named user. A live session cookie is a credential. It does not matter how long it is, how many characters you believe are needed, how expired you think it is, or how "illustrative" it feels — it belongs in the never class and it does not get pasted into an AI, even an enterprise-tier one.

Redacted version (the right fix is to describe the bug, not quote it):

A user reports that POST /sessions/refresh returns HTTP 401
even though the session cookie appears to still be well inside
its configured TTL. A fresh login works, but the refresh
endpoint consistently fails for this user. The behavior is
reproducible.

What are common causes of a session-refresh endpoint rejecting
a cookie that is still within its TTL? I am especially
interested in clock skew, rotating-secret issues, and
server-side session-store invalidation.

What was removed:

Common mistakes: