feat: Add new visual diagrams and their generation scripts, integrating them into relevant handbook chapters.

This commit is contained in:
shiva108
2025-12-07 14:46:10 +01:00
parent ae1a47da9d
commit 7aa777b98e
33 changed files with 573 additions and 71 deletions
@@ -30,6 +30,8 @@ When we attack an "AI," we are rarely attacking a single file. We are attacking
| **Orchestrator/Agent** | The logic loop deciding to call tools. | Infinite loops, excessive agency, prompt injection propagation. |
| **Vector Database (RAG)** | Long-term memory storage. | Search result poisoning, indirect prompt injection. |
![AI Anatomy Block Diagram](assets/rec9_ai_anatomy.svg)
## 9.2 The Transformer: A Hacker's Perspective
At its core, almost all modern LLMs are **Transformers**. A Transformer is a probabilistic engine that predicts the next token in a sequence based on the `attention` it pays to previous tokens.
@@ -95,9 +97,10 @@ Understanding the flow of a single prompt helps you pinpoint where to inject.
- The model processes the huge vector of numbers.
- _Attack:_ **Sponge Attacks**. Specific input sequences can trigger worst-case computational complexity in the attention layers, causing high energy consumption or latency spikes.
3. **Output Post-processing**:
- The raw output is filtered for toxicity.
- _Attack:_ **Obfuscation**. If the output filter catches "bomb", generating "b-o-m-b" might bypass it.
![Inference Pipeline Diagram](assets/rec10_inference_pipeline.svg)
## 9.5 Practical Inspection: Loading a Model
For White Box Red Teaming (e.g., testing an open-source model your company is deploying), load the model to inspect its architecture configuration.