use case

Validate your DSL in CI: reject malformed config in a pull request

the short answer

dslai generates a deterministic parser from your DSL's grammar, so you can validate DSL or config files in CI and fail a pull request on the first invalid one with an exact position and expected token — a reproducible compiler-style check, never an LLM probability.

Custom DSLs and config languages tend to be validated late — at deploy, or at runtime, when a malformed rule has already shipped. By then the error is a production incident instead of a red check on a pull request.

Because dslai builds a real parser from your grammar, validation is exact enough to gate a merge. This page covers using it as a CI check and why a parser, not a model, is the right tool for the job.

exactposition + expected token on every rejection
dslai · playground
# your dsl grammar
rule = "alert " metric
cmp number win? action ;
cmp = ">" | "<" | ">=" ;
number = digit+ unit? ;
✓ grammar parses
guaranteed-valid output
alert cpu > 90% for 5m page on
alert mem >= 8gb notify sre
alert p99 > 250ms scale web
validate input
✗ invalid at pos 14, expected "%"

where this happens in the app

the same grammar generates a deterministic validator — exact and reproducible enough to fail a pull request on malformed dsl.

  1. 1a real parser's verdict: invalid at an exact position with what it expected — a CI-blockable error.
  2. 2generation and validation read from one grammar, so the rules never drift apart.

A check you can actually block a merge on

To fail a build you need a verdict that's deterministic and explainable — the same input must always give the same result, and a developer must be able to see why. An LLM grader fails both tests: it can flip between runs and it can't point to the exact character that's wrong. A parser does both by definition.

dslai's validator returns valid or invalid, the furthest position it parsed to, and what it expected there. That's enough to print a useful CI annotation: 'invalid at position 21, expected "." or " for "' — the kind of message that gets fixed in seconds.

One grammar, generate and validate

The same grammar that constrains generation also drives validation, so the rules your team authors and the rules CI enforces can't drift apart. Update the grammar and both the generator and the gate move together.

That shared source of truth is the point: your DSL is defined once, and everything — playground, generation, CI — reads from it.

frequently asked

How would this run in CI?
Conceptually: point the validator at your changed DSL/config files and exit non-zero on the first invalid one, printing the position and expected token. A hosted CI check is on the roadmap; the engine that powers it is the same one in the free playground.
Why not validate with the LLM that generated it?
Because a model can be confidently wrong and isn't reproducible, so it can't safely block a merge. A parser gives the same verdict every time and names the exact failure.
Does it work on config languages, not just DSLs?
Yes — any language you can express as a grammar, including typed key=value config, route definitions, or alert rules. If a parser can describe it, dslai can validate it.
What does an invalid result look like?
Invalid plus the furthest position reached and what was expected there — for example, invalid at position 14, expected "%" or " for " but got "x".

Last updated June 7, 2026

ready to try dslai?

open dslai