Skip to content

User text placed inside the AI's system instructions

Partialhigh severity · reads .ts .tsx .js .jsx .mjs .cjs .pyBeta

Text in the system prompt is treated as the app's own instructions. If user text goes there, a user can rewrite the rules the AI follows (prompt injection). Marked Partial: the inserted value may be safe text your app controls. When Lintsure finds this, it marks it as Partial: it may be fine, depending on context only you can confirm.

What it looks like

A line Lintsure flags in its own test app:

// src/llm.ts
const messages = [{ role: "system", content: `You are a helper for ${req.body.company}` }];

How to fix it

Keep the system prompt fixed. Send what the user typed as a separate user message, and never put it inside the system instructions.

Through a coding agent, Lintsure suggests the change and waits. Nothing is edited until you approve it.

Controls it relates to

What the framework asks

OWASP LLM Top 10 LLM01:2026: Prompt Injection

User text, web pages or files can carry instructions that change what the model does. Keep instructions and user content apart, and limit what the model can do.

Evidence a reviewer may ask for: How prompts are built, and tests with hostile input.

OWASP LLM Top 10 LLM08:2026: Hidden Context Exposure

Assume users can read anything in the model's context: system prompt, retrieved documents, tool results and memory. Don't put secrets or access rules there, and don't mix user text into instructions.

Evidence a reviewer may ask for: System prompts and other context sources reviewed for secrets and access logic.

Summaries are our own reading of the public texts, not the official wording.

Read more: How to reduce prompt injection risk in your AI app

Check your code for this

Runs on your machine. Your code is never uploaded.

npx lintsure scan

Quickstart · Use it in Claude Code or Cursor

This rule is in Beta: its mapping to framework controls is our own reading of the public texts, not independently reviewed. Lintsure is a readiness tool, not an audit or legal advice. A finding, or the lack of one, doesn't make you compliant. Disclaimer

We improve these rules all the time. If you see a false alarm, a missed problem or anything that could work better, tell us in a review and we will use it to improve your experience.

Related rules

Did this rule flag something that's fine, or miss a real problem? Tell us on GitHub. Every report becomes a test case, so the same mistake can't come back.