Skip to content
Esc

@noctcore/eslint-plugin-llm

v0.1.31 rules1 recommended0 opt-innamespace noctcore-llm

A bad fit if you call models through your own wrapper everywhere, because the rule recognises the SDKs' own response shapes and will not see through the wrapper.

LLM output treated as untrusted input: model text kept out of eval, shells, raw SQL, HTML, fetch origins and fs paths.

A model writes what its prompt steers it toward, and the prompt carries the user’s message, retrieved documents and tool results along with your instructions. A prompt injection in any of them comes back out as model output. Sent to innerHTML it is XSS, to exec it is code execution, to $queryRawUnsafe it is SQL injection. This is OWASP LLM05, Improper Output Handling.

It will yell at you about the result of an OpenAI, Anthropic or Vercel AI SDK call reaching a dangerous sink in the same function, with nothing in between that validates or sanitizes it. It follows const bindings and destructuring, not function calls, so it stays silent whenever the chain is not visible in the source. It is a bad fit if you call models through your own wrapper everywhere, because the rule recognises the SDKs’ own response shapes and will not see through the wrapper.

Install
npm install --save-dev @noctcore/eslint-plugin-llm @typescript-eslint/parser
# or: bun add -D / pnpm add -D @noctcore/eslint-plugin-llm @typescript-eslint/parser

The recommended preset enables 1 of 1 rule. The rules board below builds the flat config: start from a preset, switch single rules between error and off, and copy the result.

Each rule links to its page, with the options it takes and Incorrect and Correct examples. Start with no-llm-output-to-sink.

1 of 1 at error

--fixsuggestionsneeds optionstype infoEach switch sets a rule to error or off.

no-llm-output-to-sink
Text an LLM SDK call returned must not reach eval, a shell, raw SQL, HTML injection, a fetch origin or an fs path in the same function without being validated or sanitized first.
recommended