Hold yourdata up tothe light.

assay runs read-only SQL checks on PostgreSQL, on a schedule. A check should return nothing: every row it returns is a problem, and a query that breaks never passes for clean.

No sign-up. A sample shop database with problems planted in it. Apache-2.0.

Run · Oct 19, 23:00 UTC Duplicate orders returned 6 rows: orders 1–6 and their copies 1501–1506, same customer, same total, placed 40 seconds apart, 1,500 rows apart on the same film.

One run, read on the light box.

Every run takes the same four steps, whether a schedule, a person or an agent starts it.

  1. The check's SQL is validated as read-only when it is saved and again before every run, then runs in a read-only transaction under a statement timeout, 30 seconds by default. This one asks for every product whose stock is below zero.

  2. No rows is a clear film: Clean. Rows are marks of light: Issues. In the live demo's run of Oct 19, 23:30 UTC, three products were below zero.

  3. Every row is matched with the previous run, so you see what changed: lit on both films is still open, lit only on the new film is new, lit only on the old one is fixed.

  4. An alert goes out only when something changed: new rows, a query that breaks, a check that is clean again. It goes to Slack, Discord, Telegram, Feishu, WeCom or a webhook.

Film of demo.inventory, all 60 rows. The run of Oct 19, 23:30 UTC returned three: SKU-0007 Chair 7, SKU-0023 Mouse 23 and SKU-0041 Mouse 41, each with on_hand -3. Laid over it, an example of the next run: SKU-0052 Keyboard 52 is new, SKU-0007 and SKU-0041 are still open, SKU-0023 is fixed.

Negative inventorycheck · SQL

1SELECT p.sku, p.name, i.on_hand, i.reserved2FROM demo.inventory i3JOIN demo.products p ON p.id = i.product_id4WHERE i.on_hand < 05ORDER BY i.on_hand;

BEGIN READ ONLYstatement_timeout 30 s by default

Run · Oct 19, 23:30 UTC

3rows Issues

skunameon_handreserved
SKU-0007Chair 7-34
SKU-0023Mouse 23-32
SKU-0041Mouse 41-30

A real run of the live demo.

Example Next run, 30 min later

  • 1newSKU-0052
  • 2still openSKU-0007 SKU-0041
  • 1fixedSKU-0023

A row is matched by all of its values.

assay00:00

Negative inventory: 1 row new

Now returns 3 rows
1 new, 2 still open, 1 fixed

Open checkAcknowledgeMute 24 h
Example Slack, through the assay app: the words are exactly what assay sends. Acknowledge and Mute appear only there and in Telegram.

Reading never
changes the part.

Radiography tests a weld without touching it. A check reads your database the same way: SQL that could write is refused, and the run is read-only all the way down.

DELETE FROM demo.payments
WHERE amount = 0;

Validator · refused on save

"DELETE" is not allowed. Checks can only read data.

  1. Validator: On save and before every run. Only SELECT, WITH, EXPLAIN or DO. 32 keywords and 23 functions with side effects are refused.

  2. BEGIN READ ONLY: Every run is one read-only transaction. Each statement runs alone, so a second one cannot ride along.

  3. Statement timeout: PostgreSQL stops a check that runs too long: 30 s by default, 1 to 255 s. A stopped check is Broken.

  4. SELECT-only role: Recommended. Connect as a role that can only read. Test connection warns you when the role could write.

A check draft with DELETE FROM demo.payments is refused by the validator before it can be saved. Behind it, four layers; the last is recommended.
  • Secrets sealed

    Connection strings and channel secrets are encrypted at rest (AES-256-GCM), never returned by the API and never logged.

  • Private hosts refused

    Data sources on private, loopback or link-local addresses are refused unless you allow them.

  • AI never gets the row values

    Triage runs only when you ask. It gets the SQL, the schema and a column profile, never the rows a check returns. An error message or a literal in your SQL can still quote a value.

