Skip to content
AI Fabrika

How Fabrika thinks

Not a prompt. A method you can measure.

Defects are found by 17 deterministic checks, counted by code and graded by a rule. The AI model comes later, only in the Plus report. Below: the formulas, the numbers and the limits.

The comparison

A prompt to a general-purpose model, and Fabrika.

You can paste code into a chat and ask whether it is secure. Here is what changes, row by row, with facts from Fabrika's code.

What happensThe methodFabrikaTools and rules, then the modelA prompt to a general-purpose modelCode pasted into a chat
The same code, twicethe same Lite report, byte for byteanswers that can change
Who finds the problems17 deterministic checks, offlinethe model, from memory
An invented problemremoved: every finding has a tool that produced itit reads like a real one
The gradea rule: the worst, from A to Ean opinion in words
What it did not readstated: coverage, skipped lines, files outside the sampleit vanishes without a word
The costthe maximum before starting, the expected cost from real Plus reportsyou find out afterwards
The limitswritten in the reportleft unsaid

The process

From code to report, in six steps.

Each with its own idea, in one line. The model comes in only at step five.

  1. 1

    The tree and its fingerprint

    Fabrika reads the files without running them and computes their fingerprint (SHA-256): the report says which version of the code it read.

  2. 2

    The tools, offline

    17 deterministic checks, always with Fabrika's configuration and never with the project's. Same inputs, same findings.

  3. 3

    One finding, one fingerprint

    Every finding has a 128-bit fingerprint, without the line number. Two tools on the same spot: one single finding, corroborated.

  4. 4

    The grade from a rule

    For each pillar, the worst of its findings, on a scale from A to E. No averages, no weights.

  5. 5

    Plus: the model re-reads

    The curator receives the findings with context chosen by a knapsack and gives one of three verdicts. It cannot add findings.

  6. 6

    Regulations from a fixed chain

    With the Compliance Module every finding is linked to obligations: rule, then CWE, then family. Same finding, same obligation.

The numbers

Measured, not promised.

17Deterministic checksThey produce the findings. The model re-reads them, it does not add any.
0 bytesOf difference between two Lite reportsFlask 3.1.0, two analyses in a row: identical report and SARIF, 159 findings in the same order.
128 bitsThe fingerprint of each findingWith a million findings, the probability that two share the same fingerprint is about 1.5 · 10⁻²⁷.
27 millionRefutations to skip a critical findingHow many projects would have to refute a critical finding, with no confirmation, before Fabrika stopped having it re-read.

Measured on 12 November 2026 on the current code; the number of checks comes from Fabrika's catalogue.

The algorithms

Seven ideas, each with its formula. And the limits.

For each one: what it solves, the idea in plain words, the formula from the current code and a diagram. Technical terms are in the glossary.

The grade

The grade is the worst, not the average.

The sample

Past the line limit, what matters comes first.

Retries

If the provider is overloaded, the wait doubles.

Learned verdicts

Fabrika learns from verdicts, with safeguards that come from the formula.

The limits

What Fabrika does not do, said plainly.

The grade

The grade is the worst, not the average.

What it solves. Saying in one letter how an area of the code is doing, without a serious problem getting lost among many small ones.

The idea. Each finding is worth a grade: E if it is critical or already exploited in real attacks, D if it is high, C if it is medium, B if it is low or sits outside the product, in tests or examples. The area's grade is the worst of its findings; the report's outcome is the worst across the areas. No averages and no weights: an average would say C, and the high finding would disappear.

grade(area)   = max grade(r), r in the area
grade(report) = max grade(area)
A < B < C < D < E

Quality is measured: up to 10 style and type warnings per thousand lines is B, more is C, D if a file does not compile, never E. If a language in the project was read by no tool, no grade is given: it would be a grade on code nobody looked at.

Six findings in one area with their grades: low B, medium C, low B, high D, low B, high in tests B. The area's grade is the worst one, D; an average would say C, and is not used. Below, the grade scale from A to E with D highlighted.

The data flow

Client data, statement by statement.

What it solves. Knowing whether data coming from outside (a parameter, a form field, a header) reaches a dangerous point: an SQL query, a command, a file, a page.

The idea. Fabrika reads the function's syntax tree and keeps the set S of variables that carry the data. An assignment widens or narrows it; a function that neutralises the data (int, escape…) stops it; where the paths split, the union applies, because one path is enough; a check that exits the function removes it.

