Skip to content
Niki v0.11.0: TUI redesign, Go rewrite, and platform hardening.Read the release notes
niki
Esc
↑↓navigate↵open⌘Jpreview
On this page

Security Architecture

The defense-in-depth isolation and security posture of NIKI.

Security Architecture & Posture

NIKI treats all repositories and agent-generated commands as untrusted input.

To protect developer machines and production codebases, NIKI enforces a strict multi-layer defense-in-depth security model:

┌─────────────────────────────────────────────────────────────┐
│                      Host Environment                       │
│  - OS keyring storage (not resolved by runtime providers)   │
│  - Spend caps enforced at stage boundaries                  │
│  - Git safety proof protects existing branch refs            │
└──────────────────────────────┬──────────────────────────────┘
                               │ Repository bind-mounted at /workspace
┌──────────────────────────────▼──────────────────────────────┐
│             Docker / Podman Container Backend               │
│  - Default discovery: rootless, then rootful fallback      │
│  - Dropped Linux capabilities (`CapDrop ALL`)               │
│  - PID, memory, and CPU limits                              │
│  - Network egress blocked by default                        │
│  - Narrow global command deny-list                          │
└─────────────────────────────────────────────────────────────┘

Security Invariants

  1. Scoped Outbound Traffic: Provider calls are the baseline, but NIKI can also pull sandbox images, contact DuckDuckGo (niki research), fetch configured knowledge URLs, export OTLP, or use the remote MCP client. The current pipeline constructs an empty MCP manager, so configured MCP servers are not executed by a run.
  2. Secret Redaction: Common API-key, bearer-token, password, and credential patterns are redacted from provider output and rendered reports.
  3. Git Safety Is Not Sandbox Proof: safety_proof.json checks branch preservation, parentage, and history rewrite/force-push signals. It does not prove container settings or isolation, and the working tree is intentionally updated with the final diff.
  4. Backend Boundaries: Rootless operation is a default discovery preference, not a guarantee; DOCKER_HOST can override socket discovery. Container runs modify the bind-mounted repository, while the worktree backend runs host-local processes without a container.

Was this page helpful?