36 chapters / 7 appendices

Inside the handbook

A chapter-by-chapter map of The AI Hacker's Handbook, from AI attack-surface fundamentals through agents, automation, defenses, vulnerability reporting, and the business side of AI security.

36 chapters7 appendices7 parts
PART I

Foundations: From Web Hacker to AI Hacker

CHAPTER 01

The New Attack Surface

Maps the modern AI attack surface and introduces the five-layer model used throughout the book.

KEY TOPICS
  • The five layers of an AI system
  • Where familiar web bugs reappear
  • Real-world AI incidents
  • The attack-surface map
CHAPTER 02

Inside an LLM, the Attacker’s View

Builds an attacker’s mental model of tokens, context, prompts, retrieval, fine-tuning, tools, and agents.

KEY TOPICS
  • Tokens and context
  • System prompts vs. user input
  • Sampling and probabilistic attacks
  • Embeddings, RAG, fine-tuning, tools and agents
CHAPTER 03

Building Your AI Hacking Lab

Shows how to build a repeatable lab using local models, hosted APIs, legal targets, traffic interception, and resettable environments.

KEY TOPICS
  • Running models locally
  • Hosted model APIs
  • Legal practice targets
  • Intercepting and logging AI traffic
CHAPTER 04

First Blood

Moves from the mental model to concrete attack paths, including prompt-rule bypasses, prompt leakage, document injection, and unsafe output handling.

KEY TOPICS
  • Breaking model rules
  • Hidden system-prompt leakage
  • Instruction smuggling in documents
  • Output-to-XSS paths
CHAPTER 05

The AI Hunter’s Methodology

Presents the repeatable workflow for fingerprinting, mapping, selecting attacks, proving impact, and building evidence.

KEY TOPICS
  • Model and guardrail fingerprinting
  • Mapping tools, data and agency
  • Attack selection
  • Impact confirmation and reporting evidence
CHAPTER 06

Scope, Ethics, and Disclosure

Covers safe and authorized AI testing, handling unintended data exposure, and coordinated disclosure for live systems.

KEY TOPICS
  • AI bug-bounty scope
  • Testing hosted models within rules
  • Handling exposed data
  • Coordinated disclosure
PART II

Attacking the Model

CHAPTER 07

Direct Prompt Injection

Examines instruction override and context-switching attacks, then closes with practical defenses.

KEY TOPICS
  • Injection mindset
  • Instruction override
  • Reusable payloads
  • Defending against direct injection
CHAPTER 08

Indirect Prompt Injection

Explores attacks delivered through documents, pages, messages, images, and audio rather than directly to the model.

KEY TOPICS
  • Document and web-content poisoning
  • Multimodal injection
  • Zero-click chains
  • Exfiltration paths
CHAPTER 09

The Art of the Jailbreak

Covers multi-turn and context-based jailbreak techniques and a more honest way to measure bypass reliability.

KEY TOPICS
  • Roleplay and personas
  • Multi-turn attacks
  • Many-shot and context flooding
  • Jailbreak measurement
CHAPTER 10

Obfuscation, Encoding, and Token Smuggling

Shows how alternate representations and tokenizer behavior can undermine simplistic filtering and blocklists.

KEY TOPICS
  • Encodings and homoglyphs
  • Language and translation bypasses
  • Payload splitting
  • Tokenizer quirks
CHAPTER 11

Automated and Adversarial Attacks

Introduces adversarial suffixes, automated red-teaming loops, model-to-model testing, and release-gate thinking.

KEY TOPICS
  • Adversarial suffixes
  • Automated red-teaming
  • Using one model against another
  • Adversarial testing as a release gate
CHAPTER 12

Stealing the System Prompt and Its Secrets

Treats prompt extraction as a security finding and examines how exposed prompts can reveal tools, keys, and internal logic.

KEY TOPICS
  • Direct and indirect extraction
  • Tools, keys and internal logic
  • Prompt reconstruction
  • Designing as if the prompt is public
PART III

Attacking the Application Around the Model

CHAPTER 13

Insecure Output Handling

Follows generated text into browsers, databases, shells, links, images, and other sinks where trust-boundary failures create impact.

KEY TOPICS
  • Generated-text trust failures
  • Markdown and HTML injection
  • Database and shell sinks
  • Output-boundary defenses
CHAPTER 14

RAG Poisoning and Vector Store Attacks

Breaks down retrieval pipelines, poisoned documents, similarity manipulation, and cross-user or cross-tenant retrieval risks.

