
Practical AI Security
A Hands-on Guide to Attacking, Defending, and Securing Modern AI Systems
The founder of an AI-security firm, with a PhD in adversarial machine learning, walks from how models fail to how they're exploited to how they're defended and audited, with over 30 hands-on Python demos.
Verdict
A knowledgeable, hands-on tour of how AI systems fail and get attacked, strongest for teams that train their own models, thinner for security practitioners who mostly consume hosted LLMs.
As an Amazon Associate we earn from qualifying purchases. The links above are sponsored.
- Authors
- Harriet Farlow
- Published
- 2026
- Publisher
- No Starch Press
- Pages
- 392
- Language
- English
Read this if
Security practitioners and ML engineers who need practical, hands-on grounding in attacking and defending AI systems rather than a survey of the field. Farlow has led AI-security assessments for Fortune 500s and government agencies, and the book is built from that assessment experience.
Skip this if
Readers who want a conceptual or policy-level introduction to AI risk; this is a hands-on technical guide with Python demos throughout, not an AI-governance primer. Also assumes baseline ML and security fundamentals rather than teaching either from zero.
Key takeaways
- First book in this catalog to treat AI/ML systems as a first-class attack surface in their own right, not a feature bolted onto traditional appsec.
- Structured around the full lifecycle: how models fail, how failures become exploits, then how to defend and audit against both.
- Over 30 hands-on Python demos keep the material concrete rather than theoretical — attacks and defenses you can actually run.
Strengths
- Strong opening chapters on what AI is and how models work, backed by more than 30 runnable notebooks.
- Useful threat-modeling material that draws on MITRE ATLAS, the OWASP LLM list and CSA's MAESTRO, plus a clear attack taxonomy and the ML lifecycle framed as attack surface.
- Real incidents (such as the Cylance bypass) and per-chapter resource lists ground the material.
- Closing chapters on safety and governance give context most technical books skip.
Weaknesses
- Tries to serve both security people learning AI and AI people learning security; the security half is the shallower one.
- Little on securing architectures around third-party models (LLM gateways, RAG protection, guardrails), which is what many organisations actually run.
- The chapter on attacking and defending with AI, including SOC use, is the weakest according to the most detailed review so far.
What readers say
Reader discussion is still sparse for this June 2026 release. The most detailed independent review praises the author's command of the field, the opening chapters and the runnable code, but finds the security content shallow, misses guidance for teams that only consume hosted models, and calls the AI-in-the-SOC chapter the main letdown. The overall verdict there is mildly disappointed but glad to have read it.
Our review
Practical AI Security starts strong. Harriet Farlow, who holds a PhD in adversarial machine learning and runs an AI-security consultancy, opens with a genuinely good explanation of what AI is and how models are built, then moves to threats, attacks and weaknesses, and defenses, with more than 30 Python notebooks you can run along the way. The threat-modeling material, built on MITRE ATLAS, the OWASP LLM list and CSA's MAESTRO, is the part security teams will reuse most.
The second half is less even. The red-teaming chapter is useful if your organisation is new to the practice but will feel familiar to experienced red teamers, and the chapter on using AI for attack and defense stays high level. The most detailed review we found argues the book drifts from addressing security people learning AI toward AI practitioners learning security, and that readers whose companies only consume hosted LLMs will find little on securing gateways, RAG pipelines and wrappers. The closing chapters on safety, governance and what comes next add welcome context.
Buy it if you build or fine-tune models; temper expectations if you mainly integrate vendor APIs.
A genuinely new topic for this catalog, which otherwise has no dedicated AI-security title. Pairs with Malware Data Science and The Android Malware Handbook for the "ML applied to security" side, and with Designing Secure Software for readers thinking about how AI components fit into a broader secure-design practice.
What to read before
What to read before Practical AI Security →Advanced · 2020
Intelligence artificielle, cybersécurité et cyberdéfense
An academic examination of how artificial intelligence reshapes cybersecurity and cyberdefence — opportunities, threats and strategic implications — by France's most prolific cyberwar scholar.
Intermediate · 2021
Designing Secure Software
Loren Kohnfelder, the original PKI author, on how to weave security thinking through requirements, design, implementation and operations rather than bolt it on at the end.
Intermediate · 2008
Hacking: The Art of Exploitation
A from-first-principles tour of low-level exploitation that still teaches the mindset two decades later.
What to read next
What to read after Practical AI Security →Advanced · 2020
Intelligence artificielle, cybersécurité et cyberdéfense
An academic examination of how artificial intelligence reshapes cybersecurity and cyberdefence — opportunities, threats and strategic implications — by France's most prolific cyberwar scholar.
Advanced · 2017
Attacking Network Protocols
James Forshaw, Project Zero veteran, on how to capture, parse, and break protocols from the wire up to the application layer, with a strong focus on building reusable analysis tooling.
Advanced · 2020
Building Secure and Reliable Systems
Google's site-reliability and security teams jointly write down what it actually takes to build systems that are both safe and dependable, from threat models and design reviews to rollback culture and crisis response.
Explore similar books
Alternatives to Practical AI Security →Advanced · 2020
Intelligence artificielle, cybersécurité et cyberdéfense
An academic examination of how artificial intelligence reshapes cybersecurity and cyberdefence — opportunities, threats and strategic implications — by France's most prolific cyberwar scholar.
Advanced · 2024
Windows Security Internals
Forshaw takes apart the Windows security model from the SRM and access tokens up through Kerberos, with live PowerShell you can run against your own machine. The most authoritative single source on how Windows actually decides who can do what.
Advanced · 2023
Security Chaos Engineering
Kelly Shortridge and Aaron Rinehart on treating security as a property of complex adaptive systems: instead of preventing failure, you continuously simulate it, and design the organization to learn from each result.