# Security Standards
## 1. Secrets & Credentials
- **Never Commit Secrets:** Real Bale bot tokens, chat IDs, SMS API keys, proxy UUIDs/passwords, or live `config.yaml` files must never be committed to Git. Only commit `config.example.yaml` with placeholders.
- **Environment Variables Preferred:** Support reading sensitive tokens (e.g. `BALE_BOT_TOKEN`) from environment variables in production.
- **File Permissions:** Create and maintain `/etc/proxy-pilot/config.yaml` with `0600` permissions (owner read/write only).
- **Log Redaction:** Never log bot tokens, API keys, authorization headers, or proxy credentials in plain text.
## 2. Safe Live Server Operations
- **Explicit Owner Approval:** Never modify live server configurations, delete runtime state, send live Bale/SMS alerts, or restart production services without explicit owner authorization.
- **Atomic Config Updates:** Always write updates to core config files (e.g. Xray `config.json`) to a temporary file in the same directory and atomically rename it so a crash never leaves a corrupted config.
- **Verify Downloaded Binaries:** When downloading `proxy-pilot` updates or managed cores (`xray`, `sing-box`), verify SHA-256 checksums before replacing existing binaries.
- **Pre-commit Secret Check:** `.pre-commit-config.yaml` runs `detect-private-key` on every commit.