Skip to content
ai-supply.store
DiscoverCategoriesLeaderboardsCommunityAgent APIFAQ
Sign inSign up free
catalog / Agentic capability / DSPy
◆SkillAgentic capabilityFree

DSPy

Stanford's framework for programming — not prompting — LLMs: compile, optimize, and auto-tune modular AI systems.

@ai-supply
Installs103k
⟳ upstream 3.2.1 · updated 2mo ago
↗ Source repository
← More Agentic capabilityAgentic capability leaderboard →How we grade security →Source ↗
! Grade B · 75/100 · ReviewSecurity assessment
✓No compromise signals34capabilities surfaced1known CVE6of 20 OWASP controls clear
Suspicious network referencesSuspicious network referencesSuspicious network referencesSuspicious network references
scanned 16d ago·osv · gitleaks · opengrep · picklescan + heuristics·full breakdown in the Security tab ↓

DSPy

DSPy (Declarative Self-improving Python) is Stanford NLP's framework for algorithmically optimizing LLM prompts and weights. Instead of hand-crafting prompts, you write Python modules with typed signatures; DSPy's optimizers ("teleprompters") automatically generate, evaluate, and refine the best prompts for your task and model.

Key Features

  • Signatures — declare input/output fields with descriptions; DSPy handles prompt construction
  • Modules — dspy.Predict, dspy.ChainOfThought, dspy.ReAct, dspy.ProgramOfThought, and more
  • Optimizers — BootstrapFewShot, MIPRO, BayesianSignatureOptimizer auto-tune prompts with labeled examples
  • Assertions — declare constraints and DSPy retries until they're satisfied
  • Model-agnostic — works with OpenAI, Anthropic, Ollama, HuggingFace, Databricks, and 20+ providers
  • Composable — nest modules into complex multi-stage pipelines that optimize end-to-end

Quick Start

pip install dspy
import dspy

lm = dspy.LM("openai/gpt-4o-mini")
dspy.configure(lm=lm)

class QA(dspy.Signature):
    question: str = dspy.InputField()
    answer: str = dspy.OutputField(desc="concise factual answer")

predict = dspy.Predict(QA)
result = predict(question="What year was Python created?")
print(result.answer)

Install via ai-supply

npx ai-supply add dspy-llm-programming

Curated mirror of the open-source DSPy project (MIT). Install upstream from the repository.

Rating rank
#1
of 35 in Agentic capability
Install rank
#18
of 35 in Agentic capability
Security score
75/100 · B
review
Security rank
#23
of 35 in Agentic capability
Installs
103k
cat avg 186k
This listing vs category average
Installs
this
cat avg
Security (of 100)
this
cat avg
Adoption trend
See the Agentic capability leaderboard →
! Security: Review · 7575/100 · grade Bscanned 16d ago
✓ no compromise signals35 risk-surface · 9/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.

