Troubleshooting
Solutions to common issues when using the PromptGuard CLI.Installation Issues
Command not found: promptguard
Command not found: promptguard
Problem: After installation, running
promptguard shows “command not found”Solutions:-
Check if
/usr/local/binis in PATH:If not found, add it: -
Install to user directory:
-
Verify installation:
Permission denied when installing
Permission denied when installing
Problem: Install script fails with permission errorsSolutions:
-
Run with sudo:
-
Or install to user directory (no sudo needed):
Cannot execute binary file
Cannot execute binary file
Problem: Binary won’t run, shows “cannot execute binary file”Cause: Wrong architecture downloadedSolution:
-
Check your system:
-
Download correct binary:
SSL certificate verification failed
SSL certificate verification failed
Problem: Download fails with SSL/TLS errorsSolution (Linux):Solution (macOS):
Initialization Issues
No SDKs detected
No SDKs detected
Problem:
promptguard scan finds no LLM SDKsPossible causes:-
No SDK initialization in code (only imports):
-
Files in excluded directories:
Check
node_modules,dist,build,.venv,venvare excluded by default -
Wrong file extension:
CLI scans:
.ts,.tsx,.js,.jsx,.pySkips:.json,.md,.txt
Invalid API key format
Invalid API key format
Problem: Error: “Invalid API key format”Solution:API keys must start with:
- Test keys:
pg_sk_test_ - Production keys:
pg_sk_prod_
- Visit app.promptguard.co/settings/api-keys
- Click “Generate New Key”
- Copy the key (starts with
pg_sk_test_orpg_sk_prod_) - Run:
promptguard init --api-key pg_sk_test_xxxxx
Permission denied writing to .env
Permission denied writing to .env
Problem: Cannot write to
.env fileSolution:-
Check file permissions:
-
Fix permissions:
-
If .env doesn’t exist:
Already initialized error
Already initialized error
Problem: “PromptGuard is already initialized”Solution:
-
Check status:
-
Re-apply changes:
-
Or completely reset:
Runtime Issues
Requests not showing in dashboard
Requests not showing in dashboard
Problem: Application runs but no requests appear in dashboardDebugging steps:
-
Verify transformation was applied:
-
Verify API key in code:
-
Test connectivity:
-
Check if app is actually making LLM calls:
- Trigger a feature that uses AI
- Check app logs for errors
- Verify LLM response is returned
-
Verify correct API key in dashboard:
- Dashboard shows requests for the specific API key
- Ensure you’re looking at the right project
baseURL was not added to code
baseURL was not added to code
Problem: Transformation didn’t add
baseURL/base_urlPossible causes:- Already has baseURL: CLI skips if already configured
- Unsupported SDK pattern: CLI looks for standard initialization patterns
-
Check if already present:
-
Manually add if needed:
-
Then run:
Application crashes after init
Application crashes after init
Problem: App crashes or throws errors after PromptGuard initializationDebugging:
-
Check error message:
Common errors:
baseURL is not a valid option→ Old SDK versionECONNREFUSED→ Network issueAPI key invalid→ Wrong key
-
Verify SDK version:
-
Test without PromptGuard:
-
Check proxy URL:
API calls timing out
API calls timing out
Problem: LLM API calls are very slow or timeoutPossible causes:
- Network latency to PromptGuard proxy
- Slow upstream LLM provider
- Heavy security scanning
-
Test direct connection:
-
Check dashboard for latency:
Visit app.promptguard.co/dashboard
- View “Response Time” metrics
- PromptGuard adds ~10-50ms typically
-
Increase timeout in code:
- Contact support if persistent: [email protected]
Configuration Issues
Config file corrupted
Config file corrupted
Problem:
.promptguard.json is invalid or corruptedSolution:-
Validate JSON:
-
Delete and reinitialize:
-
Or manually fix:
Edit
.promptguard.jsonwith proper JSON syntax
Can't revert changes
Can't revert changes
Problem:
promptguard revert doesn’t restore filesPossible causes:- No backup files (
.bakfiles deleted) - Backups disabled during init
-
Check for backups:
-
If backups exist:
-
If no backups, use git:
Multiple .promptguard.json files
Multiple .promptguard.json files
Problem: Multiple config files in monorepo causing confusionSolution:Each project should have its own config:Run CLI in each directory:
Command-Specific Issues
promptguard test fails
promptguard test fails
Problem:
promptguard test shows errorsCommon failures:-
API key invalid:
→ Get new key from dashboard
-
Proxy unreachable:
→ Check internet connection → Verify
https://api.promptguard.cois accessible -
Config not found:
→ Run
promptguard initfirst
promptguard disable/enable not working
promptguard disable/enable not working
Problem: Disable/enable commands don’t change filesSolution:
-
Check status:
-
Verify backups exist:
-
Manually check files:
Getting Help
If you’re still stuck:Run Diagnostics
Check Logs
Email Support
GitHub Issues
Report bugs or request features