Quick Start
Get your application protected with PromptGuard in under a minute.Prerequisites
Step 1: Install CLI
Step 2: Initialize PromptGuard
Navigate to your project and run:Replace
pg_sk_test_xxx with your actual API key from the dashboard.What Happens?
The CLI will:- Scan your project for LLM SDK usage (OpenAI, Anthropic, Cohere, HuggingFace)
- Show detected SDKs and ask for confirmation
- Create backups of all files to be modified (
.bakextension) - Transform code to route requests through PromptGuard
- Save API key to
.envfile - Create config (
.promptguard.json)
Example Output
Step 3: Run Your Application
That’s it! Your application is now protected. Run it normally:Step 4: Monitor Requests
View your protected requests in real-time:Dashboard
See all requests, threats detected, and usage metrics
CLI Logs
promptguard logs --followWhat Changed?
- TypeScript/JavaScript
- Python
Common Options
Specify Provider
If auto-detection picks up the wrong provider:Dry Run (Preview Changes)
See what would change without modifying files:Skip Confirmation
Auto-accept all changes:No Backups
Skip backup file creation (not recommended):Next Steps
1
Check Status
2
Test Configuration
3
View Dashboard
Visit app.promptguard.co/dashboard to see your requests
Disable or Remove
Temporarily Disable
Restore original files but keep configuration:Completely Remove
Restore original files and delete configuration:Example Workflows
Next.js Application
Next.js Application
Python FastAPI
Python FastAPI
Node.js Backend
Node.js Backend
Multi-Provider Setup
Multi-Provider Setup
Troubleshooting
No SDKs detected
No SDKs detected
The CLI looks for common patterns. If not detected:
- Ensure you have SDK initialization code (not just imports)
- Check file extensions:
.ts,.js,.tsx,.jsx,.py - Files in
node_modules,dist,.venvare excluded by default
Permission denied on .env
Permission denied on .env
The CLI needs write access to
.env. Check file permissions:API key not working
API key not working
Verify your key format:
- Test keys:
pg_sk_test_xxxxx - Production keys:
pg_sk_prod_xxxxx
Requests not showing in dashboard
Requests not showing in dashboard
- Check your app is actually running
- Verify baseURL was added:
cat path/to/file.ts | grep baseURL - Test API key:
promptguard test - Check API key matches in dashboard