Leanpub Header

Skip to main content

AI-Native Systems Engineering: Building, Running, and Securing Autonomous Software on Linux

A Production-Focused Handbook for Designing Useful, Controllable, Observable, Reliable, Maintainable, Secure, and Production-Ready Autonomous Systems

AI-Native Systems Engineering: Building, Running, and Securing Autonomous Software on Linux
This book is 100% completeLast updated on 2026-08-26

Build AI systems that do more than demo well. This hands-on guide shows you how to engineer autonomous software on Linux that is secure, observable, reliable and ready for production. From agents and memory to threat modeling, OpenTelemetry and Kubernetes, you’ll build a real system while learning what it takes to run AI you can actually trust.

Minimum price

$25.00

$35.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
310
Pages
About

About

About the Book

This book teaches you how to design, build, deploy, and operate production-grade autonomous software systems on Linux. It covers the complete lifecycle from architectural foundations through security hardening and operational maturity, using a progressive reference implementation that evolves across every chapter. You will learn Linux internals relevant to AI workloads, inference runtime selection, agent architectures, memory and retrieval systems, threat modeling for autonomous software, defense-in-depth security controls, observability with OpenTelemetry, reliability engineering patterns, and deployment strategies ranging from systemd services to Kubernetes clusters. The goal is not a survey of AI agents but a cohesive systems-engineering handbook grounded in Linux-native, open standards, vendor-neutral approaches that produce real systems you can run, trust, and operate.

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 420 engineers and researchers. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

A Production-Focused Handbook for Designing Useful, Controllable, Observable, Reliable, Maintainable, Secure, and Production-Ready Autonomous Systems

Introduction

Part I: Foundations: What AI-Native Systems Engineering Is and Why It Matters

Chapter 1: Defining AI-Native Systems

  1. What “AI-Native” Means (and Does Not Mean)
  2. How AI-Native Differs from Traditional Software, Cloud-Native, MLOps, and Agent Frameworks
  3. The Core Properties of Autonomous Software: Agency, Autonomy, Adaptability, Uncertainty
  4. Architectural Principles for AI-Native Systems
  5. What This Book Builds: The Reference Architecture Roadmap

Chapter 2: Linux Foundations for AI Workloads

  1. Process Management, Signals, and Lifecycle Control for Long-Running Daemons
  2. Resource Management: cgroups v2, Limits, and Accounting for AI Workloads
  3. Namespaces and Isolation Primitives: Building Containment from the Kernel Up
  4. GPU and Accelerator Management on Linux: Drivers, MIG, and Resource Slicing
  5. Filesystem Layouts, I/O Patterns, and Storage Considerations for AI Systems
  6. systemd as the Foundation for Production Deployment

Chapter 3: Autonomy, Control, and Determinism

  1. Levels of Autonomy: From Tool-Assisted to Fully Autonomous Operations
  2. Designing the Probabilistic-Deterministic Boundary
  3. Contracts Between AI Components and Traditional Software
  4. Making Agent Actions Idempotent, Auditable, and Reversible
  5. Controlling Blast Radius: Scoping Agency and Limiting Damage

Part II: Architecture and Core Patterns

Chapter 4: System Architecture for Autonomous Services

  1. Service-Oriented Architecture for AI-Native Systems
  2. Event-Driven Patterns: Queues, Topics, and Asynchronous Workflows
  3. State Management: Durable State, Checkpointing, and Recovery
  4. Workflow Orchestration vs Agent Autonomy: When to Use Each
  5. The Reference Architecture: Component Map and Data Flows

Chapter 5: Models, Inference, and Runtime Selection

  1. Model Deployment Options: Local, Remote, Hybrid, and Multi-Provider Strategies
  2. Inference Runtimes: vLLM, Ollama, llama.cpp, TensorRT-LLM, and Others
  3. Performance Characteristics: Latency, Throughput, Memory, and Cost Profiles
  4. Structured Outputs, Schemas, and Reliable Parsing
  5. Graceful Degradation When Models Fail or Degrade

Chapter 6: Tools, APIs, and Function Calling

  1. Tool Definition and Discovery: Schemas, Descriptions, and Capabilities
  2. Function Calling Patterns: Direct, Indirect, and Dynamic Tool Selection
  3. API Design for AI Consumers: Idempotency, Error Semantics, and Documentation
  4. Authentication, Authorization, and Credential Management for Agent Tools
  5. Reliability Patterns: Retries, Timeouts, Circuit Breakers, and Fallbacks

