Find prompt injection (OWASP LLM01)

Proprietary

Find HTTP request data that flows into an LLM prompt without intermediate validation. Sources are servlet request accessors (getParameter, getHeader, getReader, getInputStream), Spring WebRequest accessors, and Spring MVC handler parameters bound with @RequestParam, @PathVariable, @RequestHeader, @RequestBody, @RequestPart, @CookieValue, or @MatrixVariable; sinks are the message-content methods of the OpenAI, Anthropic, Azure AI Inference, LangChain4j, and Spring AI Java SDKs. A hit means the untrusted string reaches the model text without leaving the method and warrants a guardrail (allowlist, structured input, or provider-side guardrail).

org.openrewrite.ai.security.FindPromptInjection
mod run . --recipe=org.openrewrite.ai.security.FindPromptInjection

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.