Skip to content
ai-supply.store
DiscoverCategoriesLeaderboardsCommunityAgent APIFAQ
Sign inSign up free
catalog / Language & NLP / Prompt Engineering Guide
❝PromptLanguage & NLPFree

Prompt Engineering Guide

MIT-licensed comprehensive guide and prompt library — techniques, examples, and templates for every major LLM prompting method.

@ai-supply
Installs192k
⟳ upstream main@5767372 · updated 4mo ago
↗ Source repository
← More Language & NLPLanguage & NLP leaderboard →How we grade security →Source ↗
! Grade B · 75/100 · ReviewSecurity assessment
✓No compromise signals23capabilities surfaced1known CVE8of 20 OWASP controls clear
Suspicious network referencesSuspicious network referencesSuspicious network referencesSuspicious code patterns
scanned 16d ago·osv · gitleaks · opengrep · picklescan + heuristics·full breakdown in the Security tab ↓

Prompt Engineering Guide

The Prompt Engineering Guide by DAIR.AI is the most comprehensive open-source reference for LLM prompting — covering zero-shot, few-shot, chain-of-thought, ReAct, tree-of-thought, self-consistency, generated knowledge, and more. It includes model-specific guidance, prompt templates, research paper summaries, and a growing library of community-contributed examples.

Key features

  • Complete technique coverage: zero-shot, few-shot, CoT, ReAct, PAL, tree-of-thought, RAG prompting
  • Model-specific notes for GPT-4, Claude, Gemini, Mistral, Llama, and others
  • Prompt templates for code generation, summarization, classification, extraction
  • Research-backed: cites and explains 100+ prompting papers
  • Available as a website, PDF, and raw Markdown
  • MIT license — copy, adapt, integrate commercially
  • Available in 13 languages

Key prompt patterns

# Chain-of-Thought (CoT) — few-shot example
Q: Roger has 5 tennis balls. He buys 2 more cans, each with 3 balls. How many?
A: Roger started with 5 balls. 2 cans × 3 balls = 6 more. 5 + 6 = 11. The answer is 11.

Q: The cafeteria had 23 apples. They used 20 for lunch and bought 6 more. How many?
A: [Let the model reason step-by-step here]
# ReAct pattern
Thought: I need to find the current population of Tokyo.
Action: Search[Tokyo population 2024]
Observation: Tokyo's population is approximately 13.96 million.
Thought: I have the answer.
Answer: Tokyo's population is approximately 13.96 million.

Install via ai-supply

npx ai-supply add prompt-engineering-guide

Curated mirror of the open-source Prompt Engineering Guide (MIT). Get it from the source.

Rating rank
#1
of 30 in Language & NLP
Install rank
#8
of 30 in Language & NLP
Security score
75/100 · B
review
Security rank
#19
of 30 in Language & NLP
Installs
192k
cat avg 145k
This listing vs category average
Installs
this
cat avg
Security (of 100)
this
cat avg
Adoption trend
See the Language & NLP leaderboard →
! Security: Review · 7575/100 · grade Bscanned 16d ago
✓ no compromise signals24 risk-surface · 6/20 OWASP controls flagged

Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.

Prompt card · med confidence (static)
{secrets.CLAUDE_CODE_OAUTH_TOKEN}{name}{prompt}injection surface present⚠ jailbreak taxonomy present

Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).

