Compliance Agent

Evaluates a script against admin-defined organizational rules. Three rule kinds, each with distinct evaluation semantics and cost.

Rule kinds

kindEvaluationBest for
regexDeterministic. Compiled with new RegExp(pattern, flags). Pass = (matches XOR negate). No LLM call.Hard rules: forbid DROP TABLE, require BEGIN/COMMIT, enforce naming.
llmRule name + description go to the model; it returns pass/fail + evidence + reason.Judgment: "no PII columns without encryption", "changes must carry a purpose comment".
hybridRegex first. Regex pass → done, no LLM call. Regex fail → LLM confirms or exonerates.Fast common case; model only adjudicates borderline matches.

Per-rule fields

patternNegate

Default (false): script fails when the pattern matches, forbidden constructs.

negate=true: script fails when the pattern is missing, required clauses (e.g. BEGIN[\\s\\S]*COMMIT with negate=true to mandate transaction wrapping).

Overall pass

pass = !checks.some(c => !c.pass && c.severity === 'error'), only error-severity failures block; warnings and info are advisory.

Management

Left navigation → Compliance Rules (admin / release_manager only). Sortable rule table with an editor modal covering the full rule shape.

Seed rules