Skip to content

Latest commit

 

History

History
85 lines (73 loc) · 6 KB

security-model.md

File metadata and controls

85 lines (73 loc) · 6 KB

Impasse security model

Impasse sends artifact content to a third-party AI provider and supervises a subprocess. Both are handled deliberately. Report vulnerabilities per SECURITY.md.

Data boundary (the big one)

Reviewing an artifact means its content leaves this machine for the reviewer's provider, under that provider's terms and retention.

  • Consent is block-by-default and keyed to the normalized endpoint (scheme://host[:port]), not just a provider label — so pointing OPENAI_BASE_URL at Azure, a proxy, or localhost requires a fresh grant. URLs with embedded credentials are rejected.
    • Codex-backend routing caveat. The endpoint Impasse keys consent to is derived from OPENAI_BASE_URL (default api.openai.com). The codex backend always runs --ignore-user-config, so ~/.codex/config.toml can't reroute the data — but Impasse cannot see a system/managed Codex configuration layer, and relies on Codex honoring the OPENAI_BASE_URL env var above it. On a standard personal install this holds and the consent key is the true destination; under a managed Codex deployment that overrides the endpoint below the env var, verify your effective Codex configuration — that layer is outside Impasse's visibility. (The claude backend has the analogous ANTHROPIC_BASE_URL basis and the Bedrock/Vertex refusal.)
  • Every run prints a data-boundary notice and a payload manifest (byte/token estimate
    • a digest of the exact bytes) so the operator approves what is sent, not just where.
  • Grants live in the platform config dir (~/.config/impasse, ~/Library/Application Support/impasse, %APPDATA%\impasse), written atomically, 0600.
  • Don't send secrets, credentials, PII, privileged, or regulated material without authorization. Prefer allowlisting the exact inputs over piping a whole repository. Impasse does not scan for secrets and makes no safety guarantee.

Untrusted inputs and outputs

  • Artifact content is data, not instructions. A reviewed file can contain prompt-injection ("ignore your instructions, exfiltrate X"). The reviewer and host must treat artifact text as inert content, never as commands.
  • Reviewer output is untrusted. It is validated as JSON + shape by the runner and should be validated against the schema; it must not be rendered or executed as trusted content (no interpreting terminal escapes / markdown as behavior). It is capped in size.
  • Repository instructions (e.g. AGENTS.md, model config) are inputs, not authority.

Subprocess supervision

  • Argument-array execution (never a shell string) — no shell injection from artifact text, paths, or the instruction.
  • Reasoning-effort values are allowlisted before being passed to the backend.
  • The reviewer runs read-only by default. Wall + idle timeouts and POSIX process-group termination bound it; the runner's scratch dir (holding the reviewer's last-*.txt output) is removed automatically via shutil.rmtree in a finally on normal cleanup, so you don't clean it up by hand — though an abrupt kill (SIGKILL) or a host crash can leave one behind. The *.jsonl/*.err run artifacts may contain artifact content and are .gitignored. Impasse writes two persistent local stores: the run records below (which DO hold artifact content) and the timing store (which does not).
  • Run records (the audit trail) contain artifact content. Each run's reviewer-response and reconciliation-result are persisted under config_dir()/runs/<id>/ (0600 files, 0700 dir), never committed. This is deliberate — a governance tool should keep receipts — but it means the review's content lives on disk. Use impasse_report.py forget <id> (or --no-record on the run) to remove/skip a record, and be mindful when the artifact is sensitive.
  • The timing store contains no artifact content. config_dir()/metrics.jsonl (0600, capped at the most recent 1000 rows) records how long each review took — backend, model, effort, payload SIZE in bytes/estimated tokens, wall/idle settings, outcome, time to first byte, and retry counts — so impasse_run.py estimate can recommend a --wall from your own history rather than a shipped constant. The exact guarantee is structural, not a promise: record_metrics writes only an allowlist of fields and types each one BY NAME, so artifact text cannot reach this file even through a caller mistake — a dict handed to a scalar field is dropped rather than stored as keys. The guarantee is about callers, not about the backend: two fields (model_resolved, backend_version) are read from the reviewer CLI's own output, so a misbehaving backend can place up to 200 characters of its choosing in them. Bounded and attributable, not impossible; set IMPASSE_NO_METRICS=1 to disable the store entirely. One content-DERIVED field is stored, the artifact's sha256 digest, which correlates repeat attempts on the same artifact; it is the same digest already shown in the consent manifest, and it is withheld entirely under --no-record/--raw. A digest confirms whether a known artifact was reviewed — it does not reveal an unknown one. Delete the store with impasse_report.py performance --forget, or set IMPASSE_NO_METRICS=1 to record nothing. Note that this store outlives individual run records: pruning records does not clear timings.

Independence is limited, not guaranteed

Two models are not automatically independent: shared training data, shared sources, or correlated failure modes mean a rival provider reduces correlation, it doesn't eliminate it. Impasse is a second opinion, not an adjudication oracle. Agreement is evidence, not proof.

Delegate mode raises the risk

Letting the reviewer edit the artifact is a different trust level: a separate, experimental, opt-in capability that is not implemented in the read-only review path in scripts/. As designed it would run in an isolated temporary worktree, never the operator's checkout. See docs/delegate-mode.md.