A check should
come back empty.

A check is one read-only query, and every row it returns is a problem. A run ends one of three ways, and the three never look alike.

  1. Clean0 rows

    The query read the table and returned nothing. That is the state you want.

    Refunds larger than payment · Sep 29, 11:55 UTC

    1. 120840.1008-15 19:09:17
    2. 21051321.4809-16 21:56:22
    3. 3121975.3308-03 07:14:30
    4. 456226.6207-19 20:10:06
    5. 5147166.1408-30 04:30:43
    6. 6159839.1008-05 18:09:14
    1. 150120840.1008-15 19:09:57
    2. 15021051321.4809-16 21:57:02
    3. 1503121975.3308-03 07:15:10
    4. 150456226.6207-19 20:10:46
    5. 1505147166.1408-30 04:31:23
    6. 1506159839.1008-05 18:09:54

    Issues6 rows

    Every lit row is a problem. Orders 1 to 6 were placed again 40 seconds later as 1501 to 1506.

    Duplicate orders · Oct 19, 23:00 UTC

  2. Query failed · nothing readcolumn "shipping_status"
    does not exist

    Brokenquery failed

    The query itself failed, so nothing was checked. A failed query never passes for clean data.

    Shipping status check (broken) · Sep 29, 11:55 UTC

Real runs of the demo workspace’s checks (scripts/demo).

Reviewed by people.
Explained by AI.
Read by agents.

A check from anyone but an admin waits for review before it runs. AI explains a broken run when you ask. Agents read the same checks through MCP.

  1. New check · alex@example.com

    Orders without items

    “Checkout sometimes creates an order before its items are written.”

    SELECT o.id AS order_id,
           o.status, o.created_at
    FROM demo.orders o
    WHERE NOT EXISTS (
      SELECT 1
      FROM demo.order_items oi
      WHERE oi.order_id = o.id);
    Pending

    Waiting for a manager or an admin

    Approval history · reviewed by admin@example.com

    Approvedriley@example.com

    Negative inventory · edit “Looks good.”

    Rejectedcasey@example.com

    All customers · new check “A check should return only rows that need attention, not a full export.”

    1Review before it runs

    Creating a check, deleting one or editing someone else’s waits for a manager or an admin. Every decision is kept with its comment.

  2. Shipping status check (broken)

    Brokenthe query failed, nothing was read

    ERROR column "shipping_status" does not exist

    SELECT id AS order_id,
           shipping_status
    FROM demo.orders
    WHERE status = 'shipped'
      AND shipping_status IS NULL;
    Problem in the checkExample

    The query is wrong, not the data: demo.orders has no shipping_status column.

    Next step: find the column that holds the shipping state, then update the query.

    Sent to the model
    the SQL, the error, the schema
    Never sent
    the returned rows (an error message or a literal in the SQL can still quote a value)

    2AI triage, when you ask

    Ask on a broken or flagged run: triage says whether the query or the data is wrong. The model reads the SQL, the error, the schema and, if rows came back, a column profile (types, nulls, distinct counts). Never the returned rows, though an error message or a literal in the SQL can quote a value. AI stays off until you turn it on.

  3. POST /api/mcpExample

    list_checks {"status": "broken"}

    { "count": 1, "checks": [{
      "id": "demo-broken-shipping-check",
      "name":
        "Shipping status check (broken)",
      "status": "broken", "rows": null,
      "since": "2026-09-24T09:57:35.999Z",
      "last_run_at":
        "2026-09-29T11:55:47.394Z",
      "schedule": "manual", …
    }] }

    8 tools

    • list_checks
    • get_check
    • list_data_sources
    • get_run
    • list_activity
    • run_check
    • acknowledge_check
    • mute_check

    3Agents through MCP

    Any MCP client, such as Claude Code or Cursor, signs in with OAuth or a personal API key. Eight tools read checks and runs, run a check, and acknowledge or mute an alert. Agents cannot create or edit checks.

