Skip to main content

Security Model

Version: v0.99.0-beta


Executive Summary

Neural Commander is designed with local-first security as a core principle. All data processing happens on-device by default, with cloud features requiring explicit opt-in.


Security Principles

Local-First Architecture

PrincipleImplementation
Data sovereigntyAll data stored locally in ~/.nc/
Zero telemetryNo usage data sent without consent
Offline capableCore features work without network
BYOK (Bring Your Own Key)User provides API keys for cloud services

Defense in Depth

┌─────────────────────────────────────────────┐
│ User Environment │
│ ┌───────────────────────────────────────┐ │
│ │ NC Process Sandbox │ │
│ │ ┌─────────────────────────────────┐ │ │
│ │ │ Resource Governor │ │ │
│ │ │ (CPU/Memory limits enforced) │ │ │
│ │ └─────────────────────────────────┘ │ │
│ └───────────────────────────────────────┘ │
└─────────────────────────────────────────────┘

Data Classification

Sensitive Data Locations

Data TypeLocationProtection
API keysEnvironment variablesNever stored on disk
Session data~/.nc/data/sessions/Local filesystem permissions
Feedback~/.nc/data/feedback.dbSQLite with local access only
Learnings~/.nc/data/learnings/Project-scoped, local only
Logs~/.nc/logs/Rotated, local only

What We Never Store

  • API keys or tokens (environment variables only)
  • Source code content (only metadata/patterns)
  • Personal identifiable information (unless explicitly provided)
  • Telemetry or usage analytics

Authentication & Authorization

API Server (Port 7669)

Endpoint TypeAuth RequiredNotes
/healthNoneHealth check only
/api/*Optional API keyConfigurable via NC_API_KEY
Tier-gatedTier middlewarePro/Enterprise features check license

GitHub Integration

  • Uses NC_GITHUB_TOKEN environment variable
  • Personal Access Token with minimal scopes (issues only)
  • Never stored - passed at runtime

Telegram Bot

  • Uses NC_TELEGRAM_BOT_TOKEN environment variable
  • Bot runs in group mode only
  • Admin verification for sensitive commands

Network Security

Outbound Connections

ServicePurposeWhen Used
Ollama (localhost:11434)Local LLMAlways (if configured)
Anthropic APICloud LLMOnly if API key provided
OpenAI APICloud LLMOnly if API key provided
GitHub APIIssue creationOnly with --github flag
Telegram APIBot notificationsOnly if bot configured

No Inbound Exposure

  • API server binds to localhost:7669 by default
  • No publicly routable endpoints in Community Edition
  • Firewall not required for basic operation

Resource Safety

Resource Governor

NC includes a Resource Governor that prevents runaway resource consumption:

// Default limits (configurable)
MaxCPUPercent: 80% // Never exceed 80% CPU
MaxMemoryMB: 4096 // 4GB memory cap
Mode: "interactive" // Balanced performance

Platform-Specific Safety

PlatformSafety Measures
WindowsProcess priority management, memory limits
Linuxcgroups-compatible, signal handling
macOSMemory pressure handling, thermal awareness

Threat Model

In Scope

ThreatMitigation
Local file tamperingFilesystem permissions, checksums
Resource exhaustionResource Governor limits
API key exposureEnvironment variables, never logged
Malicious pluginsPlugin signing (future), sandboxing

Out of Scope (User Responsibility)

  • Physical access to machine
  • Compromised operating system
  • Network-level attacks (firewall your own machine)
  • Malicious Ollama models (user chooses models)

Compliance Considerations

GDPR/CCPA

  • Data minimization: Only collect what's needed
  • Local processing: Data stays on user's machine
  • No tracking: Zero telemetry by default
  • Right to deletion: All data in ~/.nc/, user can delete

SOC2 (Enterprise)

Enterprise tier includes:

  • Audit logging
  • Access controls
  • Data residency options
  • SSO/SAML integration

Security Best Practices

For Users

  1. Keep NC updated - Security fixes in each release
  2. Use environment variables for secrets - Never hardcode API keys
  3. Review plugin sources - Only install trusted plugins
  4. Backup ~/.nc/ - Your data, your responsibility

For Contributors

  1. Never log secrets - API keys, tokens must not appear in logs
  2. Validate all input - Especially from API endpoints
  3. Use parameterized queries - SQLite operations use prepared statements
  4. Follow least privilege - Request minimal API scopes

Vulnerability Reporting

Security issues: Report privately to security@neuralcommander.ai

Do not:

  • Open public GitHub issues for security vulnerabilities
  • Share exploit details before fix is released

We will:

  • Acknowledge within 48 hours
  • Provide fix timeline within 7 days
  • Credit reporters (unless anonymity requested)

Security Roadmap

v0.99 (Current)

  • Plugin signature verification
  • Encrypted local storage option
  • API key rotation reminders

v1.0 (Planned)

  • Audit logging for all operations
  • Role-based access control (Enterprise)
  • Hardware security key support