Security¶
Security Philosophy¶
Drift CLI is designed with a safety-first approach:
- Local-First — All processing happens on your machine. No data is sent to cloud services.
- Explicit Confirmation — Destructive operations require user confirmation.
- Hard Blocklist — Dangerous commands are blocked and never executed.
- Risk Assessment — Every command is evaluated for potential harm.
- Snapshot System — Files are backed up before modification.
Supported Versions¶
| Version | Supported |
|---|---|
| 0.1.x |
Command Blocklist¶
The following patterns are hard-blocked and will never execute:
rm -rf /and variantssudo rm -rfon root or system directories- Disk formatting commands (
mkfs,diskutil eraseDisk) - Piping curl/wget to shell (
curl ... | sh) - Device file operations that could corrupt data
- Fork bombs and similar malicious patterns
- Crypto mining commands
- Reverse shells and network exfiltration
- Base64-obfuscated command execution
See Safety Engine for the complete list.
Risk Levels¶
| Level | When | Confirmation |
|---|---|---|
| LOW |
Read-only operations | y/N |
| MEDIUM |
File modifications, installs | y/N |
| HIGH |
System changes, deletions | Must type YES |
Snapshot System¶
Before executing commands that modify files:
- A snapshot is created in
~/.drift/snapshots/ - Original files are backed up
- Changes can be rolled back with
drift undo
Threat Model¶
In Scope:
- Command injection vulnerabilities
- Bypass of safety blocklist
- Privilege escalation
- Data loss through incorrect operations
Mitigations:
- LLM hallucinations → Pydantic validation + blocklist + user confirmation
- Blocklist bypass → Regex patterns + user review
- Snapshot corruption → Metadata validation + path traversal protection
Reporting a Vulnerability¶
If you discover a security vulnerability:
- DO NOT open a public issue
- Contact the maintainers privately
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
Best Practices¶
Do¶
Review commands before confirming
Use
--dry-runfor risky operationsKeep Ollama and Drift updated
Verify generated commands make sense
Don't¶
Run Drift with sudo/root privileges
Ignore HIGH-risk warnings
Execute commands you don't understand
Disable safety checks
Known Limitations¶
- Snapshot coverage — Only backs up files the LLM identifies as affected. Hidden side effects may not be captured.
- Blocklist completeness — Cannot catch every dangerous operation. Use common sense.
- LLM accuracy — The model may occasionally suggest incorrect commands. Always review.