Home / Setup
Set up Prompt Guard
Prompt Guard is a TypeScript package with a command-line tool. Install it from npm or build from source.
Install from npm
npm install -g @ai-clyde/promptguard
Then run the CLI:
prompt-guard examples/clean.txt
Install from source
git clone https://github.com/PyMite6941/prompt-guard.git
cd prompt-guard
npm install
npm run build
npm link
Link and run the CLI
Link the local package to make its prompt-guard executable available on your PATH:
npm link
prompt-guard examples/clean.txt
prompt-guard examples/leak.txt
When a file contains a detected issue, the command prints matches and a PII-redacted preview, then exits with status 1. Clean input exits with status 0.
Prepare a local secret vault
prompt-guard vault set deployment-token
prompt-guard vault popup
prompt-guard vault catalog
prompt-guard vault capture prompt.txt
prompt-guard vault export vault-backup.json
prompt-guard vault import vault-backup.json
The terminal GUI lets you manage vault entries and inspect a redacted metadata preview; it never displays the secret value. CLI vault management prompts for the passphrase without echo. Export creates an encrypted backup; import verifies it and replaces the default vault, so back up existing data first. Harness integrations should capture/redact prompts and require human review before sending them to a model; detection is best-effort and unknown secrets can remain. Use SecretVault.withSecret only inside trusted, allow-listed local handlers. Never expose a secret value as a model-facing tool result. See the vault usage and security notes.
CLI flags
| Flag | Description |
|---|---|
--ignore=cat1,cat2 | Skip comma-separated categories (email, creditCard, apiKey, githubToken, ssn, prompt_injection, etc.) |
--exclude=path1,path2 | Skip paths relative to a scanned directory |
--json | Output machine-readable JSON results |
--sarif | Output SARIF 2.1.0 log for code-scanning tools |
--html[=file] | Write an HTML report without detected values |
--junit[=file] | Write a JUnit XML report without detected values |
--audit-log[=file] | Append JSON-lines scan metadata without detected values |
--partial-redaction | Show last 4 characters instead of full redaction |
--config=path | Load configuration from a .promptguardrc file |
--tui / -t | Launch the terminal user interface |
Run the checks
npm test
npm run build
Terminal UI: Run prompt-guard --tui for a full-screen terminal interface with navigation, configuration, and JSON export.
Continue to the usage guide for detection options, TypeScript examples, and guarded OpenAI calls.