Protection Levels
SnapBack provides three distinct protection levels that give you granular control over how your files are protected. Each level offers a different balance between protection and workflow flexibility.
Canonical Signage: SnapBack’s protection levels are formalized using a canonical signage system:
- Watch (
watch) - 🟢 Green circle- Warn (
warn) - 🟡 Yellow circle- Block (
block) - 🔴 Red circleThese canonical values are used consistently across the VS Code extension, CLI, web dashboard, and all integrations.
The Traffic Light System
SnapBack uses a traffic light metaphor to make protection levels intuitive and easy to understand:
Watch
Silent auto-snapshots with zero friction. Perfect for files you want to protect without any workflow interruption.
Warn
Confirmation before save. Provides a gentle reminder to think before making changes to important files.
Block
Required note (audit trail). Blocks changes until you provide context, creating an audit trail for critical modifications.
Setting Protection Levels
You can set protection levels in several ways:
VS Code Extension
- Right-click any file or folder in the explorer
- Select “SnapBack: Set Protection Level”
- Choose from Watch, Warn, or Block
// Example .snapbackprotected file
{
"rules": [
{
"pattern": "**/*.config.js",
"level": "warn"
},
{
"pattern": "**/.env*",
"level": "block"
},
{
"pattern": "docs/**",
"level": "watch"
}
]
}
CLI Tool
# Set protection level for a specific file
snapback protect --file src/config.ts --level warn
# Set protection level for all files matching a pattern
snapback protect --pattern "**/*.env" --level block
Smart Defaults
SnapBack comes with intelligent defaults that automatically assign appropriate protection levels based on file types and patterns:
When to Use Each Level
Watch (🟢)
Use for files where you want automatic protection without any workflow interruption:
- Documentation files
- Static assets (images, CSS, etc.)
- Test files
- Non-critical configuration
- Generated files
Warn (🟡)
Use for files where you want a gentle reminder to think before making changes:
- Source code files
- Critical configuration files
- Build scripts
- Package manifests
- CI/CD configuration
Block (🔴)
Use for files where changes should be carefully considered and documented:
- Environment files (.env, .env.local, etc.)
- Production database configuration
- API keys and secrets
- Critical infrastructure configuration
- Files that require audit trails
Best Practices
📁 Organize by Sensitivity
Group files by sensitivity level and apply protection accordingly. Critical secrets should be blocked, while documentation can be watched.
🔄 Review Regularly
Periodically review your protection levels as your project evolves. What was once safe might become critical.
👥 Team Consistency
Establish team conventions for protection levels to ensure consistent application across your codebase.
📝 Document Your Rules
Add comments to your .snapbackprotected file explaining why certain files have specific protection levels.
Canonical Signage System
SnapBack’s protection levels are formalized through a canonical signage system that ensures consistency across all user interfaces:
Protection Level Signage
| Level | Canonical | Emoji | Label | Color | Use Case |
|---|---|---|---|---|---|
| Watch | watch | 🟢 | “Watch” | #10B981 (Green) | Silent auto-snapshots |
| Warn | warn | 🟡 | “Warn” | #FACC15 (Yellow) | Confirmation prompts |
| Block | block | 🔴 | “Block” | #EF4444 (Red) | Required snapshots |
Core Concepts
Beyond protection levels, SnapBack’s UI uses canonical emoji and labels for core concepts:
| Concept | Emoji | Label | Purpose |
|---|---|---|---|
| Snapshot | 📸 | “Snapshot” | Point-in-time file capture |
| Session | 🕐 | “Session” | Time-bounded collection of snapshots |
| Protected Files | 🛡️ | ”Protected Files” | Files under active protection |
| Blocking Issues | ⚠️ | ”Blocking Issues” | Critical findings that halt operations |
| Watch Items | 📊 | “Watch Items” | Non-blocking items for monitoring |
File Health States
Editor decorations show file health status through canonical icons:
| State | Badge | Meaning |
|---|---|---|
| Protected | 🛡️ | File is protected with no detected risks |
| Warning | ⚠️ | File has moderate risk detected |
| Risk | 🚨 | File has high risk detected |
Repository Status
Workspace-level protection coverage is indicated through repo status:
| Status | Emoji | Meaning |
|---|---|---|
| Unprotected | ⭕ | No critical files have protection |
| Partial | 🟡 | Some critical files are protected |
| Protected | 🟢 | All critical files are covered |
| Error | ⚠️ | Status check failed |
Developer Note: All UI elements in SnapBack (VS Code extension, CLI, web dashboard) source their emoji and labels from a centralized signage module. This ensures consistency and makes updates seamless—change an emoji once, and it updates everywhere.
Examples
Environment Files (Block)
# .env.production
DATABASE_URL=postgresql://user:password@localhost:5432/mydb
API_SECRET_KEY=super-secret-key
JWT_SECRET=another-secret-token
Configuration Files (Warn)
// webpack.config.js
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
// Changes to this file can significantly impact build process
};
Documentation (Watch)
# README.md
This is documentation that can be watched without any protection.
Related Documentation
- AI Detection - How SnapBack monitors AI coding assistants
- Session Time-Travel - Multi-file atomic rollback for AI changes
- CLI Documentation - Command-line interface for automation
- VS Code Extension - IDE integration for real-time protection
💡 Pro Tip: Start with SnapBack’s smart defaults and gradually customize protection levels as you become familiar with your workflow. You can always adjust levels later.