No model, no sampling
The engine uses no machine-learning model and samples nothing. Given the same commit it produces the same findings. A sample report shows the output on a demonstration codebase.
Five ways a finding is found
| Method | Applies to | What it does |
|---|---|---|
| Syntax tree | Python, JavaScript, TypeScript | The file is parsed (Python with its own parser, JavaScript and TypeScript with tree-sitter) and checked by the structure of the code: secrets assigned to variables, SQL built from variables, weak hashing, dynamic execution, shell commands, unsafe deserialization, disabled certificate checks, discarded exceptions, and the complexity of every function. |
| Text pattern | Infrastructure files, access policies, other languages, and any file that does not parse | Fixed patterns for open network ingress, unencrypted or public storage, privileged containers, wildcard access policies, and recognisable credential formats. Credential formats are matched in every file. |
| Licence declaration | Licence files, manifests, source headers | A licence file is identified from its text; a manifest's licence field and SPDX-License-Identifier tags are read. Identifiers are classified against the SPDX licence list (version 8791eda, 740 licences). A file that only mentions a licence declares nothing. |
| Package registry | Dependencies in npm, PyPI, Go, Cargo, Maven, RubyGems and Composer files | Each dependency with a pinned version is looked up for its licence and its published security advisories. Development-only dependencies are never findings. |
| Commit history | GitHub repositories | The authors and dates of the 12 months of commits before the audited commit give the commit entropy, the bus factor and the largest contributor's share. |
Product code, and everything else
A placeholder key in a test fixture is not a leaked credential, and a deliberately insecure call in a tutorial is not a flaw in the product. The engine decides from a file's path whether it is test, documentation or example code, using the conventions of each ecosystem (folders such as tests, docs and examples; file names such as test_*.py and *.spec.ts). Findings there are listed in the report under their own heading and carry no estimate. Dependencies declared only for tests, documentation or examples are treated as development dependencies. A file is treated as product code unless its path clearly says otherwise.
Two numbers for every finding
Risk says how much a finding could hurt: high, medium or low. Cost to fix says how much engineering work removes it. They answer different questions and are kept apart. A hardcoded credential is high risk and cheap to fix; a large tangled file is low risk and expensive to fix.
The cost to fix is published hours for each kind of finding, multiplied by $175 an hour, the rate of a senior engineer. It is shown as a range because the same kind of fix takes longer in some codebases than in others. When a kind of finding occurs several times in one file, each extra place adds a smaller amount, because the first fix carries the set-up. A report's range is the sum of its findings' ranges.
| Kind of finding | Risk | Hours | Cost to fix (first place) | What the work is |
|---|---|---|---|---|
| Copyleft licence declared in the repository | High | 16–40 h | $2,800 – $7,000 | Establish where the licensed code is used, then remove or replace it, or confirm the obligations are met. Legal review is not included. |
| Copyleft production dependency | High | 8–24 h | $1,400 – $4,200 | Replace the package with a permissively licensed alternative, or obtain a commercial licence. Legal review is not included. |
| Production dependency with a high-severity vulnerability | High | 2–8 h | $350 – $1,400 | Upgrade the package to a fixed version and re-test the parts of the system that use it. |
| Key-person concentration | Medium | 40–80 h | $7,000 – $14,000 | Document the system and pair the principal contributor with others to spread working knowledge. A retention arrangement is a commercial matter and is not included. |
| Leaked credential or insecure code pattern | High | 4–8 h, +1–2 h per extra place | $700 – $1,400 | Revoke and rotate the credential, move it to a secrets store, remove it from the code and its history, and check access logs for misuse. |
| Infrastructure misconfiguration | Medium | 1–4 h, +1–2 h per extra place | $175 – $700 | Change the configuration, apply it to a staging environment and confirm the service still works. |
| Over-broad access policy | High | 2–6 h, +1–2 h per extra place | $350 – $1,050 | Replace the wildcard with the specific actions and resources the service needs, and test the deployment. |
| Very large source file | Low | 8–24 h | $1,400 – $4,200 | Split the file along its responsibilities and re-test. |
| Empty catch block | Low | 0.5–1 h, +0.25–0.5 h per extra place | $88 – $175 | Log or handle each error instead of discarding it. |
| SQL query built from variables (injection risk) | High | 2–4 h, +1–2 h per extra place | $350 – $700 | Replace string-built queries with parameterised queries and add tests with hostile input. |
| Hardcoded secret / API credential | High | 4–8 h, +1–2 h per extra place | $700 – $1,400 | Revoke and rotate the credential, move it to a secrets store, remove it from the code and its history, and check access logs for misuse. |
| Use of cryptographically broken hashing (MD5 or SHA-1) | Medium | 2–4 h, +1–2 h per extra place | $350 – $700 | Replace MD5/SHA-1 with a modern algorithm. Longer if it protects stored passwords, which then need a migration. |
| Dynamic code execution (eval / exec) | High | 3–6 h, +1–3 h per extra place | $525 – $1,050 | Replace eval/exec with explicit logic or a safe parser, and add tests. |
| Command run through the system shell | High | 2–4 h, +1–2 h per extra place | $350 – $700 | Pass arguments as a list without the shell, or validate the input against an allow-list, and add tests. |
| Unsafe deserialization of untrusted data | High | 3–6 h, +2–4 h per extra place | $525 – $1,050 | Switch to a safe format or a restricted loader, and add tests with malformed data. |
| TLS certificate verification disabled | Medium | 1–2 h, +0.5–1 h per extra place | $175 – $350 | Turn certificate verification back on and supply the right certificate authority where needed. |
| Exception handler that discards the error | Low | 0.5–1 h, +0.25–0.5 h per extra place | $88 – $175 | Log or handle each error instead of discarding it. |
| High-complexity functions | Medium | 0.5–1 h per point above 15 | (points above 15) × 0.5–1 h × $175 | Split the functions into smaller ones and add tests: 0.5 to 1 hour for each point of complexity above 15. |
What these figures are, and are not. The hours are Agiphi's working values for the engineering work each fix takes. They are not derived from a dataset of deals, and the cost to fix is not a valuation, a price adjustment or the cost of an incident. A buyer weighs the risk ratings and the findings themselves; the cost to fix tells them what cleaning the code up would take. Infrastructure findings that open a service to the internet, make data public or run with excess privilege are rated high; other infrastructure findings medium.
The formulas
Function complexity
The cyclomatic complexity of a function is one plus the number of its decision points: each if, loop, exception handler, conditional expression and boolean operator. A function above 15 is reported. The cost to fix for a file is:
sum over its functions of (complexity − 15) × 0.5 to 1 hours × $175
A function of complexity 43 is 28 points over the threshold: 14 to 28 hours of splitting and testing.
Vulnerable dependencies
A production dependency with a published advisory scoring 7 or more on CVSS is a high-risk finding. Its cost to fix is the work to upgrade it and re-test the parts of the system that use it.
Team measures
With p the share of commits made by each author over the 12 months before the audited commit:
- Commit entropy is
− Σ p × log2(p). It is zero when one person made every commit and highest when the work is evenly spread. - Bus factor is the smallest number of authors who together made more than half of the commits.
- Key-person concentration is a finding when one author made more than 70% of them.
Automated accounts are left out. Fewer than ten commits in the period is reported as too little history to judge.
What leaves the server
To look up licences and advisories, the registry, name and version of each open-source package a repository depends on are sent to the public Open Source Insights service. No source code, repository name or customer identity is sent, and the lookup can be switched off. Commit history is read from the repository host with the customer's own credentials.
What the engine does not do
- It does not run the code, so it finds nothing that only appears at run time.
- It reads the files of one commit. It does not search the contents of earlier commits, so a secret removed from the current files but still in the history is not found.
- A dependency without a pinned version is listed but cannot be checked for vulnerabilities.
- It does not judge whether a vulnerability is reachable from your code or is being exploited.
- It does not decide whether a copyleft licence's obligations apply to you. That depends on how the code is used and distributed, and is a legal question.
- An author who commits under several names is counted as several people.
A report is evidence for a conversation, not a substitute for one.