Security Best Practices
Practical security guidance for users and self-hosters.
Security best practices
For users
- Enable two-factor authentication on your Discord account.
- Review Mellow's privacy toggles with
/preferences view; turn offcontext_loggingif you do not want messages stored. - Use
/context clearperiodically if you keep sensitive conversations. - Remember ghost letters and journal entries are encrypted but still stored; use them for expression, not for storing secrets you need to keep private forever.
For server admins
- Grant Mellow only the permissions it asks for. It never needs Ban, Kick, Manage Roles, or
Manage Server for its own features (Manage Server is only used to gate the
/guildsettingscommand). - Make
mod_alert_channelvisible to moderators only. - Decide deliberately whether to enable
context_loggingfor the server; it affects every member.
For self-hosters
Secrets
- Keep
.envout of version control. Never commitTOKEN,ANTHROPIC_API_KEY,API_TOKEN,ENCRYPTION_KEY, orDATABASE_URL. - Generate a strong random
ENCRYPTION_KEY(32 bytes). If it is ever exposed, rotate it: add a new salt to the front ofENCRYPTION_SALT_LIST, keep the old one for reads, and re-encrypt. - Restrict
OWNER_IDSto the accounts that genuinely need owner commands.
Database
- Use
sslmode=requireinDATABASE_URLfor any non-local database. - Give the bot's database role only the privileges it needs (DML plus migration DDL).
- Back up the database; the backup contains ciphertext, so also protect
ENCRYPTION_KEYseparately - without it the backup is unreadable.
HTTP API
- The API's
POST /v1/chatandPOST /v1/feedbackrequireAuthorization: Bearer <API_TOKEN>. Use a long randomAPI_TOKENand rotate it if leaked. - Terminate TLS at your reverse proxy or platform; do not expose the plain
PORTpublicly. GET /healthzis unauthenticated by design; it returns status only.
Runtime
- Run the container as a non-root user (the provided Dockerfile does).
- Keep Go and dependencies current; rebuild on security releases.
- Watch
LOG_CHANNEL_ID/ system logs for gateway disconnects and unexpected guild join/leave activity.
Updates
/versionand the startup update check compare the running build to the latest GitHub release. Track the releases page.- Report vulnerabilities privately: [email protected] or a GitHub security advisory. Do not open a public issue.