KEY TOPICS
  • Retrieval pipeline failures
  • Document poisoning
  • Embedding and similarity manipulation
  • Cross-tenant retrieval
CHAPTER 15

Data Exfiltration and Cross-User Leakage

Focuses on extracting sensitive information across sessions, users, tenants, tools, and content paths.

KEY TOPICS
  • PII and secret extraction
  • Cross-session and cross-tenant leakage
  • Tool and content exfiltration
  • Least privilege for context and tools
CHAPTER 16

Extracting the Data and Stealing the Model

Covers membership inference, verbatim extraction, fine-tune leakage, query-based model extraction, and weight recovery.

KEY TOPICS
  • Membership inference
  • Fine-tuned model secrets
  • Query-based extraction
  • Model and weight theft
CHAPTER 17

Supply Chain, Poisoned Models, and Malicious Weights

Examines model files, fine-tunes, adapters, dataset hubs, provenance, signing, and safe loading as security boundaries.

KEY TOPICS
  • Malicious model files
  • Backdoored fine-tunes and adapters
  • Model and dataset hub trust
  • Provenance and safe loading
CHAPTER 18

Denial of Wallet, Hallucination, and Overreliance

Connects AI-specific failure modes to security impact through cost exhaustion, resource exhaustion, hallucinated dependencies, and overreliance.

KEY TOPICS
  • Token and cost exhaustion
  • Resource exhaustion
  • Hallucinated packages and slopsquatting
  • Rate limits and cost guards
PART IV

Attacking the Agent

CHAPTER 19

The Agent Threat Model and Excessive Agency

Defines what changes when a model can act and how permissions, tools, and blast radius reshape the threat model.

KEY TOPICS
  • Agent threat modeling
  • Tools and permissions
  • Excessive agency
  • Confused deputy and minimum agency
CHAPTER 20

Tool-Call and Function-Calling Abuse

Examines parameter injection, argument smuggling, chained tool calls, unintended actions, and validation gates.

KEY TOPICS
  • Function-calling mechanics
  • Parameter injection
  • Call chaining
  • Dangerous-call gating
CHAPTER 21

MCP Server Security

Covers the expanded surface introduced by MCP, including tool poisoning, server impersonation, shadowing, composition, and auth-flow auditing.

KEY TOPICS
  • MCP attack surface
  • Tool poisoning
  • Server impersonation and rug pulls
  • Auditing MCP servers and auth flows
CHAPTER 22

Multi-Agent Exploitation

Shows how trust, hand-off, privilege, and message-passing failures can cascade across agent networks.

KEY TOPICS
  • Orchestration and hand-offs
  • Agent-to-agent prompt injection
  • Privilege escalation across agents
  • Cascading failures
CHAPTER 23

Memory Poisoning and Persistence

Explores long-term agent memory, persistent injection, shared-memory poisoning, and durable footholds in agent state.

KEY TOPICS
  • Long-term memory
  • Cross-session persistence
  • Shared and cross-user memory
  • Memory defenses
CHAPTER 24

Browser and Computer-Use Agents

Examines agents that navigate and act through browsers and computers, including indirect injection, visual and DOM-based paths, and lateral impact.

KEY TOPICS
  • Real browser/computer actions
  • Web-page indirect injection
  • Exfiltration and transactions
  • Visual and DOM-based injection
CHAPTER 25

Attacking AI Coding Assistants

Applies prompt-injection thinking to code, repositories, configuration files, development workflows, and known coding-assistant vulnerabilities.

KEY TOPICS
  • Code and repository injection
  • Agent-side RCE paths
  • Context poisoning and backdoors
  • Real CVEs and defenses
PART V

Automation and Scale

CHAPTER 26

The Tooling Landscape

Compares offensive AI-security tooling and explains how to match tools to targets and bug classes without blindly trusting automation.

KEY TOPICS
  • Garak, PyRIT, Promptfoo and DeepTeam
  • Tool-to-target matching
  • Limits of open tools
  • Interpreting automated results
CHAPTER 27

Building Your Own Attack Harness

Builds a reusable harness around payload libraries, scoring, triage, recon, and model fingerprinting.

KEY TOPICS
  • Harness architecture
  • Payload and attack libraries
  • Scoring and triage
  • Recon and fingerprinting
CHAPTER 28

Fuzzing and Attacking at Scale

Covers mutation and generation strategies, self-generating attacks, success detection, and campaigns across many targets.

