| Version | Supported |
|---|---|
| 4.12.x | ✅ Active |
| 4.11.x | |
| < 4.11 | ❌ Unsupported |
If you discover a security vulnerability in Genesis, please do not open a public issue.
Instead, report it privately via:
- Email: Open a GitHub issue titled "Security Report" with minimal detail, then DM the maintainer
- GitHub Security Advisories: Create a private advisory
We aim to acknowledge reports within 48 hours and provide a fix within 7 days for critical issues.
Genesis is a self-modifying AI agent, which makes its security model uniquely important. The system employs ten layers of defense-in-depth:
main.js, preload.js, preload.mjs, and src/kernel/ are SHA-256 hash-locked at boot. The agent cannot modify, delete, or replace these files. SafeGuard.lockKernel() enforces this at every write operation.
Five additional agent files are hash-locked via SafeGuard.lockCritical():
CodeSafetyScanner.js— AST-based code analysisVerificationEngine.js— programmatic result verificationConstants.js— system limits and thresholdsEventBus.js— inter-module communicationContainer.js— dependency injection core
This prevents the agent from weakening its own safety checks through self-modification.
Every piece of LLM-generated code is parsed into an Abstract Syntax Tree (via acorn) and scanned against 20+ rules before being written to disk. This catches:
eval(),new Function(), indirect eval via string concatenation- Kernel file access attempts
process.exit(),require('child_process')outside approved contexts- Electron security flag manipulation (
nodeIntegration: true,contextIsolation: false) - System directory writes
If acorn is not installed, the scanner falls back to regex-only mode and blocks all self-modification as a safety measure.
CapabilityGuard issues scoped, signed tokens to modules. A module requesting fs:write receives a token valid only for that scope. Tokens can be revoked individually or by module. Compromised modules cannot exceed their granted permissions.
The Electron preload script (preload.js) explicitly whitelists every allowed IPC channel. The renderer process can only invoke, send, or receive on declared channels — all others throw errors.
The Electron window enforces a strict CSP:
default-src 'self';
script-src 'self' https://cdnjs.cloudflare.com;
style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com;
connect-src 'self';
This blocks execution of any injected script even if other layers are bypassed.
Code execution uses two modes:
- VM mode:
vm.createContextwith frozen prototypes, noprocess/require/evalaccess. For quick evals only — not security-grade. - Process mode: Fork-based execution with timeout (15s), memory limit (128MB), and blocked module list.
- Linux Namespace mode: Full PID/Network/Mount/IPC isolation via
unshare(when available).
MCP Code Mode executes user code in a worker_thread with no require/process/fs access, 64MB heap limit, and hard-kill on timeout. Tool calls are bridged via postMessage RPC — the worker never touches McpClient internals directly.
Per-MCP-connection CircuitBreaker wraps every tool call. Configurable failure threshold, cooldown period, retry logic, and timeout detection. State machine: CLOSED → OPEN (rejects fast) → HALF_OPEN (probe) → CLOSED. Prevents cascading failures from degraded external services.
Monitors self-modification patterns for anomalies. Detects unusual file change frequency, kernel-adjacent modifications, and code safety regressions. Integrated with DreamCycle for pattern consolidation.
- IPC Rate Limiting — Per-channel token bucket prevents abuse from compromised renderer
- IPC has() Guards
v4.12.7— Allcontainer.resolve()calls in IPC handlers checkcontainer.has()first to prevent throws during degraded boot - Atomic Writes — All file operations use temp-file + rename to prevent half-written files
- Shell Blocklist — ShellAgent blocks dangerous commands (
rm -rf /,format,mkfs, etc.) - Peer Network Encryption — AES-256-GCM with PBKDF2 (600K iterations) for inter-agent communication
- Module Signing — HMAC-SHA256 signatures track self-modified vs. original modules
- Kernel Integrity Checks — Periodic SHA-256 verification of all locked files during runtime
- API Key Masking
v4.12.4— Settings IPC handler deep-clones and masks API keys before sending to renderer - Dashboard XSS Hardening
v4.12.4— All dynamic strings in DashboardinnerHTMLescaped via_esc()sanitizer - SSRF Protection
v4.12.4— McpTransport blocks connections to private IPs, loopback, link-local, and numeric IP obfuscation - Streaming Backend Hardening
v4.12.7— All backends track consecutive JSON parse errors and warn at threshold ≥3 - Safety Coverage Gate
v4.12.7—npm run test:coverage:safetyenforces 80/70/75 on kernel + safety-critical modules - Eval Alias Detection
v4.12.6— CodeSafetyScanner detectsconst e = eval; e()aliasing via AST VariableDeclarator/AssignmentExpression rules - Peer Import Hardening
v4.12.6—child_processandprocess.envare hard blocks (not just warnings) for peer-imported skills
| Threat | Mitigation |
|---|---|
| Agent weakens its own safety | Hash-locked critical files (Layer 2) |
| LLM generates malicious code | AST scanner (Layer 3) + sandbox execution (Layer 7) |
| Renderer-side XSS/injection | CSP (Layer 6) + contextIsolation + IPC whitelist (Layer 5) + Dashboard XSS escape |
| Compromised module escalates privileges | Capability tokens with revocation (Layer 4) |
| Agent escapes project directory | SafeGuard blocks writes outside rootDir |
| Shell command injection | execFile with array args (no shell interpolation) |
| Peer imports malicious code | Schema validation + AST scan + hard-block on child_process/process.env |
| Eval aliasing bypass | AST VariableDeclarator + AssignmentExpression detection (v4.12.6) |
| MCP SSRF to internal services | Private IP / loopback / link-local blocking in McpTransport |
| API key leakage to renderer | Deep-clone + mask before IPC send (v4.12.4) |
| Service unavailable during degraded boot | IPC has() guards prevent unhandled throws (v4.12.7) |
| Concurrent write corruption | WriteLock (per-file mutex) + atomic writes (temp + rename) |
| Runaway self-repair loops | Circuit breaker: 3 consecutive failures → freeze + require user reset (v4.12.8) |
| Boot crash from self-modification | BootRecovery sentinel + auto-restore from last-known-good snapshot (v4.12.8) |
This security policy covers the Genesis Agent application. It does not cover:
- The security of LLM backends (Anthropic, OpenAI, Ollama)
- The security of the host operating system
- Third-party plugins/skills installed by the user