Skip to main content
Kernle implements defense-in-depth security across storage, sync, and identity layers. Security is not a feature bolted on — it’s woven into the data model itself.

Security Posture

Privacy by Default

Every memory carries privacy fields from creation

Trust-Based Defense

Seed trust with authority gating protects against manipulation

Provenance Protection

Write-once source tracking prevents history rewriting

Privacy Architecture

Every memory type in Kernle carries privacy metadata from creation: Privacy is enforced at query time — memories are filtered based on the requesting context. This means the same stack can serve different contexts (health care, social, work) with appropriate visibility boundaries.
See the Privacy guide for the full privacy model including context-aware filtering and consent-based sharing.

Provenance Protection

Provenance fields are protected to prevent history rewriting: This ensures that the origin story of any memory remains intact. An entity can always trace how a belief was formed, what episodes supported it, and how confidence evolved over time.

Cycle Detection

Circular derived_from references are prevented at write time. A depth-limited recursive walk (max 10 hops) checks for cycles before any memory is saved. This prevents:
  • A belief claiming to be derived from itself
  • Circular chains (A derives from B, B derives from C, C derives from A)
  • Infinite loops during lineage traversal

Trust Layer as Security

The trust system provides structural defense against manipulation:

Seed Trust

Every new SI starts with seed trust templates that establish baseline safety:
The context-injection entry at 0.0 trust with no authority grants is the structural defense against prompt injection — untrusted content in the context window cannot influence belief formation or memory modification.

Authority Gating

Trust thresholds prevent low-trust sources from affecting high-value memories:
Authority gating is advisory, not blocking. The sovereignty principle means the entity always has final say. But trust scores provide calibrated input that helps the entity make informed decisions.

Credential Transport Security (v0.13.01)

The auth CLI blocks credential submission over plaintext HTTP to prevent credential interception:
  • Login and register refuse to send API keys or passwords to non-HTTPS, non-localhost URLs
  • URL validation uses proper hostname parsing (urllib.parse.urlparse) to prevent bypass via crafted hostnames (e.g., http://localhost.evil.com)
  • Localhost exception: http://localhost and http://127.0.0.1 are allowed for local development
  • Sync client already enforced HTTPS for non-local URLs since v0.12

Sync Security

Stack Isolation

All sync operations are scoped to the authenticated stack:
  • Push: Records must include a matching stack_id — the backend rejects cross-stack writes
  • Pull: Only records belonging to the authenticated stack are returned
  • Server-controlled fields: stack_id, created_at, and forgetting fields are server-controlled and cannot be overwritten by client sync

Vector Search Isolation

Embedding IDs include the stack ID ({stack_id}:{table}:{record_id}) to prevent cross-stack information leakage through vector similarity search. This ensures one stack’s memories cannot appear in another stack’s search results, even if the embeddings are stored in a shared index.

Retry and Dead Letter Queue

Failed sync operations are handled with resilience:
  • Failed records increment a retry_count
  • Records with 5+ retries move to a “dead letter” queue
  • Sync continues processing other records after failures
  • Dead letter records can be inspected and cleared

Diagnostic Security

The doctor pattern follows strict privacy boundaries:

Structural Findings Only

Diagnostic output contains structural references, not content reproduction:
The doctor sees structure, not content. The entity reviews specific memories only when the doctor points to them by ID. Diagnostic sessions require consent: For operator-initiated sessions, the entity is notified and can set access restrictions. The trust system gates access: gate_memory_input(source_entity="stack-owner", action="diagnostic_session") must pass.

Audit History

Kernle undergoes periodic security audits. The v0.2.4 audit (February 2026) covered: Key security features added from audits:
  • Provenance protection: Write-once and append-only fields
  • Vector search isolation: Stack-scoped embedding IDs
  • Sync field validation: Server-controlled fields cannot be overwritten
  • Array merge limits: Merged arrays capped at 500 items to prevent resource exhaustion

Best Practices

1

Use seed trust

Initialize stacks with seed trust templates. The context-injection entry at 0.0 trust is critical for prompt injection defense.
2

Set trust before sharing

Before sharing stacks or allowing external input, configure trust assessments for known entities with appropriate authority grants.
3

Run diagnostics regularly

Use kernle doctor to check for structural issues like orphaned references, low-confidence beliefs, and stale relationships.
4

Monitor anxiety

High anxiety scores can indicate security-relevant issues like unsaved work or unprocessed entries that haven’t been reviewed.
5

Review sync failures

Check dead letter queue periodically for sync failures that might indicate authentication or data integrity issues.