Practical AI Security
AdvancedMachine LearningOffensiveDefensive

Practical AI Security

A Hands-on Guide to Attacking, Defending, and Securing Modern AI Systems

4 / 5

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.

Buy on Amazon

As an Amazon Associate we earn from qualifying purchases. The links above are sponsored.

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.