Chapter 7: Memory, Context, and Retrieval

  1. Short-Term vs Long-Term Memory Architectures
  2. Context Engineering: Window Management, Summarization, and Compression
  3. Vector Databases and Semantic Search: Architecture and Implementation
  4. Retrieval-Augmented Generation (RAG) Patterns and Pitfalls
  5. Hybrid Storage: Combining Vector, Relational, and Document Stores

Chapter 8: Agents, Multi-Agent Systems, and Planning

  1. What an Agent Actually Is: Definitions, Capabilities, and Misconceptions
  2. Single-Agent Architectures: ReAct, Plan-and-Execute, and Variants
  3. When Multi-Agent Systems Help (and When They Hurt)
  4. Planning, Reasoning, and Task Decomposition Patterns
  5. Inter-Agent Communication, Trust, and Coordination

Part III: Security: Designing Defenses for Autonomous Software

Chapter 9: Threat Modeling for AI-Native Systems

  1. The Expanded Attack Surface: New Vectors Introduced by Autonomy
  2. Prompt Injection: Direct, Indirect, and System-Level Attacks
  3. Tool Abuse and Privilege Escalation Through Agent Capabilities
  4. Data Exfiltration, Credential Leakage, and Information Disclosure
  5. Supply Chain Threats: Models, Dependencies, and Knowledge Bases

Chapter 10: Defense in Depth for Autonomous Systems

  1. Sandboxing Strategies: Containers, Namespaces, and Process Isolation
  2. Linux Security Modules: SELinux and AppArmor for AI Workloads
  3. System Call Filtering with seccomp: Restricting Agent Capabilities
  4. Network Security: Segmentation, Egress Controls, and Service Mesh
  5. Secrets Management and Credential Isolation Patterns

Chapter 11: Safe Execution, Approval Gates, and Containment

  1. Safe Code Execution: Sandboxes, Interpreters, and Restricted Environments
  2. Shell Command Safety: Validation, Allowlisting, and Escaping
  3. Human-in-the-Loop Controls: Approval Gates for Consequential Actions
  4. Kill Switches, Emergency Stops, and Graceful Shutdown Procedures
  5. Containment and Recovery When Agents Are Compromised

Part IV: Operations: Running AI-Native Systems in Production

Chapter 12: Observability, Testing, and Evaluation

  1. Observability Foundations: Logs, Metrics, Traces for AI Systems
  2. OpenTelemetry Integration for End-to-End Tracing
  3. Testing Strategies for Probabilistic Components and Agent Behavior
  4. Evaluation Frameworks: Correctness, Safety, Reliability, and Performance
  5. Simulation and Benchmarking Environments

Chapter 13: Reliability, Scalability, and Performance Optimization

  1. Fault Tolerance Patterns: Retries, Timeouts, Circuit Breakers, and Idempotency
  2. Caching Strategies: Prompt Results, Embeddings, and Vector Search Optimization
  3. Concurrency Control and Distributed Systems Concerns
  4. Capacity Planning, Cost Engineering, and Performance Optimization

Part V: Deployment and Operations: Running in Production

Chapter 14: Deployment, Lifecycle Management, and Governance

  1. Configuration Management and Environment Strategy
  2. CI/CD Pipelines: Building, Testing, and Deploying AI-Native Systems
  3. Infrastructure as Code: Terraform, Ansible, and Declarative System Definition
  4. Deployment Strategies: systemd Services, Containers, and Kubernetes
  5. Upgrades, Rollbacks, and Zero-Downtime Operations
  6. Backup, Disaster Recovery, and Incident Response Procedures
  7. Governance Frameworks, Compliance, and Ethical Considerations

Conclusion: The Future of AI-Native Systems Engineering

  1. Synthesis: What Makes an AI-Native System Production-Ready
  2. The Complete Reference Architecture: Sentinel in Production
  3. Deployment Walkthrough: From Clean Host to Running System
  4. Security Hardening Checklist
  5. Architectural Decision Guidance
  6. Forward-Looking: How AI-Native Systems Engineering Will Evolve

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub