Find common PII
Detect email addresses, credit-card-shaped numbers, API-key formats, IP addresses, phone numbers, and social security numbers.
Prompt Guard checks text for common personally identifiable information and prompt-injection patterns, right in your application or from the command line. Its optional local vault keeps secret values encrypted and out of model-facing tool results by default.
$ prompt-guard examples/clean.txt โ Text is clean and safe. $ prompt-guard examples/leak.txt ๐จ Security risk detected!
Run checks before submitting prompts to a model. Scanning happens locally; prompt content is not sent to an external service by Prompt Guard.
Detect email addresses, credit-card-shaped numbers, API-key formats, IP addresses, phone numbers, and social security numbers.
Catch OpenAI keys, GitHub tokens, AWS keys, Stripe keys, database URLs, JWTs, and SSH private keys.
Identify common prompt-injection language, including attempts to ignore previous instructions or expose a system prompt.
Store secrets in an encrypted local vault and expose only IDs and safe metadata to harness tools. Detection is best-effort; review captured prompts before sending them to a model.
Pattern-based scanning is best-effort, can produce false positives or miss novel formats, and is not a substitute for application-specific security controls. Injection phrases are reported but not removed from the sanitized text.
Install from npm or clone the repository.
npm install -g @ai-clyde/promptguard
npm link prompt-guard examples/clean.txt
import { scanText } from '@ai-clyde/promptguard';
const result = scanText(prompt);
Read the setup guide or usage guide for complete instructions. See the README for development instructions.