Foreword
In a remarkably short span of time, generative artificial intelligence gave rise to two opposing yet equally sterile attitudes: unbridled hype promising that all human labor will vanish overnight, and entrenched skepticism dismissing every breakthrough as mere statistical trickery. This book stems from a third, grounded vantage point: that of the engineer tasked with deploying a resilient system to production on Monday morning.
An agent is neither magic nor a chatbot on steroids. It is a software system governed by formal properties—calibrated autonomy, bounded memory, fallible tools, and measurable economics. As such, it can be engineered, tested, audited, and governed. The chapters that follow apply to AI agents the hard-won discipline software engineering spent decades refining: specification before improvisation, defensive control harnesses before blind trust, and foundational design principles before fragile recipes.
This opening volume lays the bedrock. Subsequent volumes extend these foundations to the frontier—critical industries, geopolitics, and developer tooling—to organizational structures—governance, roles, and culture—and to scale—orchestration, resilience, and token economics. While each volume stands on its own, together they constitute an integrated architectural blueprint.
Read this with an open code editor and a critical mind. The code is meant to be executed; the theses, to be rigorously debated.
Sergio Perez Ruiz
Lima, 2026