Download engine/harm/attack_vectors.py from jash-ai/divya: direct link, hf CLI and curl.
- Browser
- Download file 328 Bytes
-
https://huggingface.co/spaces/jash-ai/divya/resolve/main/engine/harm/attack_vectors.py
- Command line
-
hf download hf://spaces/jash-ai/divya/engine/harm/attack_vectors.py
-
curl -L -o attack_vectors.py https://huggingface.co/spaces/jash-ai/divya/resolve/main/engine/harm/attack_vectors.py
328 Bytes
| def detect_attack_vectors(q): | |
| q=q.lower() | |
| return { | |
| "prompt_injection": "ignore previous" in q or "bypass" in q, | |
| "self_harm": "kill myself" in q or "suicide" in q, | |
| "violence": "kill" in q or "bomb" in q, | |
| "illegal": "hack" in q or "fraud" in q, | |
| "medical": "prescription" in q | |
| } | |