A demonstration application showcasing PromptProof's capabilities to catch common LLM failure modes.
- Support Reply Endpoint: Generates support responses with required disclaimers and PII protection
- RAG Answer Endpoint: Provides document-based Q&A with proper citations
- Tool Calling: Calendar event scheduling with argument validation
- Multi-language Support: English and French locales
-
Regression fail PR · Cost gate PR · Assertion fail PR
[Links to live PRs and GIFs to be inserted after publishing]
- Install dependencies (includes PromptProof SDK and CLI):
npm install- Set up environment variables:
cp .env.example .env
# Add your OpenAI API key- Run the development server:
npm run devThis demo showcases the complete PromptProof workflow using the official npm packages and GitHub Action:
promptproof-sdk-node@beta: Automatically records LLM interactions as fixtures- One-line integration:
withPromptProofOpenAI()wrapper - Automatic recording: All LLM calls recorded to
fixtures/support-replies/outputs.jsonl
promptproof-cli@beta: Validates fixtures against contracts- NPM scripts:
npm run test:promptprooffor easy validation - Multiple formats: Console, HTML, JSON reports
- New:
--regress,--seed,--runsflags;snapshotcommand for baselines
Already included as .github/workflows/promptproof.yml (fixtures-only, no secrets). It runs in report-only so forks stay green, and can be made required via branch rules.
name: PromptProof (demo)
on: [pull_request]
permissions:
contents: read
pull-requests: write
jobs:
eval:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: geminimir/promptproof-action@v0
with:
config: promptproof.yaml
format: html
mode: report-only
- name: Create snapshot on success
if: github.ref == 'refs/heads/main' && success()
run: |
npx promptproof snapshot promptproof.yaml --promotePP_RECORD=1 # Enable recording (default: 1 in dev, 0 in prod)
PP_SUITE=support-replies # Fixture suite name
PP_SAMPLE_RATE=1.0 # Record 100% of calls- SDK records LLM interactions automatically
- CLI validates fixtures against contracts in
promptproof.yaml - CI/CD integration via GitHub Actions
- Violation detection prevents regressions
Generates a support response with PII protection and required disclaimers.
curl -X POST localhost:3000/support/reply \
-H 'Content-Type: application/json' \
-d '{"email":"[email protected]","locale":"en","message":"How do I get a refund?"}'Provides document-based answers with proper citations.
curl -X POST localhost:3000/rag/answer \
-H 'Content-Type: application/json' \
-d '{"locale":"en","question":"What is your refund policy?"}'Run contract validation:
# Using npm script
npm run test:promptproof
# Or directly with CLI
npx promptproof eval -c promptproof.yaml
# Generate HTML report
npm run test:promptproof:html
# Compare against baseline (if snapshot exists)
npx promptproof eval -c promptproof.yaml --regress
# Create a baseline snapshot after green runs
npx promptproof snapshot promptproof.yaml --promoteThis demo proves PromptProof's effectiveness by showcasing:
- PII Leakage: Email/phone numbers in responses
- Schema Drift: Invalid JSON structure from extractors
- Missing Disclaimers: Required legal text omitted
- Bogus Citations: Fake or missing source URLs
- Tool Argument Errors: Invalid calendar event parameters
- Cost/Latency Budgets: Excessive token usage or response time
- Multilingual Regressions: Inconsistent behavior across locales
- Red: Fixtures with intentional failures → Action goes red with HTML report
- Green: Quick fix → re-run → green check
This repository is designed to be a template. Enable "Template repository" in Settings, then click "Use this template" to spin up a new project with PromptProof pre-wired. The default workflow uses fixtures-only and report-only so your first PR is green without any secrets.
- Zero network calls in CI: Tests run on recorded fixtures
- Deterministic: Same input = same output, no flaky tests
- Privacy-safe: Built-in PII redaction
- Cost-effective: No API costs during validation