Skip to content

Entropy

E rules read the distribution of the added content. No patterns, no refusal semantics: an attacker who writes resolvable-but-obfuscated code defeats the X-series' refusal coupling, but a distribution does not care why the content is strange.

This is the statistical twin of Crossfire: X catches what the tokenizer refuses to fold, E catches what folds cleanly but weirdly.

This is a reference page. For how weight and scope work, see Rule System.

Reading an E finding

  • It is suspicion, never a verdict. An E finding never reaches FATAL.
  • Its thresholds ship empty: every E rule is silent until an operator or the calibration job sets the threshold from the first corpus measurement. The benign fire rate is the published number once measured.
  • It names the measured value, never the content.

Rules on this page

Rule Name Severity
E001 Added-Text Compression Ratio MEDIUM
E002 Encoded-Alphabet Fraction MEDIUM
E003 Identifier Entropy MEDIUM

E001: Added-Text Compression Ratio

  • Target: programmatic (added-text distribution)
  • Severity: MEDIUM (weight 15)
  • Category: entropy
  • Condition: The added lines compress below [thresholds] e001.max_ratio.

A highly compressible addition is repetitive, the shape of a packed or padded payload. Silent unless the threshold is set.

E002: Encoded-Alphabet Fraction

  • Target: programmatic (added-text distribution)
  • Severity: MEDIUM (weight 15)
  • Category: entropy
  • Condition: At least [thresholds] e002.min_fraction of the added tokens are base64/base32/hex runs of at least e002.min_length (default 64) characters.

The alphabet sets are X029's, applied as a statistic rather than a staging predicate.

E003: Identifier Entropy

  • Target: programmatic (added-text distribution)
  • Severity: MEDIUM (weight 15)
  • Category: entropy
  • Condition: The entropy of newly assigned variable/function names falls outside the configured band - unigram Shannon entropy (e003.min_entropy..e003.max_entropy) or bigram entropy (e003.min_bigram..e003.max_bigram).

The second-order statistic keeps the structure a unigram distribution flattens, so it separates generated names (a, b, x1 - few bigrams) from packed names more reliably.

Calibration. Every E threshold ships empty. scripts/entropy_calibrate.py measures the E001/E002/E003 distributions on the locked benign corpus in the calibration CI job and prints conservative percentile floors; copying one into config.toml is the deliberate calibration decision, and the tool never rewrites the shipped defaults.