Your First Check
This page explains what happens inside vyb check — the scanning logic, how patterns are matched, what the exit codes mean, and how to read the Evidence Pack that is produced on a passing run.
What vyb check scans
By default, vyb check diffs the current HEAD against the merge base of the default branch. It evaluates every changed file line-by-line against every active rule in .vyb/spec.yaml.
vyb check
├── Reads .vyb/spec.yaml
├── Computes diff (HEAD vs. merge base)
├── For each changed file:
│ └── For each active rule in spec:
│ └── Test pattern against added/modified lines
├── Aggregates violations by severity
├── Writes Evidence Pack (if no block violations)
└── Exits with 0 (pass) or 1 (block violation found)
Rules are only tested against added or modified lines, not deleted lines. Removing a banned pattern is always safe.
Pattern matching
Each rule defines a pattern field — a regular expression tested against each line. For example:
rules:
- id: sec-001
name: no-eval
pattern: "eval\\("
severity: block
The pattern eval\( will match any line containing eval( anywhere in the line. Patterns are case-sensitive by default and match against the raw source text including whitespace.
Multiline patterns
Some rules need to match across lines — for instance, detecting a function signature followed by a forbidden body. Use the pattern-mode: multiline option:
rules:
- id: sec-007
name: no-hardcoded-secrets
pattern: "(password|secret|api_key)\\s*=\\s*['\"][^'\"]{8,}"
pattern-mode: multiline
severity: block