This document outlines security best practices and procedures for the OpenManus repository to protect sensitive information and prevent accidental exposure.
Sensitive information includes but is not limited to:
- API keys and tokens (Hugging Face, OpenAI, etc.)
- Passwords and credentials
- Private keys and certificates
- Database connection strings
- Personal identification information (PII)
- Chat history and user data
- Configuration files with secrets
- Environment files (.env)
-
.gitignore Configuration
- All sensitive files are automatically added to
.gitignore - Sensitive files are backed up to
.sensitive_backup/directory - The backup directory is also added to
.gitignore
- All sensitive files are automatically added to
-
Automated Scanning
protect_repo.pyidentifies and protects sensitive filessecurity_check.pyscans for hardcoded sensitive information- Pre-commit hooks prevent accidental commits of sensitive data
-
Redaction Process
- Hardcoded secrets are automatically redacted
- Backups are created before any modifications
- Redacted content is replaced with
[REDACTED]markers
Store all sensitive information in environment variables:
# In .env file (protected by .gitignore)
HF_TOKEN=your_huggingface_token_here
OPENAI_API_KEY=your_openai_api_key_here
DATABASE_URL=your_database_connection_stringIn your code:
import os
hf_token = os.getenv('HF_TOKEN')
openai_key = os.getenv('OPENAI_API_KEY')Use template configuration files:
# config.example.toml - committed to repository
hf_[REDACTED]
openai_[REDACTED]
# config.toml - added to .gitignore
hf_[REDACTED]
openai_[REDACTED]Pre-commit hooks automatically scan for sensitive information:
# Install pre-commit hook
python security_check.py --setup-hookBefore committing code, verify:
- No API keys or tokens are hardcoded
- No passwords are in plain text
- All sensitive files are in
.gitignore - Environment variables are used for secrets
- Configuration templates are used instead of actual configs
- Pre-commit hooks are installed and functioning
If sensitive information is accidentally committed:
- Immediately revoke the exposed credentials
- Run the security check script:
python security_check.py --redact
- Review the security report:
cat security_report.json
- Commit the redacted changes
- Notify relevant parties about the exposure
Perform regular security audits using:
# Full security scan
python security_check.py
# Redact sensitive data automatically
python security_check.py --redact
# Setup pre-commit hook
python security_check.py --setup-hookThe following directories and files are automatically protected:
.sensitive_backup/ # Backup of sensitive files
.env # Environment variables
chat_history.json # User chat history
*.log # Log files
*.cache # Cache files
models/ # Model files (may contain sensitive data)
huggingface_cache/ # Hugging Face cache
The repository includes automated protection mechanisms:
- protect_repo.py: Identifies and protects sensitive files
- security_check.py: Scans for hardcoded sensitive information
- Pre-commit hooks: Prevent accidental commits of sensitive data
For security concerns, contact the repository maintainers or file an issue.
Last updated: October 25, 2025