OpenEarth AI Bridge

Transparent bridge daemons that record AI, ML, and legal interactions as signed Matrix events. Two-level compliance architecture: an HTTP proxy observes reasoning at the API boundary; system hooks observe actions at the runtime boundary. Every event feeds the same auditable Matrix timeline.

⏳ Coming soon on Codeberg AGPL-3.0 (chosen, not forced) Kotlin + Python · Trixnity · matrix-nio

What it is

A family of bridge daemons that sit between an AI/ML/legal service and the user, recording every interaction as an foundation.protocols.* Matrix event. The daemons are transparent: the user continues to use the underlying service (Claude Code, Hopsworks, Ansvar MCP servers) with no workflow change; the bridge records everything as a side effect.

The AGPL-3.0 license is chosen, not forced — none of the bridge code links to AGPL dependencies. The choice is strategic: it prevents cloud providers from taking the bridge and offering it as a closed managed service without contributing back.

The two-level compliance architecture

Level 1 — HTTP API proxy (intention layer)

Sits between Claude Code and Anthropic's API. Observes every prompt sent, every completion received, every tool call requested. Records what the AI was instructed to do and what it proposed to do.

Events: foundation.protocols.ai.claude.* (42 types) + foundation.protocols.ai.claude.hook.* (5 types)

Level 2 — System hook observer (action layer)

Hooks into Claude Code's tool execution (Read, Write, Bash, etc.) via gryph. Records what the AI actually did at the runtime boundary — which files were read/written, which commands were executed, what they returned.

Events: foundation.protocols.ai.observation.* (15 types) + foundation.protocols.ai.gryph.* (15 types)

Correlation / certification layer

At session end, a correlation engine compares intention (Level 1) vs action (Level 2). Matches indicate a well-behaved session; divergences are audit signals (hallucination, silent action, transport failure). Emits certification verdicts.

Events: foundation.protocols.ai.certification.* (4 types) · correlation via foundation.protocols.verify.v1 rel_type

This two-level observation is the core design insight: no single observation point is sufficient. An API-only observer sees what Claude said it would do but not what happened after the API returned. A hook-only observer sees what happened but not what was asked for. Together they form a verifiable record.

Bridge families

Claude Bridge

Kotlin + Trixnity 4.22.7. HTTP proxy + MCP Bridge Proxy for intention capture. Correlation engine. 85 events (42 claude + 15 observation + 15 gryph + 5 hook + 4 certification + 4 adjacent).

Hopsworks Bridge

Python + matrix-nio + hopsworks-api. Monkey-patches the Hopsworks SDK to emit events on feature group writes, training runs, model registrations, deployments. 37 events, 44 unit tests.

Ansvar Bridge

Python MCP proxy. Observes Ansvar MCP server calls (Swedish law databases) and records queries + responses. 11 events. Apache-2.0 source, bridge daemon AGPL-3.0.

Governance events

foundation.protocols.ai.governance.*17 events for AI Act compliance (Article 9, 12, 13, 14, 50 mapping). Emitted by the bridge on detection of regulated flows.

How it works — walkthrough

User launches Claude Code on their laptop
       │
       ▼
Claude Code → HTTP Proxy (bridge daemon)  ──►  Anthropic API
                   │
                   ▼
       Emits foundation.protocols.ai.claude.session.start, request, response events
       to the user's Matrix room (E2EE, federated homeserver)
                   │
                   ▼
Claude Code proposes a tool call (e.g., Write /etc/hosts)
                   │
                   ▼
Gryph hook intercepts before execution → emits foundation.protocols.ai.gryph.*
                   │
                   ▼
If a policy Check blocks: hook returns exit 2, tool call aborts
If allowed: tool executes, hook records result as foundation.protocols.ai.observation.*
                   │
                   ▼
Session end → correlation engine runs → certification verdict emitted
                   │
                   ▼
Matrix room now contains full auditable timeline:
   intention (claude.*) + action (observation.* + gryph.*) + verdict (certification.*)

Design principles

Release status

OpenEarth AI Bridge is in active development. Source currently on GitLab (internal) during pre-release integration. Target: public release on Codeberg under AGPL-3.0.

Copyright 2026 VakeWorks AB and the OpenEarth contributors. Licensed under AGPL-3.0. Dual commercial licensing available — the bridge does not link to AGPL dependencies, so commercial re-use without AGPL is possible via VakeWorks.