KEY TOPICS
  • Mutation strategies
  • Model-generated attacks
  • Automatic success detection
  • Multi-target campaigns
CHAPTER 29

Wiring AI Security into CI/CD

Turns an attack harness into a release control with regression suites, severity thresholds, and actionable reports.

KEY TOPICS
  • Release gates
  • Regression suites
  • Severity thresholds
  • Reports teams can act on
PART VI

Defending What You Just Broke

CHAPTER 30

Input, Output, and Prompt Defenses

Translates attack findings into practical defenses across input handling, output encoding, guardrails, and defense in depth.

KEY TOPICS
  • Realistic input handling
  • Output encoding
  • Guardrail models and prompt shields
  • Request-path defense in depth
CHAPTER 31

Securing Agents, Tools, and MCP

Applies least privilege, sandboxing, egress control, oversight, and supply-chain controls to agentic systems.

KEY TOPICS
  • Least-privilege agency
  • Tool gating and sandboxing
  • MCP and tool supply chains
  • Multi-agent trust boundaries
CHAPTER 32

Detection, Monitoring, and Compliance

Connects live-agent monitoring and incident response with established security and governance frameworks.

KEY TOPICS
  • Detection signals
  • Incident response for agents
  • OWASP, NIST AI RMF and EU AI Act mapping
  • Security-first compliance
PART VII

Getting Paid

CHAPTER 33

Where the AI Bounties Are

Shows how to find AI-covered programs, read scope, and choose targets by payout and competition.

KEY TOPICS
  • AI bug-bounty scope
  • Programs and vendors
  • Payout vs. competition
  • Programs worth watching
CHAPTER 34

Writing the Report That Gets Accepted

Builds a practical AI vulnerability report around impact evidence, reproducibility, and productive triage conversations.

KEY TOPICS
  • Report anatomy
  • Proving impact
  • Probabilistic reproduction
  • Working with triage teams
CHAPTER 35

Scoring Bugs That Are Not Always Reproducible

Adapts risk scoring to probabilistic findings and maps AI bugs to established security frameworks and business risk.

KEY TOPICS
  • CVSS for probabilistic bugs
  • OWASP LLM Top 10 and ATLAS
  • Communicating risk
  • Building the business case
CHAPTER 36

From Skill to Business

Looks at productizing AI-security testing, positioning, SaaS differentiation, and building a durable security business asset.

KEY TOPICS
  • Productizing AI security testing
  • SaaS moat
  • Professional positioning
  • Building a durable asset
APPENDICES

Field references

APPENDIX A

The AI Hunter’s Checklist

A phase-by-phase checklist from scope and recon through impact proof, scoring, and reporting.

KEY TOPICS
  • Scope and recon
  • Model and prompt layers
  • Data, tools and agent layers
  • Escalation, scoring and reporting
APPENDIX B

Payload Library

A structured payload reference covering benign canaries through model, prompt, retrieval, tools, agent, extraction, and supply-chain testing.

KEY TOPICS
  • Benign canary set
  • Model and prompt payloads
  • Data and retrieval payloads
  • Tools, agents and harness-ready records
APPENDIX C

OWASP LLM Top 10 (2025) Mapping

Maps the book’s bug classes and chapters to the 2025 OWASP LLM Top 10 categories.

KEY TOPICS
  • 2025 categories
  • Category-to-chapter index
  • Per-chapter mapping
APPENDIX D

MITRE ATLAS Mapping

Maps bug classes to MITRE ATLAS techniques and explains how to use the mapping.

KEY TOPICS
  • Bug-class to ATLAS technique
  • Notes on use
APPENDIX E

Tool Quick Reference

A compact reference for offensive scanners, harnesses, guardrails, runtime defenses, MCP, and agent hardening.

KEY TOPICS
  • Offensive tools
  • Guardrails and runtime defenses
  • MCP and agent hardening
APPENDIX F

Vulnerable Practice Targets and Resources

A practical index of hosted challenges, deliberately vulnerable applications, the Chapter 3 lab, and agent targets.

KEY TOPICS
  • Hosted challenges
  • Deliberately vulnerable apps
  • Chapter 3 lab
  • Part IV agent targets
APPENDIX G

Glossary

A quick-reference glossary for the terms used throughout the book.

KEY TOPICS
  • AI security terminology
  • LLM and agent terminology
  • Testing and vulnerability terminology

Start with the attack surface

Choose a chapter. Then go deeper.

Read the free sample, explore the security topics, or get the complete handbook on Amazon.