What this capability can do · high confidence (static)
Tools (7)
fetch_flight_infofetch_itinerarypick_flightbook_itinerarycancel_itineraryget_user_infofile_ticket
⚑ filesystem⚑ shell⚑ network⚑ secrets
egress → semver.org, test.pypi.org, pypi.org, docs.github.com, docs.pypi.org, google.github.io, docs.astral.sh, docs.conda.io +32
30 scripts

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.
•Dependency manifest — 10 pip requirements declared · stanfordnlp-dspy-d97ba83/docs/requirements.txtrisk surface
•Non-registry dependency source — 1 requirement(s) from git/URL/editable · stanfordnlp-dspy-d97ba83/docs/requirements.txt (CWE-829)risk surface
•Vulnerable dependencies — 186 known vulnerabilities in: aiohttp@3.13.2, black@25.1.0, cryptography@43.0.3, cryptography@45.0.4, diskcache@5.6.3, fastapi-sso@0.16.0, filelock@3.18.0, idna@3.10 (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 · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/ai_text_game/index.md (CWE-77)expected
⚠LLM05Improper Output Handlinghigh
Code that pipes model/user output into shell, eval, SQL or paths unsafely.
•Suspicious code patterns — pipe-to-shell install · stanfordnlp-dspy-d97ba83/docs/docs/api/modules/RLM.md (CWE-494)expected
•Suspicious code patterns — dynamic code execution · stanfordnlp-dspy-d97ba83/docs/docs/learn/programming/tools.md (CWE-95)expected
•Suspicious code patterns — environment/secret exfiltration · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/llms_txt_generation/index.md (CWE-200)expected
•Suspicious code patterns — OS command execution · stanfordnlp-dspy-d97ba83/dspy/clients/lm_local.py (CWE-78)expected
•Suspicious code patterns — pipe-to-shell install; OS command execution · stanfordnlp-dspy-d97ba83/dspy/primitives/python_interpreter.py (CWE-494)expected
•Suspicious code patterns — pickle deserialization · stanfordnlp-dspy-d97ba83/tests/signatures/test_signature.py (CWE-502)expected
⚠LLM06Excessive Agencyhigh
Over-broad tool/permission surface or unrestricted egress.
•External endpoints declared — 4 distinct host(s) · stanfordnlp-dspy-d97ba83/.github/.internal_dspyai/internals/build-and-release.mdexpected
•External endpoints declared — 3 distinct host(s) · stanfordnlp-dspy-d97ba83/.github/.internal_dspyai/internals/release-checklist.mdexpected
•External endpoints declared — 2 distinct host(s) · stanfordnlp-dspy-d97ba83/.github/.internal_dspyai/pyproject.tomlexpected
•External endpoints declared — 1 distinct host(s) · stanfordnlp-dspy-d97ba83/.github/workflows/build_and_release.ymlexpected
•External endpoints declared — 5 distinct host(s) · stanfordnlp-dspy-d97ba83/CONTRIBUTING.mdexpected
•External endpoints declared — 7 distinct host(s) · stanfordnlp-dspy-d97ba83/README.mdexpected
•External endpoints declared — 27 distinct host(s) · stanfordnlp-dspy-d97ba83/docs/docs/community/built-with-dspy.mdexpected
•External endpoints declared — 14 distinct host(s) · stanfordnlp-dspy-d97ba83/docs/docs/community/community-resources.mdexpected
•External endpoints declared — 43 distinct host(s) · stanfordnlp-dspy-d97ba83/docs/docs/community/use-cases.mdexpected
•External endpoints declared — 6 distinct host(s) · stanfordnlp-dspy-d97ba83/docs/docs/learn/programming/language_models.mdexpected
•Broad capability surface — 3 high-impact capability categories referenced — verify least-privilege · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/audio/index.ipynb (CWE-272)risk surface
•Egress to a private/loopback host — 127.0.0.1 · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/deployment/index.md (CWE-918)expected
•External endpoints declared — 9 distinct host(s) · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/rag/index.ipynbexpected
•External endpoints declared — 8 distinct host(s) · stanfordnlp-dspy-d97ba83/docs/overrides/home.htmlexpected
•Egress to a private/loopback host — 0.0.0.0 · stanfordnlp-dspy-d97ba83/dspy/dsp/colbertv2.py (CWE-918)expected
•Broad capability surface — 4 high-impact capability categories referenced — verify least-privilege · stanfordnlp-dspy-d97ba83/tests/primitives/test_python_interpreter.py (CWE-272)risk surface
⚠LLM07System Prompt Leakagemedium
Secrets, internal hosts or proprietary logic exposed in shipped prompts.
•Internal host / private infrastructure reference — shipped content references a private IP range or internal-only host · stanfordnlp-dspy-d97ba83/tests/predict/test_predict.py (CWE-200)risk surface
⚠LLM10Unbounded Consumptionmedium
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.
•Potentially unbounded loop — an infinite loop (while True / while(1) / for(;;)) may cause runaway consumption · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/ai_text_game/index.md (CWE-835)risk surface
§LLM09MisinformationGovernance
Artifacts designed to produce false/deceptive output.
Detectable only by runtime behavioral evaluation; addressed via responsible-use attestation.
✓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.
✓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.
•Dependency manifest — 10 pip requirements declared · stanfordnlp-dspy-d97ba83/docs/requirements.txtrisk surface
•Non-registry dependency source — 1 requirement(s) from git/URL/editable · stanfordnlp-dspy-d97ba83/docs/requirements.txt (CWE-829)risk surface
•Vulnerable dependencies — 186 known vulnerabilities in: aiohttp@3.13.2, black@25.1.0, cryptography@43.0.3, cryptography@45.0.4, diskcache@5.6.3, fastapi-sso@0.16.0, filelock@3.18.0, idna@3.10 (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 · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/ai_text_game/index.md (CWE-77)expected
⚠ML09Output Integrityhigh
Middleware tampering with model outputs in transit.
Gateway enforces TLS + response integrity; static check flags output-rewriting code.
•Suspicious code patterns — pipe-to-shell install · stanfordnlp-dspy-d97ba83/docs/docs/api/modules/RLM.md (CWE-494)expected
•Suspicious code patterns — dynamic code execution · stanfordnlp-dspy-d97ba83/docs/docs/learn/programming/tools.md (CWE-95)expected
•Suspicious code patterns — environment/secret exfiltration · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/llms_txt_generation/index.md (CWE-200)expected
•Suspicious code patterns — OS command execution · stanfordnlp-dspy-d97ba83/dspy/clients/lm_local.py (CWE-78)expected
•Suspicious code patterns — pipe-to-shell install; OS command execution · stanfordnlp-dspy-d97ba83/dspy/primitives/python_interpreter.py (CWE-494)expected
•Suspicious code patterns — pickle deserialization · stanfordnlp-dspy-d97ba83/tests/signatures/test_signature.py (CWE-502)expected
§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 (11) · hygiene / uncategorized
•Unrecognized file type — '.gitignore' is not on the allowlist · stanfordnlp-dspy-d97ba83/.gitignorerisk surface
•Unrecognized file type — '.?' is not on the allowlist · stanfordnlp-dspy-d97ba83/LICENSErisk surface
•Suspicious network references — raw IP URL (1 URLs) · stanfordnlp-dspy-d97ba83/docs/docs/cheatsheet.mdrisk surface
•Suspicious network references — raw IP URL (7 URLs) · stanfordnlp-dspy-d97ba83/docs/docs/learn/optimization/optimizers.mdrisk surface
•Suspicious network references — raw IP URL (3 URLs) · stanfordnlp-dspy-d97ba83/docs/docs/learn/programming/modules.mdrisk surface
•Suspicious network references — raw IP URL (6 URLs) · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/agents/index.ipynbrisk surface
•Suspicious network references — raw IP URL (8 URLs) · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/deployment/index.mdrisk surface
•Suspicious network references — URL shortener (6 URLs) · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/gepa_facilitysupportanalyzer/index.ipynbrisk surface
•Suspicious network references — raw IP URL (4 URLs) · stanfordnlp-dspy-d97ba83/docs/docs/tutorials/optimizer_tracking/index.mdrisk surface
•Suspicious network references — raw IP URL (2 URLs) · stanfordnlp-dspy-d97ba83/tests/examples/test_baleen.pyrisk surface
•Possible obfuscation — very long lines paired with a decode/execute sink · stanfordnlp-dspy-d97ba83/tests/teleprompt/test_gepa.py (CWE-506)risk surface
✔ verified source · pinned stanfordnlp-dspy-d97ba83
Check against a policy

The same gate an agent runs before installing (POST /api/v1/trust/dspy-llm-programming/check). Click a policy:

Consume DSPy 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/dspy-llm-programming

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

# CLI
npx ai-supply add dspy-llm-programming

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

# MCP tool
install_listing({ "slug": "dspy-llm-programming" })
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