The portal's rule editor has a built-in AI assistant that writes .cgr rules and
their .spec.md for you. The assistant is not a chat: it visibly takes over the
editor, types into the panes, clicks Save and Run specs, and hands control back to
you afterwards. Spec runs are the only source of truth — a rule is only "done" once
the sandbox spec runner agrees.
The AI input footer
A single-line input is always visible at the bottom of the editor, with the placeholder
"Beschreibe deine Regel oder fang an zu tippen". You type, in plain language (German or
English), what the rule should do and submit it. Ctrl-K / Cmd-K focuses that input
from anywhere in the editor.
To the left of the input sits the AI quota chip (see Quota) and a
small KI badge. While the assistant is working the input is disabled and a status line
shows what is happening.
The three task types
What happens on submit depends on the current editor state and your input:
- New rule — on an empty editor the assistant generates the spec cases first, then the rule source. It also generates fresh when your input explicitly asks for a new rule even though content exists.
- Refine — with an existing rule/spec the assistant builds on the current state and edits only the affected lines in place rather than re-typing everything.
- Harden edge cases — the adversarial pass (see Hardening).
While authoring, the assistant can query the real Roslyn AST of a C# snippet and the DSL
language server (lint and completions) as tools before it commits to a predicate or a
Kind, which raises first-pass accuracy.
The validation loop
After generating, the assistant starts a spec run and reads its result. When a case is red,
the model receives the full diagnostic (expected, actual, violating entities, diff, trace)
and makes a targeted edit to the affected .cgr lines, then re-runs the spec. This repeats
until everything is green or the plan's iteration limit is reached.
If no green rule is produced after the limit, the assistant stops honestly ("Konnte keine grüne Regel erzeugen." — "Could not produce a green rule.") and leaves the partial result for manual fixing. The iterations within one generation are internal retries and do not each count against the quota.
On non-recoverable provider errors (auth, invalid response, refusal) the run stops with a clear status. Transient errors and rate limits are retried automatically with backoff and cost no generation.
Hardening (finding edge cases)
Once the first spec run for the current revision is green, the ✦ Edge cases finden button
in the spec drawer becomes enabled. Clicking it starts the adversarial pass: the assistant
authors additional spec cases targeting likely blind spots (sibling APIs, nameof,
look-alikes) and adapts the rule until all cases — the original ones plus the new ones — are
green again. The harden pass counts as its own generation.
Stop and interrupt
While the AI is active, a Stop button appears in the editor's top bar. Clicking it cancels the run immediately and cleanly; edits already typed remain, and the editor is yours again.
If you type while the AI is working, it pauses immediately. After three seconds of inactivity an inline prompt above the footer asks "Soll ich aufbauend auf deine Änderungen weitermachen?" ("Shall I continue building on your changes?") with Ja / Nein / Neuer Intent. Ja continues from your changed state (via the refine path), Nein dismisses, Neuer Intent returns focus to the input for a fresh request.
Quota and counting
AI generations are capped per plan and calendar month. The counting rule is simple: one generation = one submitted intent that runs through to a finished rule (success or final failure). The internal iterations within a generation do not count. The harden pass is its own generation. Provider-side failures (transient, rate-limited, auth) do not consume a generation.
The footer chip always shows used/limit. At 80% it turns amber and shows an inline line
"Noch N von M Generierungen diesen Monat" ("N of M generations left this month"); the input
stays usable. At 100% the input is disabled (placeholder "Monatslimit erreicht" — "monthly
limit reached") and a single nudge links to your subscription/billing page.
The monthly limits are plan-dependent (Trial 5, Starter 25, Team 50, Business 125, Enterprise 500, extendable individually by contract); the per-generation iteration depth scales the same way (Trial 3, Starter 4, Team 5, Business 10, Enterprise unlimited).
Next
- Getting started — the overview of writing rules.
- DSL grammar — the formal language reference the assistant also follows.
- test (spec testing) — how spec runs check hit/miss cases against a rule.