Architecture

One codebase. Two engines. One security boundary.

Ports-and-adapters throughout, so the same policy engine, catalog, auth, and agent layers run on embedded SQLite or Postgres — selected by config, not a rewrite.

Components

CLIENTS MCP server CLI REST / agent HTTP gateway request-id · authn · recovery · access-log · security-headers SUBSYSTEMS Data + Recordstables · CRUD · /meta AuthJWT · JWKS · keys Agent layerdocs · memory · advisor Storage · FunctionsRealtime · Dashboard Policy engine — the authorization boundary deny-by-default · rules → parameterized SQL · USING + WITH CHECK DataEngine PORT SQLite adapterembedded · solo tier Postgres adapterscale tier Same rules, same results — one conformance suite proves parity across both engines.

A request, end to end

agent call authnprincipal policy predicateinjected into SQL engineparameterized result or envelope+ remediation Deny-by-default: no matching policy → the request is denied before the engine is touched.

Principles (as constraints)

The policy engine is the crown jewel and the stated highest-risk component. It's fuzz-tested (the compiler never emits a raw literal) and has been through repeated adversarial review. It still warrants an independent audit before storing real data.