Cap LangChain4j / OpenAI output-token limits (OWASP LLM10)
ProprietaryReduce explicit limits above the selected maximum in LangChain4j OpenAI chat and streaming model builders and their Spring Boot configuration properties. Smaller, dynamic, missing, and nonpositive limits are preserved. Lower budgets can truncate output or conflict with provider minimums.
org. openrewrite. ai. security. LimitLangChain4jOpenAiOutputTokensRequired
A positive, application-selected ceiling for explicit output-token limits. Larger literal limits are reduced to this value. Smaller limits are preserved. Choose a budget appropriate for the model and workload: reducing it can truncate responses, reasoning, structured output, or tool calls.
mod run . --recipe= org. openrewrite. ai. security. LimitLangChain4jOpenAiOutputTokens \
-P maximumTokens=4096Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.