Local-first prompt scanning

Catch sensitive data before it reaches your AI.

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.

Scan a prompt file
$ prompt-guard examples/clean.txt
โœ… Text is clean and safe.

$ prompt-guard examples/leak.txt
๐Ÿšจ Security risk detected!

A practical first line of defense

Run checks before submitting prompts to a model. Scanning happens locally; prompt content is not sent to an external service by Prompt Guard.

Find common PII

Detect email addresses, credit-card-shaped numbers, API-key formats, IP addresses, phone numbers, and social security numbers.

Detect secrets

Catch OpenAI keys, GitHub tokens, AWS keys, Stripe keys, database URLs, JWTs, and SSH private keys.

Flag injection phrases

Identify common prompt-injection language, including attempts to ignore previous instructions or expose a system prompt.

Keep credentials local

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.

Quick start

Install from npm or clone the repository.

Install from npm

npm install -g @ai-clyde/promptguard

Link and scan

npm link
prompt-guard examples/clean.txt

Use in your app

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.