Security
Security considerations when using prompts-gpt.
Credential Storage
Token Storage
Tokens are stored in .prompts-gpt/.credentials.json:
{
"token": "pgpt_abc123",
"apiUrl": "https://prompts-gpt.com"
}
- File permissions set to
0600on Unix (owner read/write only) - Auto-added to
.gitignoreon creation - Never committed to version control
Token Security
- Tokens must start with
pgpt_prefix - The SDK refuses to send tokens over unencrypted HTTP (except localhost)
- Tokens are validated before API calls
Permission Auto-Fix
If the credentials file has overly permissive permissions, the SDK automatically tightens them to 0600 on load.
Git Safety
Destructive Git Operations
By default, prompts-gpt blocks destructive git operations during execution:
{
"disallowDestructiveGit": true
}
Blocked operations:
git stashgit reset --hardgit checkout --forcegit clean -fd
Override with --allow-destructive-git flag.
Sandbox Modes (Codex)
| Mode | Permissions |
|---|---|
workspace-read | Read-only access to workspace |
workspace-write | Read/write to workspace files |
full-auto | Unrestricted access |
prompts-gpt run task.md --provider codex --sandbox workspace-read
Permission Modes (Claude)
| Mode | Permissions |
|---|---|
default | Prompts for each action |
acceptEdits | Auto-accepts file edits |
bypassPermissions | Unrestricted |
prompts-gpt run task.md --provider claude --permission-mode acceptEdits
Network Security
HTTPS Enforcement
The SDK enforces HTTPS for all API communication:
const client = new PromptsGptClient({
apiUrl: "http://example.com", // Rejected (not HTTPS)
apiUrl: "http://localhost:3000", // Allowed (localhost exception)
apiUrl: "https://prompts-gpt.com", // Allowed
});
Request Timeouts
All requests have configurable timeouts with a maximum cap:
- Default: 30 seconds
- Max: 600 seconds (10 minutes)
- Generate endpoint: 60 seconds
Data Privacy
What is Sent to the API
- Project token (for authentication)
- Prompt query parameters (for sync/pull)
- Generation input (goal, context) for
generatecommand
What is NOT Sent
- Source code
- Agent output
- Run artifacts
- Local configuration
- Environment variables
Offline Operation
Many commands work entirely offline:
run,run-batch,sweep,orchestrate— local execution onlydoctor,status,validate— local checksdiff,list— local file inspection
Commands that require API access:
sync,pull— fetch prompts from APIgenerate— AI-powered prompt generationinit— token validation
CI/CD Security
Token as Secret
Always store tokens as CI secrets:
# GitHub Actions
env:
PROMPTS_GPT_TOKEN: ${{ secrets.PROMPTS_GPT_TOKEN }}
Prefer PROMPTS_GPT_TOKEN in the remote environment over committing or baking .prompts-gpt/.credentials.json into the runner image.
Remote Readiness Audit
Before turning on a remote runner, validate the environment:
prompts-gpt doctor --remote
This checks:
- Non-interactive execution readiness
- Secret-based token presence
- Safe API URL usage
- Provider auth environment variables
- Destructive git protection
- Artifact directory gitignore coverage
- Local credential file leakage risk
Minimal Permissions
Use the least permissive provider settings in CI:
prompts-gpt run task.md --provider codex --sandbox workspace-read