AI Engineering from Scratch Phase 18 Introduction
AI Engineering from Scratch
0% Completed

Phase 18: Ethics Safety Alignment

Phase 18: Ethics, Safety & Alignment

> Build AI that helps humanity. Not optional.

Start this phase on GitHub

Prerequisites: Phase 10 Lessons 06, 07, and 08 on SFT, RLHF, and DPO.

First lesson: Instruction-Following as Alignment Signal

Run this command from the repository root:

python3 phases/18-ethics-safety-alignment/01-instruction-following-alignment-signal/code/main.py

Keep the command, exit code, policies with and without the KL penalty, reward
and KL trajectories, and one sentence naming the proxy failure you observed.

Next action: Change the KL coefficient, predict policy drift, then continue
to Reward Hacking and Goodhart’s Law.

Browse the full Phase 18 lesson list or the
cross-phase roadmap.

Lessons in this phase

  • Instruction-Following as Alignment Signal
  • Reward Hacking and Goodhart’s Law
  • The Direct Preference Optimization Family
  • Sycophancy as RLHF Amplification
  • Constitutional AI and RLAIF
  • Mesa-Optimization and Deceptive Alignment
  • Sleeper Agents — Persistent Deception
  • In-Context Scheming in Frontier Models
  • Alignment Faking
  • AI Control — Safety Despite Subversion
  • Scalable Oversight and Weak-to-Strong Generalization
  • Red-Teaming: PAIR and Automated Attacks
  • Many-Shot Jailbreaking
  • ASCII Art and Visual Jailbreaks
  • Indirect Prompt Injection — Production Attack Surface
  • Red-Team Tooling — Garak, Llama Guard, PyRIT
  • WMDP and Dual-Use Capability Evaluation
  • Frontier Safety Frameworks — RSP, PF, FSF
  • Anthropic’s Model Welfare Program
  • Bias and Representational Harm in LLMs
  • Fairness Criteria — Group, Individual, Counterfactual
  • Differential Privacy for LLMs
  • Watermarking — SynthID, Stable Signature, C2PA
  • Regulatory Frameworks — EU, US, UK, Korea
  • EchoLeak and the Emergence of CVEs for AI
  • Model, System, and Dataset Cards
  • Data Provenance and Training-Data Governance
  • Alignment Research Ecosystem — MATS, Redwood, Apollo, METR
  • Moderation Systems — OpenAI, Perspective, Llama Guard
  • Dual-Use Risk — Cyber, Bio, Chem, Nuclear Uplift