Every table, held
up to the light.

The six tables of the demo shop, one line per row. Where a check returned a row, its line is lit.

Generated from the demo seed (scripts/demo/schema.sql): one line per row, shaded by its values where the seed fixes them and by the seed's own ranges elsewhere. Lit: the rows each check returned in its last real run (Sep 29, Oct 19).

demo.customers200 rows

Invalid customer emails 3 rows

demo.products60 rows

Products priced below cost 2 rows

demo.inventory60 rows

Negative inventory 3 rows

demo.orders1,506 rows

Duplicate orders 6 rows

Paid orders without a payment 5 rows

Payment amount mismatch 4 rows

Stale pending orders 74 rows

demo.order_items

Order items with unknown products 2 rows

demo.payments

Refunds larger than payment 0 rows · Clean

Open source.
Runs on your own stack.

Apache-2.0. The plate on the back of the box lists everything assay needs. Fill in .env.local, and five lines get it running on your machine, with the sample shop loaded if you want it.

The rating plate of assay 0.5.0
License
Apache-2.0
Version
0.5.0
App
Next.js 16, Node 22.19+
Store
MongoDB, for checks, runs and users
Reads
PostgreSQL, read-only
Sign-in
Google or GitHub OAuth
Schedules
A cron expression per check, in UTC
Trigger
QStash, any cron or GitHub Actions, every 30 minutes
Cache
Upstash Redis, optional

Quick startbash

git clone https://github.com/jma49/Assay.gitcd Assay && npm install# MongoDB, PostgreSQL, Better Auth, Google or GitHubcp .env.example .env.local# optional: the sample shop and its checksnpm run seed:demonpm run dev

Then sign in once and make yourself admin: npm run user:set-role -- you@example.com admin

Before you point it
at production.

More answers in the docs
  • PostgreSQL, and anything that speaks its protocol, such as Neon or Supabase. DATABASE_URL is the built-in source; admins add more PostgreSQL databases in Settings, and each check picks one. Connection strings are sealed with AES-256-GCM and never returned or logged.

  • No. The SQL is validated as read-only when the check is saved and again before every run, then runs inside BEGIN READ ONLY with a statement timeout: 30 s by default, settable from 1 to 255 s. For a second lock, give assay a role that can only SELECT; Test connection warns when the role could write.

  • A check that could not run: a syntax error, a renamed column, a timeout, a lost connection. Rows are Issues, a finding. Broken is its own state with its own alert, so a failing query is never read as Clean.

    column "shipping_status" does not exist

  • Only a change sends one: a check breaks, finds rows, gets new rows or is clean again. Alerts go to Slack, Discord, Telegram, Feishu, WeCom or a signed webhook. Telegram, and Slack connected with Add to Slack, carry Acknowledge and Mute 24 h buttons; elsewhere, use the Alerts menu on the check page.

  • AI is off unless the workspace sets AI_ENABLED, and triage runs only when someone asks for it on a run. It gets the check's SQL, the outcome and error, the row count, the schema and a column profile (types, nulls, distinct values). It never gets the row values, though an error message or the SQL itself can quote one.

  • Anyone, unless the workspace limits sign-up to company domains with ALLOWED_EMAIL_DOMAINS. New accounts are viewers; an admin gives out the developer, manager and admin roles.

  • assay is open source under Apache-2.0, with no license fee. You run it yourself, so the costs are the services under it: a host for the Next.js app (the guide uses Vercel), MongoDB, the PostgreSQL you already have and, if you want them, Upstash Redis and QStash. With AI on, its model calls go through your own Vercel AI Gateway account.

Find the rows that shouldn't exist.

Run · Sep 29, 11:55 UTC Refunds larger than payment read demo.payments and returned 0 rows: a clear film.

npm run seed:demo loads the same sample shop into your own PostgreSQL.