AI Coding Assistant Successfully Resists Fabricated Prompt Injection Attack
A developer using the opencode AI coding assistant shared an instance where the LLM successfully identified and resisted a fabricated system-reminder designed as a prompt injection attack. The model correctly recognized the malicious instruction to invoke a nonexistent skill as an injected artifact and chose to ignore it. This incident highlights both the real-world security vulnerabilities inherent in agentic AI systems and the growing robustness of modern LLMs against indirect prompt injections. As developers increasingly rely on AI coding tools that interact with external data and environments, robust built-in safety mechanisms become critical. The injected prompt claimed a session was idle and commanded the LLM to immediately invoke a bogus skill called 'reminder idel-skills'. However, the model analyzed the context, flagged it as an unauthorized instruction, and continued its original task without exposing sensitive behavior or executing the malicious command.
## BACKGROUND
Prompt injection is a security vulnerability where attackers manipulate the input of a large language model to bypass its safety filters or execute unintended instructions. Agentic coding tools like opencode often parse external web content, files, or tool outputs, making them prime targets for indirect prompt injection vectors.