Native integration · Shipped and tested

Mneme HQ + Google Antigravity

A native pre-tool adapter enforces Mneme’s architectural decision corpus inside Google Antigravity. It translates Antigravity’s file-mutation tools into Mneme’s canonical gate and returns deny/no-opinion verdicts over the PreToolUse hook transport — verified live against Antigravity IDE 2.8.1.

Status: shipped, merged, tested

The adapter merged on August 24, 2026 (PR #316) and lives at mneme/integrations/antigravity/adapter.py. It carries 31 focused tests covering translation, gate verdicts, fail-open semantics, modes, no-opinion paths, invocation contract, and identity pins. Full suite at merge: 780 passed / 5 skipped versus an attached-equivalent baseline of 749/5 — +31 new tests, zero regressions.

This page describes a shipped integration. Earlier versions of this page described a conceptual “works alongside” flow. That flow no longer exists — what ships today is a concrete adapter with a tested runtime contract.

How it works: a translation layer, nothing more

The adapter implements no governance semantics of its own. Materialization, introduced-delta selection (ADR-018), memory discovery, mode resolution, verdict parsing, and reason formatting are imported from the existing Claude Code hook module — the same enforcement path, behind an Antigravity-specific normalizer:

Antigravity PreToolUse payload
   
Normalizer: write_to_file / replace_file_content /
            multi_replace_file_content
   
Canonical Write / Edit / MultiEdit ToolEvent
   
Introduced-content materialization + mneme check
   
{"decision": "deny", "reason": ...}  or  {}  (no opinion)
Antigravity toolCanonical gateTranslated arguments
write_to_fileWriteTargetFile, CodeContent
replace_file_contentEditTargetFile, TargetContentReplacementContent
multi_replace_file_contentMultiEditReplacementChunks[].TargetContent.ReplacementContent

Read-only tools never reach the gate. If mneme check changes, this adapter follows automatically — it is not a second enforcement implementation.

Setup

Create .agents/hooks.json inside a governed project (one with a committed .mneme/project_memory.json):

{
  "mneme": {
    "PreToolUse": [
      {
        "matcher": "write_to_file|replace_file_content|multi_replace_file_content",
        "hooks": [
          {
            "type": "command",
            "command": "python -m mneme.integrations.antigravity",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

Allow/deny semantics: deny is the only active decision

Antigravity’s response contract differs from Claude Code’s in one important way: emitting "allow" auto-grants the tool call, bypassing the normal permission flow. The adapter therefore never emits it:

Mneme outcomeAdapter output
Trusted PASS / SKIP{} — no opinion; Antigravity’s own permission flow stays in charge
Trusted WARN/FAIL, strict mode{"decision": "deny", "reason": ...} with Mneme’s violation report
Trusted WARN/FAIL, warn mode{}; violation report on stderr — never blocks
Unparseable verdict / operational failure / incomplete evaluation{} (fail open), reason on stderr

Every code path emits exactly one parseable JSON object to stdout. Antigravity fails closed on hook output it cannot parse — malformed output blocks the tool call — so the adapter must always emit well-formed JSON even when it has no opinion.

Verified runtime contract (Antigravity IDE 2.8.1)

Limitations

Evidence

FAQ

Is the Mneme Antigravity integration shipped?
Yes. The adapter merged in PR #316 with 31 focused tests; the full suite ran 780 passed / 5 skipped with zero regressions against baseline. It is a thin translation layer that reuses the same enforcement path as the Claude Code hook.
Which Antigravity tools does Mneme gate?
Three mutation tools: write_to_file (translated to Write), replace_file_content (Edit), and multi_replace_file_content (MultiEdit). Read-only tools never reach the gate. Shell commands are not covered.
Does Mneme ever emit an allow decision to Antigravity?
No. Emitting allow would auto-grant the tool call and bypass Antigravity’s normal permission flow. On PASS or SKIP the adapter emits {} (no opinion) so Antigravity’s own permission layer stays in charge; only trusted WARN/FAIL in strict mode produces a deny.
Which Antigravity versions are verified?
The runtime contract was verified live against Antigravity IDE 2.8.1: hooks.json in .agents/, PreToolUse firing before execution with the full proposed content, and a live deny preventing a filesystem mutation.

Govern Antigravity sessions at the pre-tool boundary

Open-source. Repo-native. One decision corpus enforced through Antigravity’s native PreToolUse transport — with the same deterministic engine behind the Claude Code hook and CI gates.