cai/tools
Víctor Mayoral Vilches d1b42233e6
Prompt injection mitigation (#249)
* Reproduce prompt injection flaw in CAI

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Mitigate prompt injection

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Add a second PoC, refactor and propose a message when guardrails are triggered

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Add CAI_GUARDRAILS and 2 additional PoCs

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Mitigate PoC 3

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Mitigate PoC 4

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Add and mitigate PoCs 5 and 6

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Add PoCs 7 to 10

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Test and mitigate PoCs 7 to 10

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Add PoCs 11 to 14

Inspired by 'Embrade The Red' research and also by 'The Month of AI bugs'

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

* Mitigate PoCs 11 to 14

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

---------

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-08-28 20:25:24 +02:00
..
templates Remove unused command 2025-06-05 19:40:42 +02:00
__init__.py Add cai-replay 2025-05-09 17:03:48 +02:00
asciinema.py Add asciinema tool, fix outstanding issues with f-strings 2025-05-28 11:48:19 +02:00
case_study_generator.py Merge branch 'use_case_agent' into 'main' 2025-06-04 12:39:27 +00:00
claude.bash Prompt injection mitigation (#249) 2025-08-28 20:25:24 +02:00
gif.py Fix bug with cai-replay, add cai-gif 2025-05-28 12:11:07 +02:00
logs.py Revert "Apply code formatting with make format" 2025-06-14 09:51:19 +00:00
replay.py Replay fixes (#201) 2025-06-19 10:56:19 +02:00