What is Themis?¶
Themis is a release gate for AI-generated analytics.
An analytics agent can write a SQL query. The SQL can look correct and still be wrong. The query can use a deprecated field. It can read the wrong dataset. It can return a result that does not match the intended behavior.
Themis tests the change before a person releases it.
The problem in one example¶
Suppose a new agent version starts using congestion_surcharge.
DataHub says that the field is deprecated. The candidate query still runs. A normal SQL check may report success. Themis adds the missing context:
- the candidate uses a deprecated field;
- the candidate must pass the replay cases;
- an independent oracle must agree with the expected result;
- the receipt must show the evidence and the policy reason.
The result is QUARANTINE when the critical replay check fails.
What Themis checks¶
| Check | Plain meaning |
|---|---|
| Dataset identity | Did the run use the approved data object? |
| Read-only SQL | Can the proposed query run without changing data? |
| Replay cases | Does the behavior match the expected contract? |
| Independent oracle | Does a separate calculation agree? |
| DataHub evidence | Do schema, ownership, lineage, quality, and lifecycle signals support the run? |
| OpenTelemetry evidence | Can the run be linked to real runtime spans? |
| Policy | What decision follows from all required signals? |
| Receipt | Can a person inspect the exact result later? |
What Themis does not do¶
- It does not deploy an application.
- It does not make a business decision for a team.
- It does not treat an LLM response as a release decision.
- It does not silently replace missing evidence with a guess.
- It does not make a write query safe by changing the query.
Themis and nearby systems¶
| System | Its job | Themis uses it for |
|---|---|---|
| DataHub | Catalog, metadata, lineage, ownership, and quality context | Evidence about the dataset and its meaning |
| Analytics Agent | Natural-language analytics and SQL proposals | An optional candidate SQL artifact |
| DuckDB | Read-only local replay execution | Running SQL against the frozen snapshot |
| OpenTelemetry | Runtime traces, metrics, and logs | Correlation and runtime proof |
| Jaeger | A trace inspection backend in the local deployment | Viewing exported Themis spans |
| Themis | Evidence collection and deterministic policy | The release decision and receipt |
The Analytics Agent and DataHub are inputs to the gate. Themis remains the authority for the release result.
A useful mental model¶
Think of Themis as a reviewer with a checklist:
- What changed? Read the manifest and changed context.
- What data did it use? Check identity and schema.
- What did it do? Run the SQL and replay cases.
- Is the answer independently correct? Run the oracle.
- Can we explain the result? Collect DataHub and trace evidence.
- What should happen next? Apply policy and write the receipt.