Week 5. Text-to-SQL safety, threat model, finish analytical drills.
Problem statement
You allow an internal “analytics copilot” to propose SQL. Finance worries about wrong revenue, Security worries about PII exfiltration. Write policies an engineer could implement.
Outcomes
- Read-only roles, LIMIT, allowlists, audit expectations.
- Text-to-SQL risk→control mapping.
Deliverables
threat_model_sql.md(≤ 400 words): three harms, one control each.- Finish remaining drill prompts from
faang_style_drills.sqlif any pending.
Links
- [ ] OWASP LLM Top 10 — focus items tied to data leakage and excessive agency.
- [ ] Skim docs: database read-only users / grants (conceptual).
Time: ~2 h.
Task A — Threat model
Document three realistic failure modes for model-generated SQL (join error, PII column, destructive statement). For each: control (human review, allowlist, read replica, LIMIT 5000, etc.). Save threat_model_sql.md.
Task B — Semantic layer note
Pick one ambiguous metric from Week 04 (e.g. “active user”) and write one approved definition your org could publish in a semantic layer (≤ 5 sentences).
Task C — Drill completion
Ensure you’ve attempted all five drill themes in faang_style_drills.sql (adapt dates/experiments if needed). Mark status in drills_checklist.md.
Submit: my-submissions/week-05/.
30 min. Closed book.
1
Why is LIMIT alone insufficient as a safety control for analytics SQL?
2
Give an example of schema grounding you’d feed an LLM before text-to-SQL.
3
Name two differences between “PM explores in BI tool” vs “LLM proposes SQL” from a governance perspective.
Self-grade: Phase 2 checklist.
Concepts & curated links: read the Learn chapter SQL & data validation first (topic path, not calendar-only). This file is the weekly practice bank — extra drills and a checklist on top of Readings → Practice → Exam.
1. Practice bank
| # | Problem | Data / materials | Expected outcome |
|---|---|---|---|
| P1 | Document 3 failure modes for analytics copilot SQL + 1 control each. | None | threat_model_sql.md |
| P2 | Define one ambiguous metric (“active user”) with approved definition. | None | Paragraph for semantic layer |
| P3 | Finish all drill themes in faang_style_drills.sql. |
cloudnote.db |
drills_checklist.md |
2. Week checklist
- [ ] OWASP LLM skim + threat model doc
- [ ]
PRACTICE.md+EXAM.md