What You’ll Learn
- The five major categories of prompt injection attacks
- How to configure
InjectionDefenseConfigwith sensitivity levels and actions - The difference between
blockandlog_onlyactions - How Declaw’s proxy intercepts injection payloads at the network layer before they reach the upstream LLM API
Prerequisites
- Declaw running locally or in the cloud (see Deployment)
DECLAW_API_KEYandDECLAW_DOMAINset in your environment
This example is available in Python. TypeScript support coming soon.
Attack Categories
Code Walkthrough
Phase 1: Baseline (no injection defense)
Phase 2: With injection defense enabled
domains list names the egress hosts whose request bodies are scanned (here, the LLM API). An empty or unset domains list means no scanning happens, even with enabled=True.