OWASP Top 10 for LLM Applications
⚠LLM03Supply Chaincritical
Vulnerable/compromised dependencies, models or archives in the artifact.
•Vulnerable dependencies — 138 known vulnerabilities in: @babel/core@7.23.7, @babel/helpers@7.23.7, @babel/plugin-transform-modules-systemjs@7.23.3, @babel/runtime@7.23.7, cross-spawn@5.1.0, diff@5.1.0, dompurify@3.0.6, estree-util-value-to-estree@1.3.0 (CWE-1395)known CVE · -25 pts
⚠LLM01Prompt Injectionhigh
Adversarial instructions embedded in an artifact that hijack a downstream LLM.
•Prompt-injection phrasing — instruction-subversion language detected · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/course.ar.mdx (CWE-77)expected
⚠LLM05Improper Output Handlingmedium
Code that pipes model/user output into shell, eval, SQL or paths unsafely.
•Suspicious code patterns — dynamic code execution · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/techniques/pal.ar.mdx (CWE-95)risk surface
§LLM09MisinformationGovernance
Artifacts designed to produce false/deceptive output.
Detectable only by runtime behavioral evaluation; addressed via responsible-use attestation.
◷LLM10Unbounded ConsumptionRuntime-enforced
Unbounded loops/recursion causing DoS or runaway cost.
Enforced at runtime by the gateway (rate limits + spend caps + size caps); static check flags unbounded loops.
✓LLM02Sensitive Information DisclosurePassed
✓LLM04Data and Model PoisoningPassed
Backdoors/poisoning in training data or serialized models.
Behavioral poisoning needs model execution; static check covers unsafe serialization + dataset skew only.
✓LLM06Excessive AgencyPassed
✓LLM07System Prompt LeakagePassed
✓LLM08Vector and Embedding WeaknessesPassed
PII or plaintext source leakage in embedding/vector exports.
Embedding inversion/poisoning is largely runtime; static check covers PII in vector exports.
OWASP Machine Learning Security Top 10
⚠ML06AI Supply Chaincritical
Compromised PyPI/npm packages, typosquats, unsafe serialized models.
•Vulnerable dependencies — 138 known vulnerabilities in: @babel/core@7.23.7, @babel/helpers@7.23.7, @babel/plugin-transform-modules-systemjs@7.23.3, @babel/runtime@7.23.7, cross-spawn@5.1.0, diff@5.1.0, dompurify@3.0.6, estree-util-value-to-estree@1.3.0 (CWE-1395)known CVE · -25 pts
⚠ML02Data Poisoninghigh
Poisoned training datasets with triggers or anomalous distributions.
Static check covers trigger phrasing, PII and label skew; full poisoning detection is runtime.
•Prompt-injection phrasing — instruction-subversion language detected · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/course.ar.mdx (CWE-77)expected
⚠ML09Output Integritymedium
Middleware tampering with model outputs in transit.
Gateway enforces TLS + response integrity; static check flags output-rewriting code.
•Suspicious code patterns — dynamic code execution · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/techniques/pal.ar.mdx (CWE-95)risk surface
§ML01Input Manipulation (Adversarial)Governance
Models vulnerable to adversarial perturbations.
Requires runtime robustness evaluation; addressed via publisher robustness attestation.
§ML03Model InversionGovernance
Training data reconstructable from a model's outputs.
Runtime/evaluation property; addressed via model-card data-provenance + DP attestation.
§ML04Membership InferenceGovernance
Determining whether a record was in the training set.
Runtime/evaluation property; addressed via overfitting disclosure + DP attestation.
§ML08Model SkewingGovernance
Models trained on skewed data producing biased output.
Requires fairness evaluation; addressed via model-card bias/limitations disclosure.
✓ML05Model TheftPassed
Unlicensed re-distribution / license-incompatible derivatives.
Static check verifies license declaration; extraction throttling is runtime.
✓ML07Transfer Learning AttackPassed
Backdoored base models / LoRA adapters propagating to derivatives.
Backdoor detection needs behavioral probing; static check covers unsafe serialization + provenance.
✓ML10Model Poisoning (Weights)Passed
Tampered model weight files; integrity must be verifiable.
Static check enforces safe formats + records a content hash for downstream verification.
Other findings (24) · hygiene / uncategorized
•Unrecognized file type — '.gitignore' is not on the allowlist · dair-ai-Prompt-Engineering-Guide-5767372/.gitignorerisk surface
•Unrecognized file type — '.cff' is not on the allowlist · dair-ai-Prompt-Engineering-Guide-5767372/CITATION.cffrisk surface
•Unrecognized file type — '.mdx' is not on the allowlist · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/about.ar.mdxrisk surface
•Suspicious network references — suspicious TLD (12 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/models/code-llama.ar.mdxrisk surface
•Suspicious network references — suspicious TLD (171 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/models/collection.ar.mdxrisk surface
•Suspicious network references — suspicious TLD (120 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/readings.ar.mdxrisk surface
•Suspicious network references — suspicious TLD (63 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/ar-pages/tools.ar.mdxrisk surface
•Suspicious network references — suspicious TLD (9 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/notebooks/pe-code-llama.ipynbrisk surface
•Suspicious network references — suspicious TLD (114 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/models/collection.ru.mdxrisk surface
•Suspicious network references — suspicious TLD (115 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/readings.ca.mdxrisk surface
•Suspicious network references — suspicious TLD (117 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/readings.fi.mdxrisk surface
•Suspicious network references — suspicious TLD (111 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/readings.it.mdxrisk surface
•Suspicious network references — suspicious TLD (96 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/readings.jp.mdxrisk surface
•Suspicious network references — suspicious TLD (110 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/readings.pt.mdxrisk surface
•Suspicious network references — suspicious TLD (119 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/readings.tr.mdxrisk surface
•Suspicious network references — suspicious TLD (103 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/readings.zh.mdxrisk surface
•Suspicious network references — suspicious TLD (45 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.ca.mdxrisk surface
•Suspicious network references — suspicious TLD (64 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.en.mdxrisk surface
•Suspicious network references — suspicious TLD (43 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.es.mdxrisk surface
•Suspicious network references — suspicious TLD (46 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.fi.mdxrisk surface
•Suspicious network references — suspicious TLD (44 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.fr.mdxrisk surface
•Suspicious network references — suspicious TLD (42 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.jp.mdxrisk surface
•Suspicious network references — suspicious TLD (48 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.ru.mdxrisk surface
•Suspicious network references — suspicious TLD (56 URLs) · dair-ai-Prompt-Engineering-Guide-5767372/pages/tools.tr.mdxrisk surface
✔ verified source · pinned dair-ai-Prompt-Engineering-Guide-5767372
Check against a policy

The same gate an agent runs before installing (POST /api/v1/trust/prompt-engineering-guide/check). Click a policy:

Consume Prompt Engineering Guide programmatically. Authenticate with an API key or session — see Authorize an agent.

# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/prompt-engineering-guide

# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/prompt-engineering-guide/check \
  -H "Content-Type: application/json" \
  -d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'

# CLI
npx ai-supply add prompt-engineering-guide

# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/prompt-engineering-guide/install \
  -H "Authorization: Bearer $AIM_KEY"

# MCP tool
install_listing({ "slug": "prompt-engineering-guide" })
OpenAPI spec →
vlatest
! Security: Review · 751mo ago

Curated mirror — latest upstream source. See the repository for tagged releases.

Sign in and install this listing to leave a review.

More from @ai-supply

View profile →
◉Agent
MetaGPT
Multi-agent framework that assigns GPT roles (PM, engineer, QA) to solve complex software tasks end-to-end.
↓ 1.0M
⇄Connector
vLLM
High-throughput, memory-efficient LLM inference engine with PagedAttention and continuous batching.
↓ 892k
⇄Connector
Meilisearch
Lightning-fast open-source search engine with typo-tolerance, semantic hybrid search, and sub-50ms response times.
↓ 811k
△Eval
Weights & Biases (wandb)
ML experiment tracking and visualization — log metrics, hyperparameters, models, and media in real time.
↓ 784k
ai-supply.store

Free, security-vetted AI capabilities — skills, MCPs, plugins, agents, datasets and more, each graded and freshness-tracked, and built for humans and agents alike.

api · v3.1status · all green
Contact
support@ai-supply.storesecurity@ai-supply.store
Catalog
  • Discover
  • Categories
  • Leaderboards
  • Benchmarks
  • Security
  • Scan a repo
Community
  • Community
  • FAQ
For agents
  • Quickstart (60s)
  • Authorize an agent
  • Agent API
  • OpenAPI spec
For builders
  • Publish
  • Dashboard
Account
  • Create account
  • Sign in
  • Settings
Legal
  • Terms
  • Publisher Agreement
  • Acceptable Use
  • Privacy