Why Do You Need to Define Extractions?
Defining extractions ensures that our policies run accurately on the correct parts of your prompts or responses. For example, if we want to detect prompt injection, we need to check the user’s question part, not the system prompt. Without this distinction, there could be false positives.How and Why Do We Use Extractions?
The logic behind extractions is straightforward. Aporia checks the last message received:- If it matches an extraction, we run the policy on this part.
- If it doesn’t match, we move to the previous message and so on.