Terminal DiLLMa: LLM-powered Apps Can Hijack Your Terminal Via Prompt Injection
Brief
Last week Leon Derczynski described how LLMs can output ANSI escape codes. These codes, also known as control characters, are interpreted by terminal emulators and modify behavior.
This discovery resonates with areas I had been exploring, so I took some time to apply, and build upon, these newly uncovered insights.
ANSI Terminal Emulator Escape Codes
Here is a simple example that shows how to render blinking, colorful text using control characters.