S₀ = parameters from the client
x = e  →  S ∪ {x}  if e carries the data
x = e  →  S \ {x}  otherwise
if, try  →  S(branch 1) ∪ S(branch 2)
sink(e), e carries the data  →  finding

It does this within one function, without running anything: what passes from one function to another is not seen, and the report does not promise it.

The data flow in four statements: nome comes from the client and enters S; n goes through int, which neutralises it; q joins a query and nome, and enters S; db.execute of q reaches the sink with the data: it is a finding.

The context knapsack

Which lines to send to the model.

What it solves. In Plus the model re-reads each finding with some code around it. Space is limited: which lines should it get?

The idea. Each line has a value (close to the finding, in the same block, with the same names) and a cost, its characters. We take the lines that give the most per character, as long as there is space. First we exclude the ones never worth paying for: long lines with almost no spaces, that is minified code or data.

value = 1 / (1 + distance)
      + 2    if in the same block
      + 1.5  if it has the same names
take by value / characters
while Σ characters ≤ budget
excluded if length ≥ 300
      and spaces / characters < 0.10

Measured on 12 November 2026 on 285,853 lines from four projects: hand-written code is 22% spaces, lines over a thousand characters are 1%. Where the context skips lines, the text the model receives says so.

The context knapsack, lines 40 to 48: 44 is the finding; 41 and 46 get in because they are in the same block, 43 for the same names, 45 because it is close; 42, minified, is excluded; 40, 47 and 48 stay out because the budget is full.

The sample

Past the line limit, what matters comes first.

What it solves. With a line limit, 10,000 or 100,000, Plus does not read the whole project: it has to choose what to read.

The idea. First the lines the Lite sees as problematic: files with a critical or high finding, then by density, that is findings weighted by severity (critical 8, high 4, medium 2, low 1) per line of the file. Then files with routes, then the intricate or sensitive ones (payments, permissions, long functions, nested blocks), then the rest. Files go in whole, in order, as long as they fit; one that does not fit stays out, and the next one is tried. A file longer than the limit is read in the stretch that covers the most weighted findings, not from the first line.

key = (group, −serious,
       −weight / lines, −weight,
       routes, −points, path)
weight = Σ severity · v  (8, 4, 2, 1)
points = 10·sensitive + 5·other signals
       + 5·dynamic constructs
       + ⌊longest function / 20⌋
       + nesting + imported modules

Same project and same limit, same sample. Secrets and dependencies are judged across the whole project, and findings outside the sample stay in the report, to be verified.

The sample beyond the line limit. The order: 1 files with Lite findings, critical and high first, 2 those with routes, 3 the tangled or sensitive ones, 4 the others. Files go in whole, in this order, until the limit is full; those that do not fit, and the tests, stay out.

The expected cost

What the model costs, from real Plus reports.

What it solves. For you, the price of Plus is fixed, in tiers of lines. Behind the scenes, Fabrika needs to know what the model costs it: before starting it computes the maximum, but what will it really cost?

The idea. A straight line: a fixed part plus a cost per thousand lines, with the lines split by the model that reads them. The coefficients are fitted to the Plus reports already run, with least squares on the relative error and no negative coefficients; the interval comes from how far real Plus reports have strayed from the line.

cost = a + Σ b_g · lines_g / 1000
with a ≥ 0,  b_g ≥ 0
min Σ ( cost(x_i) / y_i − 1 )²
high = cost · max(r_max, 1)
            · (1 + 1/√n)

Only Plus reports with the same fingerprint count: prompt, code, model and price list. On 12 November 2026 the log had 0 Plus reports with today's fingerprint and 14 with an earlier one: the expected cost says “to be re-measured” and the maximum applies. An old measurement is not passed off as a new one.

Number-free diagram of the expected cost: real Plus reports around a line with a fixed part a and a slope b in dollars per thousand lines, the interval from the spread around it, wider beyond the measured sizes.

Retries

If the provider is overloaded, the wait doubles.

What it solves. The model provider is sometimes overloaded. Retrying straight away makes things worse; not retrying throws the work away.

The idea. After a temporary failure we wait, twice as long each time. If the provider says how long to wait, that applies, up to two minutes. A real refusal (the spending cap, the credit, the key) is never retried: the job stops and says so.

t_k = 2^k seconds,  k = 1 … 5
    → 2, 4, 8, 16, 32
Σ t_k = 62 s, six attempts in all
retry-after  →  min(requested, 120 s)

No random part: the same sequence, every time.

