PromptMap

Stale
GitHub Python GPL-3.0

Description

Automated prompt-injection scanner for custom LLM applications with white-box and black-box testing modes.

Key Features

  • Dual-LLM architecture — a target LLM is tested while an independent controller LLM judges success
  • White-box testing — give promptmap the system prompt and model info and it drives the target LLM itself
  • Black-box testing — point at an external HTTP endpoint via lightweight YAML config and parse responses
  • 50+ built-in rules — cover prompt stealing, jailbreaks, harmful content, bias and more across six categories
  • Multi-provider support — OpenAI, Anthropic, Google Gemini, xAI Grok, and local models via Ollama
  • Custom rules — YAML rule files with condition-based pass/fail criteria

Use Cases

💡 Run pre-release prompt-injection red-team tests on an in-house ChatGPT-style app
💡 Wire into CI to run regression security scans after every model or prompt update
💡 Let security teams perform black-box vulnerability assessments across internal LLM endpoints

Strengths & Limitations

Strengths

  • High community interest (1.2k stars)
  • Established track record (3 years in production)
  • Responsive to issues, low backlog

⚠️ Limitations

  • No updates in over 8 months
  • Restrictive license (GPL-3.0)

Quick Start

# Clone and install dependencies
git clone https://github.com/utkusen/promptmap.git && cd promptmap
pip install -r requirements.txt
# Set API keys for the target and controller LLM
export OPENAI_API_KEY="your-openai-key"
# Run a white-box scan (system prompt supplied)
python promptmap.py --white-box

Related Projects