Security Overview
DevDiff is designed from the ground up with a privacy-first, security-conscious architecture. This document explains the security model.
Core Security Principles
- Zero Trust by Default — No data leaves your machine unless you explicitly configure a cloud provider
- Data Classification Engine — Automatically detects and blocks secrets/PII before cloud transmission
- No Telemetry — DevDiff collects no usage data, no analytics, no crash reports
- Offline Capable — With Ollama, DevDiff works with zero network access
- Open Source — All code is publicly auditable at GitHub
Data Flow
Local AI (Ollama)
Your code change
│
▼
git diff (staged)
│
▼
DevDiff CLI
│ (no network call)
▼
Ollama (local process)
│ (no network call)
▼
AI model on your CPU/GPU
│
▼
Changelog outputNothing leaves your machine. ✅
Cloud AI (OpenAI, Anthropic)
Your code change
│
▼
git diff (staged)
│
▼
DevDiff Data Classification Engine
│ (strips secrets, PII, sensitive patterns)
▼
Redacted diff sent to cloud API
│ (HTTPS encrypted)
▼
Cloud AI model (OpenAI / Anthropic)
│
▼
Changelog returned
│
▼
DevDiff CLI outputDiff is sent to cloud provider. ⚠️ See Privacy Policy and the provider's privacy policy.
Data Classification Engine
The data classification engine runs before any cloud API call and automatically redacts:
| Pattern | Example | Action |
|---|---|---|
| API Keys | sk-abc123... | Replaced with [REDACTED_API_KEY] |
| Passwords | password = "secret" | Replaced with [REDACTED_PASSWORD] |
| AWS credentials | AKIA... | Replaced with [REDACTED_AWS_KEY] |
| Private keys | -----BEGIN RSA PRIVATE KEY----- | Replaced with [REDACTED_PRIVATE_KEY] |
| Email addresses | user@example.com | Configurable — redact or allow |
| IP addresses | 192.168.1.1 | Configurable — redact or allow |
| JWT tokens | eyJ... | Replaced with [REDACTED_JWT] |
Configure the classifier:
// .devdiff.config.js
export default {
security: {
classifier: {
enabled: true, // Always enabled for cloud providers
failOpen: false, // If classifier errors, block the request
customPatterns: [
{
name: "internal-token",
pattern: /TOKEN_[A-Z0-9]{32}/,
replacement: "[REDACTED_INTERNAL_TOKEN]",
},
],
},
},
};Git Hook Security
When you run devdiff init, it installs a pre-commit hook. This hook:
- ✅ Only reads staged changes
- ✅ Does not modify your working directory
- ✅ Does not push, pull, or make any git writes
- ✅ Can be disabled with
devdiff init --no-hooks
Shell Command Safety
DevDiff runs only two types of shell commands:
git diff --cached— reads staged changesgit log— reads commit history
DevDiff never runs arbitrary shell commands from your diff content. There is no code execution of analyzed content.
Vibe-Coding Guardian
The devdiff vibe feature creates checkpoints before destructive operations. See Vibe-Coding Mode for details.
Audit Log
Every AI provider call is logged locally:
# View audit log
devdiff audit
# Log location
cat .devdiff/audit.jsonlEach entry records: timestamp, provider used, persona, tokens consumed, and whether classification was triggered.
Responsible Disclosure
Found a security vulnerability? See Security Disclosure.