The waits before attempts two to six, after a temporary failure: 2, 4, 8, 16, 32 seconds, doubling each time, 62 in all. If the provider says how long to wait, that applies, up to 120 seconds. A refusal for a spending cap, credit or key is not retried: the job stops.

Learned verdicts

Fabrika learns from verdicts, with safeguards that come from the formula.

What it solves. In Plus the model re-reads every finding. Certain rules, on certain files, it refutes almost every time: that re-reading could be saved. But when can it be trusted?

The idea. For each type of finding (tool, rule, language, file zone, severity: never code, files, paths, customers or projects) Fabrika counts in how many projects the curator confirmed or refuted it. From those counts comes a cautious estimate, v⁺: the probability that the finding is real, taken at the upper 95%. The re-reading is skipped only if the expected harm of missing a real finding costs less than the re-reading.

v ~ Beta(1 + real, β₀ + refuted)
v⁺ = 95% quantile
skip only if  v⁺ · L(severity) < c
and while  Σ v⁺ (skipped) < 0.05 per Plus

c is the cost of one re-reading, $0.00166; L is the loss from a real finding that is not re-read, from $1.50 for an informational one to $15,000 for a critical one, one order of magnitude per step. Secrets and findings that support a regulation count as critical.

The safeguards come out of the formula. With no confirmation at all, v⁺ ≈ 3/n: skipping a critical finding would take about 27 million projects refuting it, a low one about 27,000. High severities are not skipped as a consequence, not because of a hand-written rule. The diagram shows the same rule after 30 and after 3,000 refutations (v⁺ = 0.092 and v⁺ = 0.001) and the c / L thresholds, one per severity.

It is switched on, and today it skips nothing. Calibration is measured: on the Plus reports kept on 12 November 2026 (3,896 verdicts from four projects) the verdicts of one project do not predict those of another better than chance (AUC 0.42), and indeed the formula skips nothing and does not change the order. With few cases the statistics stay cautious. The more analyses Fabrika runs, the more it learns; but a re-reading costs little and a missed real finding costs a lot, so skips will stay rare.

The same rule after 30 and after 3,000 refutations, on a log scale: v plus goes from 0.092 to 0.0010. The thresholds c over L, one per severity, sit an order of magnitude apart; a check is skipped only left of the threshold: after 3,000 refutations only an informational one.

The limits

What Fabrika does not do.

Stated plainly, as in the report: a method is only as good as its stated limits.

It does not run the code

It reads the files. What can only be seen with the program running (servers, real data, runtime behaviour) stays out: for that you need a penetration test.

Data, within one function

Data flow is followed within a function and loops are read once: data that passes between functions or files can slip through.

The model can be wrong

The curator's verdicts remain a judgement: that is why a “to be verified” weighs on grades like a confirmed finding, and the report says who read what.

Thresholds from few projects

The thresholds come from measurements on our test projects, which are few. They are re-measured when the code, prompt, model or price list changes.

Simple formulas, on purpose

Maximums, orderings, a knapsack, least squares, a Beta distribution: they can be read and checked. No model that learns from your code.

It is not legal advice

Obligations are linked by a fixed chain, but the report does not certify your software's compliance: for doubtful cases you need a professional.

Questions

Questions and answers.

Do you use artificial intelligence?

Yes, in Plus: a Claude model re-reads what the tools found and writes the explanations and the plan. For files with routes and for batches of 30 findings or more it picks Opus, otherwise Sonnet. Lite does not use artificial intelligence. Findings, numbers and grades are not decided by the model.

If I run the analysis again, do I get the same report?

With Lite, yes, identical: two analyses in a row of Flask 3.1.0 gave the same report and SARIF byte for byte, with 159 findings in the same order. In Plus, on a second run on the same code, Fabrika re-reads only what has changed.

Can the model invent a problem?

No. A verdict on a finding that no tool produced is removed. Logic errors, which the model looks for in Plus, count only if they quote two lines that Fabrika finds in the file, and they always stay to be verified.

Does Fabrika learn from my code?

No. From Plus verdicts it keeps only counts per type of finding (tool, rule, language, zone, severity), with no code, files, paths, customers or projects.

Why do you publish the formulas?

Because a report that holds up in front of an auditor must be able to say how it was made. They are the formulas of the current code, and a test checks them against the code at every release.

Where do I find the technical terms?

In the glossary: finding, pillar, fingerprint, CWE and the others.

See the method at work on your code.

Lite is free and arrives in a few minutes: the tools, the grades and the numbers, with no artificial intelligence.

Technical terms are in the glossary.

Open the page