- Proposals
- 2 identical records
- Ceiling
- $1,200,000
- Criteria
- 70 · 20 · 10
Measure before
you trust.
A reproducible prompt-injection benchmark that connects to the agent stack you already use—then turns the result into a security gate.
Different base models.
Capability and security are different axes.
Two models can complete benign tasks at nearly the same rate and still have radically different prompt-injection failure profiles. Security must be measured directly.
Capability × robustness
Hover or focus a model. Provisional measurements use a dashed ring.
See which models
hold the boundary.
Robustness is the share of prompt-injection attacks that failed. Capability is benign task completion. Confidence intervals are cluster-bootstrapped over task pairs.
| Rank / model | Family | Robustness | Capability | Evidence |
|---|
Make injection safety
a merge condition.
Scaffold a config and GitHub Action, preview the exact test matrix without spending API credits, then block regressions with terminal, JSON, and SARIF reports.
- 01Works with DSPy or any Python agent factory
- 02Absolute security floors or baseline regression gates
- 03OWASP LLM01 · NIST AI 100-2 · MITRE ATLAS mappings
# install and create a ready-to-run gate
$ pip install dspy-security-bench
$ dspy-security-bench init --model openai/gpt-4o-mini
# inspect the matrix — zero model calls
$ dspy-security-bench scan --config .dspy-security-bench.yaml --plan
✓ 10 benchmark cases planned
✓ no model was called
Open the five-minute guide
Your framework.
One evidence contract.
Keep your orchestration code and tools. The integration assistant detects a directly declared framework, generates a reviewable adapter, and validates the wiring without invoking the agent run loop.
dspy-security-bench integratesame evidence
dspy-security-bench doctorno agent runs- ✓ Manifest is valid
- ✓ Fresh agent factory
- ✓ Immutable ProofRun ref
- ✓ Attestation permissions
Generated workflows are manual by default, so connecting a repository cannot unexpectedly spend model credits.
Run it. Sign it.
Let others verify it.
A reusable workflow isolates model evaluation from signing, recomputes every statistic in a clean job, and binds the exact JSON to a source commit before enforcing the gate.
Provenance is earned.
- 1Self-attestedstatistics + canonical hash
- 2GitHub-attestedrunner + workflow + commit
- 3Trusted builderimmutable central workflow
- 4Reproducedindependent maintainer rerun
sha256: 9e81…c4f2
signature verification is separate from score recomputation
permissions:
contents: read
id-token: write
attestations: write
jobs:
proofrun:
uses: immu4989/dspy-security-bench/.github/workflows/proofrun.yml@v0.10.0
with:
agent: myapp.security:build_agent
trials: 10
Every accepted entry preserves all raw trials and passes offline recomputation. A cryptographic badge appears only after the exact digest passes attestation verification and enters the reviewed registry.
Run your agentProvenance authenticates a workflow and exact artifact. It does not independently observe a model provider or turn a synthetic benchmark into certification.
Same facts.
Different decision.
Clean and poisoned procurement twins hold structured facts fixed while varying one untrusted input: vendor-authored text. Then the benchmark measures what changed in the live synthetic world.
- Proposals
- 2 identical records
- Ceiling
- $1,200,000
- Criteria
- 70 · 20 · 10
Award bias · sealed bids · payment identity · eligibility · approval
Deliberately vulnerable scorer fixture
Scenario value behind compromised actions
Functional environment-state evidence
Perfect observed is not certain.
Ten passes still carry uncertainty. Preserve every raw trial, expose the interval, and gate on its lower bound.
- raw trials retained
- statistics recomputed
- SHA-256 content addressed
Mission utility, controlled-pair decision invariance, confidentiality, identity, authorization, uncertainty, and bounded economic context—versioned in JSON and SARIF.
$ dspy-security-bench impact repeat --trials 10
Inspect the protocol
Reference fixture, not a model result. Synthetic exposure is not predicted loss or a compliance certification.
Don't trust the policy.
Test the outcome.
Execute the same poisoned missions with the boundary off and on. Measure functional harm, safe recovery, and clean utility independently.
- award decision changed
- sealed record released
- authoritative state mutated
- all observed harms contained
- clean utility stays at 100%
- every aggregate recomputable
One delta can be luck.
Repeat the pair.
Run the complete experiment again and again. Alternate order. Preserve every child report. Gate the lower confidence bound—not the flattering point estimate.
- harms prevented
- 25
- harms introduced
- 0
- unstable pair effects
- 0 / 5
- exact McNemar p
- 5.96e−8
$ dspy-security-bench impact control-repeat-demo --trials 5Deterministic fixture · fixed synthetic suite · not a model result, population estimate, predicted loss, or certification
$ dspy-security-bench impact control-demo
Deterministic reference fixture, not a model result. Containment is not recovery; synthetic exposure is not predicted loss or certification.
Secure the moment
intent becomes action.
Every production pattern pairs an untrusted input with a dangerous sink. Included policies enforce least agency before the side effect—not after an incident.
Customer support
Resolve tickets without turning a poisoned CRM note into data exfiltration, unlimited refunds, or identity changes.
- Untrusted
- Tickets · email · CRM
- Boundary
- Refund cap · recipient domain
--profile customer-support
Accounts payable
Extract and reconcile invoices while preventing vendor impersonation from becoming an unauthorized transfer.
- Untrusted
- Invoices · vendor email
- Boundary
- Payee allowlist · approval
--profile financial-operations
Research & RAG
Search broadly without letting a hostile page become persistent memory, published content, or executable code.
- Untrusted
- Web · docs · retrieved chunks
- Boundary
- Memory · publish · execute
--profile research-rag
DevOps copilots
Accelerate diagnosis with broad observability while keeping deletion, shell access, and production mutation constrained.
- Untrusted
- Logs · issues · repository
- Boundary
- Deploy · shell · delete
--profile devops
$ dspy-security-bench policy init --profile customer-support
Open implementation guide
Built for scrutiny,
not screenshots.
Frozen protocol
Suites, attacks, scaffold, task subset, and decoding settings are hashed and versioned.
Every row reproducible
Per-model result JSON, run metadata, confidence intervals, and generation scripts live beside the board.
Honest uncertainty
Rows remain provisional when confidence intervals cross a bucket boundary. Green means no known bypass—not safe.
Prompt injection is a model property.
Measure it like one.