Security & Trust Model

Engrams is a local-first command-line binary with zero Engrams cloud infrastructure, zero telemetry, and zero background daemons. Your database lives on disk inside your repository, and data only leaves your machine when you explicitly export it to Git or pass command output into your chosen AI model.

Core Security Principles

  1. Zero Engrams Cloud or Telemetry: Engrams makes no outbound network calls during storage, search, graph rebuilds, or pre-edit checks.
  2. No Background Daemons or Open Ports: Engrams runs as a short-lived process when invoked and exits immediately—eliminating local port scanning or long-lived server state.
  3. Fail-Closed Workspace Isolation: Each repository owns its isolated SQLite database at <workspace>/engrams/context.db, preventing cross-project context bleed.

Explicit Data Boundaries

your-project/
├── engrams/
│   └── context.db          ← Local SQLite database (git-ignored; stays on your machine)
├── engrams_export/
│   └── ...                 ← Optional Markdown export (you control if/where Git pushes it)
└── ...
  • Local Database (engrams/context.db): Stored on your machine and excluded via .gitignore. All Full-Text Search (FTS5) queries and graph analytics execute locally.
  • Git Collaboration (engrams_export/): Running engrams export serializes records to human-readable Markdown so your team can review changes in Pull Requests. Treat engrams_export/ with the same repository access controls as your source code, and never log secrets or credentials into decisions.
  • AI Provider Boundary: When an AI coding tool invokes engrams prime or engrams advise, the resulting JSON enters that AI session's prompt context—governed by your organization's agreement with your model provider.

Structured Output & Untrusted Content Review

Engrams formats every query response as structured JSON rather than raw concatenated Markdown:

{
  "id": 7,
  "summary": "Use PostgreSQL for primary database",
  "rationale": "ACID guarantees",
  "tags": ["db"]
}

Structured JSON keeps metadata fields separated for machine parsing and inspection, though any text imported from external contributors still enters the model's context window when queried. Always review incoming engrams_export/ diffs in Pull Requests before running engrams import on untrusted branches.

Workspace Boundaries

Workspace resolution scans upwards from the execution directory to locate workspace indicators like .git, Cargo.toml, or package.json. The database is resolved relative to this root:

  • When you switch project folders in your terminal or IDE, Engrams automatically opens the database for the active workspace.
  • Decisions and patterns from Project A are physically stored in a separate SQLite file from Project B, ensuring complete isolation.

Auditability via Git

Using the engrams export command, your database content is serialized to plain text Markdown files. This allows your team to review context additions, ADRs, and patterns directly in pull requests before they are merged into the main branch, establishing a secure, auditable history of your project's decisions.