Engine architecture

Parsers, data-flow engines, line-level detectors and how results are merged.

A scan takes the files a pull request changes, runs every applicable analysis on them together, and merges the results into one report per file. The same code path serves pull requests, API submissions and the live demo.

Parsing

Each language has a real parser: the TypeScript compiler for JavaScript/TypeScript, java-parser for Java, and tree-sitter grammars (compiled to WebAssembly) for Python, Go, C#, PHP, Ruby, Kotlin, Rust and C/C++. Files longer than 5,000 lines, and syntax trees nested more than 1,000 levels deep, skip the data-flow engines and are covered by the line-level detectors only.

Data-flow engines

One engine per language walks the syntax tree and tracks which values come from untrusted input and which dangerous calls (sinks) they reach. Engines summarise functions — which parameters reach a sink, which reach the return value — and iterate those summaries to a fixed point, within a file and then across the files of the batch. See Taint analysis.

Line-level detectors

Pattern-based detectors cover what is not a data flow: hardcoded secrets, weak cryptography, insecure configuration, infrastructure-as-code misconfigurations, and language-specific hardening rules (for example a rate limiter keyed on a spoofable header). Where a data-flow engine positively proves a sink safe, the matching line-level finding is withdrawn.

The scan, step by step

  1. GitHub webhook — PR opened or updated
  2. File fetch — Every changed file, async via queue
  3. AI signal scan — AST · git provenance · behavioral
  4. Taint engine — Per-language AST + cross-file data-flow
  5. Secrets, deps, IaC — Credentials · CVEs by reachability · cloud, container & API config
  6. Policy engine — Risk score against merge gates
  7. Attestation gate — Blocks until reviewer sign-off
  8. Check run — Posted to the PR

How the data-flow engines decide

  • Sink-class bitmask model. A taint value is a bitmask of 15 sink classes, not a boolean. A sanitizer clears only the classes it neutralizes — and the trace shows it: htmlspecialchars() before a SQL query is called out, not trusted.
  • Path-sensitive propagation. Branches are walked on cloned state and merged with a may-taint join; a value sanitized on one branch and raw on another is tracked correctly on both.
  • Narrow validation guards. Only unambiguous proofs clear a variable — literal-collection membership, strict numeric checks, equality with a literal, a fully anchored digits-only or character-class pattern. A loose regex match is deliberately NOT trusted.
  • BOLA ownership dominance. An authorization check only suppresses a finding when it actually dominates the sink in control-flow order — not merely present somewhere in the function.
  • Fixed-point call resolution. Call summaries iterate until nothing changes — same-file and across files — so an eight-deep helper chain or a five-file flow converges, with a safety cap instead of an arbitrary round limit.
  • Cross-file flows, one finding. Imports, injected services, Go packages and PHP includes are followed in all ten languages, including Rails autoloading, Kotlin↔Java calls, Rust modules and C/C++ functions across translation units. A flow is reported once, at the caller, listing every file on its path — the callee's duplicate is folded in.

How the AI estimate is built

  • AST structural analysis. Parses source into an abstract syntax tree and scores structural patterns that correlate with LLM output — long function bodies, uniform naming, missing edge-case handling.
  • Git provenance scoring. Scores commit velocity, message entropy, signing rate, and LOC/commit ratio against norms. A 1,300 LOC/commit average from a single author is a signal, not a fact — weighted accordingly.
  • Developer baseline deviation. Tracks each contributor's historical AI%, file count, and commit cadence. A sudden 3× spike in AI content on a PR flags as anomalous even if the absolute score is moderate.
  • AI tool attribution. Detects .cursor/, .claude/, .copilot-instructions, Windsurf config, and inline marker comments to attribute code to specific assistants — not just "AI wrote this" but "Cursor wrote this".
  • Shadow AI detection. Flags AI-tool usage signatures that aren't on your org's approved-tools policy list, confidence-scored, with the affected developers surfaced directly.
  • Cross-file semantic graph. Builds a call graph across the entire PR to catch AI-generated glue code that wires together real modules in unsafe ways — invisible to a per-file tool.

The AI attribution page covers validation and limits.

Results

Findings from all layers are de-duplicated, mapped to CWE, scored for severity and confidence, and rolled up into a per-file risk level (CRITICAL, HIGH, MEDIUM, LOW). The pull request's merge decision is made from those risk levels by the merge gate (see Pull-request integration). The AI-generated estimate is computed alongside, from separate signals (see AI attribution).

Next: Language support →