An AI model can propose an action, but the software around it determines what happens next. Harness Engineering explains how to build that surrounding system: the execution loop, tool interfaces, context management, permission boundaries, evaluation, and operational controls that make agent behavior inspectable and manageable.Written for experienced software engineers, the book develops these ideas through a coding-agent running example and focused Python companions. It begins with a small execution loop and an independent evaluator, then introduces controlled edits, repository navigation, checkpoints, retries, and recovery. Dedicated security chapters examine prompt injection, exact-action approval, defense testing, and containment. Later chapters cover tracing, comparative evaluation, resource management, multi-agent coordination, protocol integration, durable service operation, and state evolution.Code examples, diagrams, failure scenarios, exercises, and solutions explain how the mechanisms work and where their guarantees end. A free companion repository provides runnable code, tests, and retained example results. The emphasis is on understanding engineering decisions well enough to build and evaluate your own harness.