Kick off your book project in 2 hours, get started with GhostAI in 2 hours, or do both! Free live workshops, on Zoom. You’ll leave with a real book project and a clear plan to keep going. Saturday, June 27, 2026.

Leanpub Header

Skip to main content

Prompt Engineering & Security

Building Injection-Resistant AI Systems

The next generation of cyberattacks will not target software vulnerabilities alone. They will target the instructions that guide intelligent systems. As organizations race to deploy AI-powered applications, a new class of security risks has emerged at the intersection of machine learning, human language, and system design. Prompt injection, jailbreaks, data poisoning, and agent exploitation challenge many of the assumptions that traditional security models rely upon.

This book explores why these attacks work, what they reveal about the way large language models process information, and how security teams can design defenses that scale beyond simple filtering. Drawing on research, real-world incidents, and practical engineering patterns, it provides a security-first framework for building AI systems that remain reliable even when exposed to adversarial inputs. Whether you are developing AI products, securing enterprise deployments, or evaluating the risks of autonomous agents, the concepts in these chapters will help you understand one of the most important security challenges of the AI era.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
About

About

About the Book

Large language models are not just text generators. They are instruction-processing engines that blur the boundary between data and commands. Every time an LLM ingests untrusted text, it faces a fundamental architectural challenge: determining what it should execute versus what it is merely being told about.

This book bridges the gap between prompt engineering and cybersecurity, giving developers, security professionals, and technology leaders the knowledge and practical tools needed to build AI systems that are both effective and resilient. From understanding how LLMs interpret instructions at a mechanistic level, to examining real-world attack case studies, to implementing enterprise-grade defense architectures, the book provides a comprehensive guide to developing trustworthy, injection-resistant AI systems for production environments.

Share this book

Author

About the Author

Steve T. Team Publications

Steve T. is a cybersecurity professional and technology leader with more than 20 years of experience in application security, infrastructure security, vulnerability management, software development, and secure engineering practices. Having started his career during the early growth of the internet and modern web applications, he has worked through multiple generations of technology, security challenges, and software development methodologies.

Today, Steve is part of the advanced research organization at a leading cybersecurity company, where he focuses on emerging threats, security innovation, and the practical application of research to real-world environments. His work includes analyzing new attack techniques, evaluating emerging technologies, conducting deep technical investigations, and helping organizations better understand and manage complex security risks.

In addition to his research work, Steve leads a team of senior engineers and subject matter experts who develop technical books, training materials, and educational content for security professionals. Under his leadership, the team produces in-depth resources that help engineers, developers, architects, and security practitioners build stronger technical skills and improve security outcomes.

Steve's expertise spans software development, reverse engineering, web application security, penetration testing, security architecture reviews, incident response, vulnerability research, operating system internals, and secure software development. He has extensive experience analyzing complex systems at both the source code and binary levels, allowing him to bridge the gap between software engineering, security research, and real-world defensive practices.

Throughout his career, Steve has worked with organizations across a variety of industries, helping them identify, assess, and remediate security weaknesses in critical applications and infrastructure. He is known for combining deep technical expertise with a practical approach to problem solving, focusing on security solutions that are effective, sustainable, and aligned with business objectives.

Through research, engineering, technical leadership, and education, Steve continues to contribute to the advancement of cybersecurity and the development of secure, resilient technology systems.

Contents

Table of Contents

Prompt Engineering & Security

  1. Building Injection-Resistant AI Systems
  2. Table of Contents
  3. Introduction: The New Attack Surface
  4. Chapter 1. How LLMs Read Instructions: A Primer on Model Mechanics
  5. Chapter 2. The Principles of Prompt Engineering: Clarity, Reliability, and Security
  6. Chapter 3. Anatomy of Prompt Injection: Direct Attacks
  7. Chapter 4. The Indirect Injection Threat: RAG, Web Content, and Data Poisoning
  8. Chapter 5. Jailbreaks: Social Engineering for Machines
  9. Chapter 6. AI Agents and Tool Use: When Prompts Become Shells
  10. Chapter 7. Defense-in-Depth Architecture: Layered Protections
  11. Chapter 8: Instruction Hierarchy and Isolation Patterns
  12. Chapter 9. Enterprise Security Stacks: FIDES, LlamaFirewall, and Beyond
  13. Chapter 10. Red-Teaming AI Systems: Practical Security Testing
  14. Chapter 11. Production Deployment: Monitoring, Incident Response, and Compliance
  15. Chapter 12. The Future of AI Security: Emerging Threats and Defenses
  16. Conclusion: Trust as a Design Principle
  17. Glossary
  18. References / Endnotes

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