Safety is the concern of keeping an LLM system safe, secure, and truthful — and unlike Prompt Engineering, Context Engineering, Harness Engineering, and Loop Engineering, it is not a rung on the steering ladder but a lens applied across all of them. Every rung introduces its own failure surface (an injected instruction in the prompt, poisoned evidence in the context, an over-powered tool in the harness, an unbounded action in the loop), so safety is designed in at each layer rather than bolted on at the end. Like Evaluation, it spans the whole section.

The three notes in this folder are three faces of one problem, split along a security-versus-reliability line:

  • Guardrails — the defensive controls: layered checks across input, context, output, and runtime that prevent unsafe actions, bound data exposure, and make failures detectable and recoverable.
  • OWASP LLM Top 10 — the threat taxonomy those controls answer to: the highest-impact adversarial failures, from prompt injection to excessive agency.
  • Hallucinations — the reliability failure mode that exists with no attacker at all: fluent, confident output unsupported by evidence, because the model optimizes likelihood, not truth.

The distinction matters for design. Security failures have an adversary and are bounded by controls and least privilege; reliability failures are intrinsic to how the model generates and are bounded by grounding, verification, and evaluation. A complete system needs both.

Where Safety Attaches to the Ladder

Safety is not enforced in one place — each rung owns part of it, which is why the concern is cross-cutting rather than a single note:

  • Prompt and context — prompt-injection defense lives where instructions and untrusted data meet: keep trusted instructions structurally separated from retrieved or tool-returned content (Prompt Engineering, Context Engineering). Grounding via RAG is also the first-line mitigation for Hallucinations.
  • Harness — the deterministic controls live here: sandboxing, permission gating, and least-privilege credentials sit in code and infrastructure, not in the prompt (Harness Engineering).
  • Loop — human-approval boundaries and the escape hatches for actions the system cannot safely verify are a runtime decision (Loop Engineering).
  • Measurement — whether any of it works is answered by Evaluation; safety controls are only as good as the tests that exercise them.

Defense in Depth

The organizing principle across all three children is defense in depth: no single filter is sufficient, and critical controls are enforced in code and infrastructure rather than by asking the model to behave. A prompt-level rule (“do not reveal the system prompt”, “never call delete”) is advisory — it fails under prompt injection or a poisoned tool description. The durable controls are structural: validate inputs, isolate untrusted content, gate privileged actions, check outputs before they reach downstream systems, and assume any single layer can be bypassed. The goal is not a perfect system but one whose failures are bounded, detectable, and recoverable.

Questions

References

3 items under this folder.