Skip to content

Rules Overview

PromptLint ships 20 rules covering security, cost, structure, and quality. Every rule can be individually enabled, disabled, or have its severity overridden.

All Rules

RuleSeverityAuto-FixCategory
costINFO💰 Cost
cost-limitCRITICAL💰 Cost
prompt-injectionCRITICAL🔒 Security
jailbreak-patternCRITICAL🔒 Security
secret-in-promptCRITICAL🔒 Security
pii-in-promptCRITICAL🔒 Security
context-injection-boundaryCRITICAL🔒 Security
structure-sectionsWARN🏗️ Structure
role-clarityWARN🏗️ Structure
output-format-missingWARN🏗️ Structure
hallucination-riskWARN🏗️ Structure
clarity-vague-termsWARN✨ Quality
specificity-examplesINFO🎯 Specificity
specificity-constraintsINFO🎯 Specificity
politeness-bloatWARN📝 Verbosity
verbosity-redundancyINFO📝 Verbosity
verbosity-sentence-lengthINFO📝 Verbosity
actionability-weak-verbsINFO💪 Actionability
consistency-terminologyINFO🔄 Consistency
completeness-edge-casesINFO✅ Completeness

By Category

🔒 Security

The five security rules fire at CRITICAL severity by default. They should never be disabled in production pipelines.

RuleWhat it catches
prompt-injectionClassic injection phrases like "ignore previous instructions"
jailbreak-patternJailbreak attempts like "DAN mode", roleplay overrides, persona hijacking
secret-in-promptAPI keys, passwords, connection strings, tokens
pii-in-promptEmail addresses, phone numbers, SSNs, credit card numbers
context-injection-boundaryUser-injected content without a trust boundary marker

💰 Cost & Tokens

RuleWhat it catches
costToken count and projected cost (INFO, always informational)
cost-limitPrompt exceeds configured token_limit

🏗️ Structure

RuleWhat it catches
structure-sectionsNo task / context / output sections detected
role-clarityNo role or persona defined for the model
output-format-missingNo output format specification
hallucination-riskPatterns that increase hallucination likelihood

✨ Quality

RuleWhat it catches
clarity-vague-termsVague words: "good", "efficient", "things", "various", "proper"
specificity-examplesNo examples / few-shot demonstrations provided
specificity-constraintsNo constraints on what the model should NOT do
politeness-bloatUnnecessary politeness tokens ("please", "kindly", "thank you")
verbosity-redundancyRedundant phrases ("in order to", "as well as")
verbosity-sentence-lengthSentences over 40 words
actionability-weak-verbsPassive voice and weak verbs ("be done", "be written")
consistency-terminologySame concept referred to by multiple names
completeness-edge-casesNo edge case handling defined

Severity Levels

SeverityDefault exit codeMeaning
CRITICAL2Security or hard constraint violation — must fix
WARN1Structural or quality issue — should fix
INFO0Optimization suggestion — consider fixing

Override exit code threshold with --fail-level:

bash
promptlint --file prompt.txt --fail-level warn  # exit 1 on any WARN or above
promptlint --file prompt.txt --fail-level info  # exit 1 on any finding

Disabling Rules

yaml
# .promptlintrc
rules:
  completeness_edge_cases: false
  actionability_weak_verbs: false

Released under the Apache 2.0 License.