Security (KomiFilter 2.0)
KomiFilter is the exclusive security filter for the Miku project, designed to protect the bot from abuse and technical attacks.
Protective Layers
1. Anti-Prompt Injection
Prevents users from trying to override the original system commands.
- Block manipulation keywords: "ignore previous instructions", "forget previous commands", "act as admin".
- Anti-Role Spoofing: Prevents spoofing of system or developer conversation headers.
2. Anti-Prompt Leak
Protects internal rules and the bot's source code.
- Blocks requests like "show me the system prompt", "display system rules".
- Monitors attempts to access the
system_rules.mdfile.
3. Anti-Response Leak
This is the final layer of protection. Even if the AI is tricked and accidentally reveals system information, KomiFilter scans the AI's response:
- If the response contains sensitive system code or rules, KomiFilter will block that message.
- The user will receive a safe error message instead of sensitive information.
Performance
KomiFilter uses optimized Regular Expressions (Regex) and Unicode normalization (NFC) to ensure that checks are performed quickly without causing delay to the bot's response.