prompt-injection

prompt-injection is a cursor rule for Cursor from davidmatousek/tachi. It costs 33 tokens per session (1,853 once invoked), scanned B, original, Apache-2.0.

A security rule set for detecting prompt injection in applications that use large language models, which are AI systems that generate or interpret text. It covers malicious instructions in user input, retrieved data, and other sources the model reads.

In plain words
What is it for?
It is for threat modeling chat systems, model APIs, prompt-handling services, and other processes that use language models. It checks for direct and indirect prompt injection, system-prompt extraction, jailbreaks, and cross-plugin injection.
Why use it?
It helps find ways an attacker could steer the model away from its intended behavior or bypass its safeguards. This includes direct attacks, hidden instructions in data, and jailbreak attempts.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is output_schema: ../../../schemas/finding.yaml.

Good fit It is for threat modeling chat systems, model APIs, prompt-handling services, and…

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/davidmatousek/tachi
agentmods
npx agentmods add rules/davidmatousek/tachi/prompt-injection

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prompt-injection

README.md
[![agentmods](https://agentmods.dev/badge/rules/davidmatousek/tachi/prompt-injection.svg)](https://agentmods.dev/rules/davidmatousek/tachi/prompt-injection)
Your own site
<a href="https://agentmods.dev/rules/davidmatousek/tachi/prompt-injection"><img src="https://agentmods.dev/badge/rules/davidmatousek/tachi/prompt-injection.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,853 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.01853
Opus 5 $0.00016 $0.00927
Sonnet 5 $0.00007 $0.00371
Haiku 4.5 $0.00003 $0.00185

Measured 3d ago against content hash a9326ec37a42, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

prompt-injection scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Instruction-override phrasingmediumPrompt injection

Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.

mitigation: "Implement rate limiting on prompt submissions per user session. Deploy a prompt classifier that flags known jailbreak patterns (role-play requests, 'ignore previous instructions' variants, DAN-style prompts)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

adapters/cursor/rules/prompt-injection.mdc · 164 lines

How it starts

The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Metadata

category: llm
threat_class: LLM
dfd_targets: [Process]
owasp_references: [OWASP LLM01:2026, OWASP LLM08:2026]
output_schema: ../../../schemas/finding.yaml

Prompt Injection Threat Agent

Purpose

Detects prompt injection vulnerabilities in LLM-integrated components. Prompt injection is the most prevalent and highest-impact threat class for LLM applications: an attacker manipulates model behavior by embedding adversarial instructions in user input, retrieved context, or upstream data sources. This agent identifies direct injection (user-supplied malicious prompts), indirect injection (adversarial payloads embedded in data the model consumes), and jailbreaking (systematic attempts to override model safety constraints).

Detection Scope

Trigger Keywords

This agent activates when a DFD element name or description matches any of the following patterns (case-insensitive):

  • LLM
  • model
  • GPT
  • Claude
  • language model
  • completion
  • chat
  • inference
  • prompt
  • generative AI

Applicable DFD Element Types

  • Process: Any process node that invokes, wraps, or orchestrates an LLM. This includes API gateway processes that forward prompts, orchestration layers that compose multi-step LLM calls, and application logic that interpolates user input into prompt templates.

Detection Patterns

  1. Direct Prompt Injection: User-facing input fields whose contents are concatenated into LLM prompts without sanitization, boundary enforcement, or input classification. Look for:

    • Chat interfaces that pass raw user text to model APIs
    • Search bars or form fields whose values are interpolated into system prompts
    • API endpoints that accept freeform text and forward it to LLM completions
    • Absence of input validation or prompt boundary markers between system instructions and user content
  2. Indirect Prompt Injection: Data flows where external or semi-trusted content is retrieved and injected into the model context window. Look for:

    • RAG pipelines that retrieve documents from user-contributed or web-scraped sources
    • Email or message processing where attacker-controlled content enters the prompt
    • Database records, CMS content, or API responses that are embedded in LLM context
    • Tool outputs that are fed back into the model without sanitization

Read the full file on GitHub · 164 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 164 lines · 33 tokens per session scan B a9326ec37a42

Subscribe to this mod's changes

prompt-injection is a cursor rule published in the GitHub repository davidmatousek/tachi (90 stars, last pushed 25d ago), licensed Apache-2.0. It adds 33 tokens to every session and 1,853 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (instruction-override phrasing). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.