Behavioral trust engine

Query trust,
not just data.

CBQL scores every session against 34 behavioral signals in real time, so you can tell a human from a script without asking either one to prove it.

cbql ยท live_streamIdle
1

About CBQL

Y

Youssef Emad

Software & ML Engineer ยท Founder of CertiLayer

CBQL was born out of a real problem: there was no good way to query behavioral biometrics data. SQL was too generic, and writing custom filters in Python was slow and error-prone.

So I built CBQL โ€” a hand-written query language in Rust with a Python binding, a CLI REPL, and a desktop app. It's the query engine powering CertiLayer's behavioral analysis pipeline.

Built for behavioral data

Everything SQL cant do for time-series behavioral streams.

SQL-like syntax

Familiar syntax for anyone who knows SQL. SELECT, WHERE, GROUP BY, LIMIT โ€” all work as expected.

Real-time streaming

STREAM queries run continuously against live behavioral data. Built for fraud detection and anomaly detection.

Pattern matching

SEQUENCE OF click โ†’ scroll โ†’ idle detects complex behavioral patterns that SQL can't express.

Rust-powered engine

Hand-written lexer, parser, and execution engine in Rust. No external parser generators. Zero dependencies on query tools.

Python bindings

pip install cbql and use CBQL from Python. Works with pandas, numpy, and any ML pipeline.

Multiple sources

CSV, PostgreSQL, Kafka, and CertiLayer API. Same syntax for all sources โ€” the adapter handles the rest.

CBQL โ€” Certified Behavioral Query Language

See it in action

Real CBQL queries running against live behavioral session data.

LIVE
Flag sessions crossing a risk threshold
Query
SELECT *
FROM sessions
WHERE risk_score > 80
Results โ€” 2 rows8ms
user_idhcs_scorerisk_scoretyping_speed
20.490280
30.585310
Reference/CBQL v1.0.0

Documentation

The complete syntax reference for CBQL โ€” the query language behind CertiLayer's behavioral event pipeline.

/

Statements

5 features

The top-level entry points of a CBQL query.

SELECT
SELECT * FROM <source> WHERE <condition>

Query rows from a data source with optional filtering, ordering, and limiting.

Example Usage
SELECT * FROM sessions WHERE hcs_score < 0.4 ORDER BY ts DESC LIMIT 20
FIND
FIND <source> WHERE <condition>

Search for rows matching a condition. Similar to SELECT but optimized for point lookups.

Example Usage
FIND devices WHERE fingerprint = "a1c9โ€ฆ"
STREAM
STREAM <source> WHERE <condition> WITHIN last N minutes

Run a continuous query against a live event stream.

Example Usage
STREAM events WHERE risk = "high" WITHIN last 5 minutes
SEQUENCE
SEQUENCE OF event -> event -> ... WITHIN last N minutes

Detect ordered behavioral patterns โ€” e.g. click โ†’ scroll โ†’ idle.

Example Usage
SEQUENCE OF click -> scroll -> idle WITHIN last 2 minutes
MATCH
MATCH event -> event -> ...

Alias for SEQUENCE. Shorter syntax for pattern matching.

Example Usage
MATCH keypress -> keypress -> pause

Clauses

6 features

Modifiers that refine what a statement returns.

FROM
FROM <source>

Specifies the data source. Required in SELECT.

WHERE
WHERE <field> <op> <value>

Filters rows. Supports AND, OR, NOT. Operators: =, !=, <, <=, >, >=

WITHIN
WITHIN last N minutes|hours|days|seconds

Time window for filtering. Also supports SINCE and BETWEEN.

GROUP BY
GROUP BY <field>

Groups rows so aggregate functions can be applied per group.

ORDER BY
ORDER BY <field> ASC|DESC

Sorts results by a field, ascending or descending.

LIMIT
LIMIT <n>

Caps the number of rows returned.

Functions

5 features

Aggregations available inside SELECT and GROUP BY.

AVG
AVG(<field>)

Returns the average value of a numeric field.

COUNT
COUNT(<field>)

Returns the number of matching rows.

MAX
MAX(<field>)

Returns the maximum value.

MIN
MIN(<field>)

Returns the minimum value.

SUM
SUM(<field>)

Returns the sum of a numeric field.

Download CBQL

Free desktop app for Mac and Windows. No account required.

macOS

Apple Silicon (M1/M2/M3/M4)

Download .dmg

Windows

Windows 10/11 (64-bit)

Download .msiDownload .exe installer

Installation

macOS

1. Download the .dmg file

2. Open the .dmg

3. Drag CBQL to Applications

4. Open CBQL from Applications

Windows

1. Download the .msi or .exe

2. Run the installer

3. Follow the setup wizard

4. Launch CBQL from Start menu

Also available as a Python package:

pip install cbql (coming soon)