- No secrets in prompts.
- No secrets in logs.
- Validate file type and size.
- Refuse unsupported high-risk advice.
- Show uncertainty when evidence is weak.
LESSON 09 · AI FOUNDATIONS
Add Safety Rails
Safety rails are practical engineering controls: input validation, secret handling, refusal behavior, minimal logging and clear escalation paths.
Goal: Define basic safety controls35 minOutput: Safety checklist
api_key=sk_... -> api_key=[REDACTED]
password=... -> password=[REDACTED]
token=... -> token=[REDACTED]Create three unsafe inputs and write the expected safe response for each.
Create a safety checklist and redaction examples for your app.
LEARNING CHECKPOINT
Capture the deliverable before moving on.
Safety checklist is your evidence that this lesson has been applied, not just read.
✓ PRACTICAL OUTPUT