Find sensitive data in LLM prompts (OWASP LLM02)

Proprietary

Find method parameters and getter or record accessor calls whose names mark them as sensitive (passwords, API keys, tokens, social security numbers, payment card numbers, and so on) flowing into an LLM prompt through the OpenAI, Anthropic, Azure AI Inference, LangChain4j, or Spring AI Java SDKs. Data sent to a hosted model leaves the application's trust boundary, can be retained by the provider, and can be echoed back to other users. Remove or mask the value before it reaches the prompt; a call to a method whose name starts with mask, redact, anonymize, tokenize, encrypt, or a similar verb is treated as doing so.

org.openrewrite.ai.security.FindSensitiveDataInPrompt

Optional

Names of sensitive concepts, matched against the words of parameter and method names: password matches userPassword and passwordHash but not passwordPolicy. Defaults to common credential, government identifier, and payment card names. Separate values with commas.

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

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