This document outlines the security procedures and policies for the Ryuuko Bot project.
Security updates are only applied to the latest version of the code available on the main branch. We encourage all users to run the most current version of the bot to ensure they have the latest security patches.
| Version | Supported |
|---|---|
| > 1.3.x | ✅ |
The Ryuuko Bot team and community take all security vulnerabilities seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
Please do not report security vulnerabilities through public GitHub issues.
Instead, please report them directly to us via email at:
security@example.com (Please replace with a real email address)
Please include the following details in your report:
- A clear description of the vulnerability and its potential impact.
- Steps to reproduce the vulnerability, including any specific commands, inputs, or configurations.
- The version of the bot you are running, if known.
- Any potential mitigations you have considered.
We will make our best effort to respond to your report within 48 hours and provide a timeline for a fix.
This project has been developed with several security considerations in mind:
- Environment Variables: All sensitive information, including the Discord bot token, MongoDB connection string, and all third-party API keys, are managed exclusively through an
.envfile. .gitignore: The.envfile is explicitly included in the project's.gitignoreto prevent accidental commits of sensitive credentials to version control.
- Owner-Only Commands: Critical administrative commands (e.g., user management, credit management, model configuration) are strictly restricted to the bot owner, as defined in the Discord application.
- Authorization System: The bot includes a whitelist-based authorization system (
authorized_users). Only users on this list can interact with the bot's core AI features, preventing unauthorized use.
- Mention Stripping: The bot automatically strips its own mention (
@Ryuuko) from user prompts to prevent it from being processed as part of the input to the language model. - Attachment Processing: File attachments are validated by size and MIME type/extension before being processed to prevent abuse and handling of excessively large or unsupported files.
- Defined Dependencies: All project dependencies are clearly defined in
pyproject.toml. This ensures a consistent and predictable environment and makes it easier to audit for vulnerable packages.
- Secure your
.envfile: Ensure that the.envfile on your production server has restrictive file permissions (e.g.,600) so that only the user running the bot can read it. - Principle of Least Privilege: Run the bot process under a dedicated, non-root user account with the minimum permissions necessary for its operation.
- Keep Dependencies Updated: Regularly update your local dependencies to ensure you have the latest security patches from upstream libraries:
pip install --upgrade -e ./packages/bot