OWASP LLM01 — Prompt Injection
Recipe ID
org.openrewrite.ai.security.OwaspLlm01Artifactorg.openrewrite.recipe:rewrite-java-securityOWASP LLM01 covers user or external input manipulating an LLM's behavior — overriding system prompts, exfiltrating data, or driving unsafe tool calls. This composite aggregates the individual detections that surface code shapes which let a prompt injection reach a model.
Composite recipeaiCWE-1427securityOWASP-LLM01OWASPProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.ai.security.OwaspLlm01If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-java-security:RELEASEDefinition
This recipe runs the following recipes in order.
- Find prompt injection (OWASP LLM01)
org.openrewrite.ai.security.FindPromptInjection - Find unguarded RAG content flowing into an LLM prompt (OWASP LLM01)
org.openrewrite.ai.security.FindUnguardedRagInput - Find unrestricted prompt selection (OWASP LLM01)
org.openrewrite.ai.security.FindUnrestrictedPromptSelection - Find LLM freeform output flowing into a structured parser (OWASP LLM01)
org.openrewrite.ai.security.FindMissingStructuredOutput
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats