Saikou

Verify AI-written security fixes before you merge them.

An agent opens a pull request: "fixed the injection". The scanner agrees, because the agent added a nosec. Saikou compares the code before and after and blocks the fixes that only look fixed: a new suppression, a sanitised value nobody uses, one caller fixed while the shared sink stays raw, code replaced by // ... existing code ....

v1.2.2 · Python 3.9+ · standard library only · runs on your machine · Apache-2.0 · no score

One line of an AI "fix", from the demo below (after_A_fake.py):
- return subprocess.call("ping -c1 " + host, shell=True)
+ return subprocess.call("ping -c1 " + host, shell=True)  # nosec B602

Blocked

  • sink_shell_true parser
  • suppression_introduced mechanical

Why a clean scan is not proof

Static analysers honour suppression comments. So the cheapest way to make a finding disappear is to silence it, and a before/after comparison of findings then reports an improvement. Four steps, one of them a lie:

  1. The findingshell=True

    The scanner reports a command-injection risk.

  2. The "fix"+ # nosec B602

    The agent adds a suppression and changes nothing else.

  3. The scan afterfindings: 1 → 0

    The scanner skips the line, and the delta reads as a fix.

  4. SaikouBLOCKED

    It compares the code itself: the sink is unchanged and a suppression appeared.

Absence of a finding is never evidence of a fix.

See it work

One vulnerable file (SQL built by string formatting, shell=True, MD5 for passwords, path traversal) and three proposed fixes. The diffs, findings and output below are produced by the real command, and the test suite fails when they no longer match it; the files are in tests/fixtures/demo/. Pick a finding to see the line it points at.

Blocked The fake fix

Adds nosec comments and usedforsecurity=False. Nothing is repaired.

Output of saikou verify
BLOCKED after_A_fake.py  [python · ast_verified · verify]
HARD FAIL [mechanical] suppression_introduced L7: A bandit analyser suppression appears in the
              output that was not in the input (+2). Silencing an analyser is not hardening, and
              it would make a before/after finding delta read as an improvement.
HARD FAIL [parser] sink_sql_nonparameterised L7: A fix for 'injection' was claimed but this sink
              survives unchanged: execute() receives a computed string with no parameter
              argument; the SQL injection sink is intact.
HARD FAIL [parser] shared_sink_injection_path L11: Survives a claimed injection fix unchanged:
              run_query() forwards its argument into a raw sink, and here it is called with an
              interpolated string. Parameterising other callers does not close this path; the
              sink itself must be fixed.
HARD FAIL [mechanical] suppression_introduced L14: A bandit analyser suppression appears in the
              output that was not in the input (+2). Silencing an analyser is not hardening, and
              it would make a before/after finding delta read as an improvement.
HARD FAIL [parser] sink_shell_true L14: A fix for 'injection' was claimed but this sink survives
              unchanged: shell=True survives in the output; command injection sink intact.
HARD FAIL [mechanical] suppression_introduced L17: A usedforsecurity-flag analyser suppression
              appears in the output that was not in the input (+1). Silencing an analyser is not
              hardening, and it would make a before/after finding delta read as an improvement.

saikou verify: 1 file(s), 1 blocked, 6 hard fail(s), 0 warning(s).

Blocked The partial fix

Fixes the shell call and the hash, computes a "safe" path it never uses, and leaves SQL injection reachable through a wrapper.

Output of saikou verify
BLOCKED after_B_partial.py  [python · ast_verified · verify]
HARD FAIL [parser] sink_sql_nonparameterised L7: A fix for 'injection' was claimed but this sink
              survives unchanged: execute() receives a computed string with no parameter
              argument; the SQL injection sink is intact.
HARD FAIL [parser] shared_sink_injection_path L11: Survives a claimed injection fix unchanged:
              run_query() forwards its argument into a raw sink, and here it is called with an
              interpolated string. Parameterising other callers does not close this path; the
              sink itself must be fixed.
HARD FAIL [parser] guard_computed_but_unused L20: 'safe' is produced by a
              validation/sanitisation call and then never read. The guard is decorative: the
              unsanitised value still reaches the sink.

saikou verify: 1 file(s), 1 blocked, 3 hard fail(s), 0 warning(s).

Passes The real fix

Parameterised queries, an argument list instead of a shell, scrypt with a salt, resolved-path containment.

Output of saikou verify
ok      after_C_real.py  [python · ast_verified · verify]

saikou verify: 1 file(s), 0 blocked, 0 hard fail(s), 0 warning(s).

"Passes" means no check blocked the change - not that the code is secure. See what Saikou does not do.

How to read a report

Every finding is one line. This one is from the fake fix above:

HARD FAIL [parser] sink_shell_true L14: A fix for 'injection' was claimed but this sink survives unchanged: shell=True survives in the output; command injection sink intact.
HARD FAIL severity
A hard fail blocks the file. WARN is reported and does not block: something to look at, such as a type-checker directive. A file with at least one hard fail is BLOCKED, and the command exits with 1 (0 = no hard fail, 2 = error), so CI can gate on it.
[parser] how it was established
tool An external analyser (bandit) produced this, run twice: normally and with suppressions ignored.
parser Computed by parsing both versions into syntax trees and comparing them. Not a text guess.
mechanical A deterministic text or counting check. Reliable for what it looks for, blind to meaning.
sink_shell_true the check, and L14 the line
Every check has an id and a plain description; the full list is below. The line number points into the file after the change.
Verification tier, per file
ast_verified Python: both versions parsed; API surface and sinks computed, not claimed.
structural No parser: textual and structural checks only. Semantics are not verified.
asserted Unrecognised language: sanity checks only. Any claim of a fix is the model's, not Saikou's.
Two modes, two policies
verify judges a claimed fix and is strict: a sink that survives a claimed fix blocks. diff gates an ordinary pull request and only blocks what the change introduced, so old code does not fail new pull requests.

There is no score: findings are never added up, because a number invites trust the checks have not earned. And the author's claim is never evidence - if an AI says "I fixed the injection", that is recorded as an unverified claim.

What it checks

Suppression laundering mechanical
nosec, nosemgrep, noqa: S…, eslint-disable on a security rule, usedforsecurity=False and more: 19 kinds, counted per kind, in real comments only.
Weakened analyser configuration mechanical
New skips under [tool.bandit], security rules ignored in ruff or flake8, new .semgrepignore entries, security ESLint rules switched off.
Unwired guards parser
safe = sanitize(p) is computed, then open(p) is used. In JavaScript and TypeScript also async guards used without await.
Partial, shared-sink fixes parser
One caller parameterised while an interpolated string still reaches the raw sink through a wrapper.
Dangerous sinks parser
New shell=True, verify=False, interpolated SQL, eval on non-literals, MD5 or SHA-1 over passwords, hardcoded keys. Old ones block only when a fix for that class was claimed.
Elision and no-op edits parser
// ... existing code ..., "rest unchanged", emptied function bodies, comment-only "fixes", output that no longer parses.
All 38 checks, with what each one means
CheckEstablished byApplies toEffectMode
New analyser suppression suppression_introduced

A suppression marker (nosec, NOSONAR, lgtm or codeql[...], nosemgrep, noqa: S..., eslint-disable on a security rule, usedforsecurity=False, ...) appears more often than before. Counted per marker kind, so editing a line that was already suppressed is not flagged. In Python, comment markers count only in real comments, which is where bandit 1.7.3+, Sonar and CodeQL read them; a marker inside a string literal, such as fake-fix test data, is not counted. bandit 1.7.0-1.7.2 did honour one there, so the analyser extra requires 1.7.3. noqa and nosemgrep still count anywhere on the line, because flake8 and semgrep match the raw line. A word glued to a marker (nosecure) counts, because bandit reads it as a bare marker, and so does a marker that only shows after decoding the declared source encoding. usedforsecurity set to anything but True counts. A marker moved onto code that had none, while the number of markers stays the same, is reported too (in Python, per statement). Python that does not tokenize is counted as text. In change gating only markers that silence a security analyser block; a bare noqa counts as one on a statement that makes a call bandit reports (subprocess, eval, yaml.load, md5, pickle, ...), usedforsecurity does on password material, and other type and style markers become a warning. In JavaScript and TypeScript, block comments count as well, an ESLint directive without a rule list counts as a security suppression where it covers a line that holds a risky call (eval, new Function, child_process, fs, innerHTML, ...), a marker moved onto another line is reported, and a TypeScript directive is a warning.

mechanicalAny fileBlocksverify, diff
Type/style suppression added suppression_added

A type-checker or style suppression (type: ignore, ts-ignore, pylint disable, ...) was added in a change. Not blocking: this is ordinary engineering, but worth a glance.

mechanicalAny fileWarnsdiff
Analyser config referenced in output analyser_config_touched

The proposed output names an analyser configuration file (.bandit, pyproject.toml, .semgrepignore, ...) that the input did not. Suppression moved out of band is still suppression.

mechanicalAny fileBlocksverify
Security analyser configuration weakened analyser_config_weakened

In a changed config file: new skips under [tool.bandit], security rules ignored in ruff/flake8 (S rules, except S101 which only warns), new .semgrepignore / .gitleaksignore entries, security ESLint rules switched off, Sonar exclusions, gosec disabled. Comments and unrelated keys are ignored.

mechanicalAnalyser configurationBlocksdiff
Linter configuration relaxed linter_config_relaxed

A style or type linter was relaxed in a config file. Not a security analyser, so it only warns.

mechanicalAnalyser configurationWarnsdiff
Changed file could not be checked content_not_checked

The new version of a changed file in a language Saikou checks (by its extension or, for a script without a recognised one, by its #! line), or of an analyser configuration file, could not be checked: it has a NUL byte in its first 8 KB (UTF-16 and UTF-32 with a byte-order mark are read as text), it is larger than 1,000,000 bytes, it could not be read from the work tree, or the path is now a symbolic link or a submodule. Change gating blocks such a file instead of skipping it. Otherwise one NUL byte in a comment, padding past the size limit, or a symlink swapped for a file would let any change in it through unchecked. When only the old version is unreadable, the new one is checked as if the file were new. A file that is meant to be like this, such as a large vendored bundle, can be left out with a pathspec (-- . ':(exclude)vendor/bundle.js'); --warn-only content_not_checked demotes the check for every file. Files in languages Saikou does not check are still skipped and listed.

mechanicalAny fileBlocksdiff
Dropped code marker elided_output

The output contains a phrase like 'rest unchanged', 'implementation here' or '// ... existing code ...'. Applying it would delete the omitted code. Markers inside string literals and docstrings are ignored. 'keep the existing code' counts only when it ends the clause or is followed by here, below, unchanged or as is; in prose such as 'keep the existing code style' it does not. In change gating, only strong markers block.

mechanicalAny fileBlocksverify, diff
Reads like dropped code elision_phrase

New text such as 'same as above' or 'for brevity'. Usually prose, so it only warns.

mechanicalAny fileWarnsdiff
Function body emptied body_gutted

A function or class that had statements now has only '...' or 'pass'. The implementation was dropped. A bare '...' that was already there (a Protocol stub) is fine.

parserPythonBlocksverify, diff
Output contains no code empty_output

The proposed output is empty. In change gating a newly added empty file (such as tests/__init__.py) is ordinary and not reported.

mechanicalAny fileBlocksverify, diff
Output may be cut off truncated_output

The last line ends in the middle of an expression.

mechanicalAny fileWarnsverify, diff
Unclosed brackets unbalanced_delimiters

More opening than closing brackets (a raw count, so string literals can cause noise).

mechanicalAny fileWarnsverify, diff
Output far shorter than input size_collapse

A complete module was requested but the output has under 60% of the input's non-blank lines.

mechanicalAny fileWarnsverify
Nothing changed no_change

The output is identical to the input, so nothing was fixed. Only checked when a fix is claimed; an ordinary change may leave a file as it was.

mechanicalAny fileBlocksverify
Only comments or whitespace changed cosmetic_only_change

The syntax tree is identical before and after: the edit was comments only, so no executable behaviour changed.

parserPythonBlocksverify
Output no longer parses parse_failure

The input parsed as Python but the output does not. It cannot be verified and would break at import. Code that nests too deeply for Python to parse or analyse (a very long chain of +, say, where Python raises RecursionError or MemoryError) blocks too, in either version and in both modes, because it was not analysed.

parserPythonBlocksverify, diff
Neither version parses parse_skipped

Both versions fail to parse as Python (a template, Python 2, or a fragment). AST checks were skipped; only text checks ran.

parserPythonWarnsverify, diff
shell=True sink_shell_true

A call runs its command through a shell, so injected text becomes commands: shell= is true (True, 1, not False, ...), also when passed in **{...} or **dict(...). Values count as the file itself fixes them: constants and what is computed from them (not, and/or, comparisons, arithmetic, x if c else y, bool(), int(), len(), indexing), and names bound only by plain assignment, in every binding to the same truth (also a = b = v and a, b = v, w, a class constant, and a function called through such a name or getattr, as in _e = eval). A value Saikou cannot establish (a parameter without a default, an attribute, a call result, a name bound by a loop, or a **mapping that may set the keyword) fails closed: when a fix for that threat class is claimed it blocks, because the fix cannot be verified; otherwise it is a warning when it is new. from m import *, globals() and locals() make every name unknown. A sink that is new in the output always blocks. One that was already there blocks only when a fix for that threat class was claimed; otherwise it is a warning naming what was left alone.

parserPythonDepends (see text)verify, diff
TLS verification off sink_tls_verify_off

Certificate checking is switched off: verify= is false (False, 0, None, bool(0), ...) in a call, also via **{...}, or an HTTP session or client gets it (session.verify = False, setattr, vars(session), a Session subclass); None does not count there. A CA bundle path, certifi.where() or an SSL context counts as on. Values count as the file itself fixes them: constants and what is computed from them (not, and/or, comparisons, arithmetic, x if c else y, bool(), int(), len(), indexing), and names bound only by plain assignment, in every binding to the same truth (also a = b = v and a, b = v, w, a class constant, and a function called through such a name or getattr, as in _e = eval). A value Saikou cannot establish (a parameter without a default, an attribute, a call result, a name bound by a loop, or a **mapping that may set the keyword) fails closed: when a fix for that threat class is claimed it blocks, because the fix cannot be verified; otherwise it is a warning when it is new. from m import *, globals() and locals() make every name unknown. A sink that is new in the output always blocks. One that was already there blocks only when a fix for that threat class was claimed; otherwise it is a warning naming what was left alone.

parserPythonDepends (see text)verify, diff
debug=True sink_debug_true

A web app runs in debug mode, exposing an interactive console: run(...) with debug= true. Values count as the file itself fixes them: constants and what is computed from them (not, and/or, comparisons, arithmetic, x if c else y, bool(), int(), len(), indexing), and names bound only by plain assignment, in every binding to the same truth (also a = b = v and a, b = v, w, a class constant, and a function called through such a name or getattr, as in _e = eval). A value Saikou cannot establish (a parameter without a default, an attribute, a call result, a name bound by a loop, or a **mapping that may set the keyword) fails closed: when a fix for that threat class is claimed it blocks, because the fix cannot be verified; otherwise it is a warning when it is new. from m import *, globals() and locals() make every name unknown. A sink that is new in the output always blocks. One that was already there blocks only when a fix for that threat class was claimed; otherwise it is a warning naming what was left alone.

parserPythonDepends (see text)verify, diff
eval/exec on a variable sink_dynamic_exec

eval() or exec() on something that is not a literal, under any spelling (an alias, builtins.eval, getattr(builtins, 'eval'), from builtins import eval as ev). eval or exec used as a value (map(eval, ...), assertRaises(E, eval, s), a default argument) cannot be established and fails closed as described below. A method that happens to be called eval (model.eval) counts only when called directly with a non-literal. Values count as the file itself fixes them: constants and what is computed from them (not, and/or, comparisons, arithmetic, x if c else y, bool(), int(), len(), indexing), and names bound only by plain assignment, in every binding to the same truth (also a = b = v and a, b = v, w, a class constant, and a function called through such a name or getattr, as in _e = eval). A value Saikou cannot establish (a parameter without a default, an attribute, a call result, a name bound by a loop, or a **mapping that may set the keyword) fails closed: when a fix for that threat class is claimed it blocks, because the fix cannot be verified; otherwise it is a warning when it is new. from m import *, globals() and locals() make every name unknown. A sink that is new in the output always blocks. One that was already there blocks only when a fix for that threat class was claimed; otherwise it is a warning naming what was left alone.

parserPythonDepends (see text)verify, diff
SQL built by interpolation sink_sql_interpolated

A query string is built with an f-string, % or + and passed to execute(). Values count as the file itself fixes them: constants and what is computed from them (not, and/or, comparisons, arithmetic, x if c else y, bool(), int(), len(), indexing), and names bound only by plain assignment, in every binding to the same truth (also a = b = v and a, b = v, w, a class constant, and a function called through such a name or getattr, as in _e = eval). A value Saikou cannot establish (a parameter without a default, an attribute, a call result, a name bound by a loop, or a **mapping that may set the keyword) fails closed: when a fix for that threat class is claimed it blocks, because the fix cannot be verified; otherwise it is a warning when it is new. from m import *, globals() and locals() make every name unknown. A sink that is new in the output always blocks. One that was already there blocks only when a fix for that threat class was claimed; otherwise it is a warning naming what was left alone.

parserPythonDepends (see text)verify, diff
SQL without parameters sink_sql_nonparameterised

execute() receives a computed string and no parameter argument, or an empty one ((), [], {}, None, tuple(), *()). A constant query is never counted: a string, a name bound only to strings, a class constant, text('...'). A query that is the surrounding function's parameter is checked where that function is called. Values count as the file itself fixes them: constants and what is computed from them (not, and/or, comparisons, arithmetic, x if c else y, bool(), int(), len(), indexing), and names bound only by plain assignment, in every binding to the same truth (also a = b = v and a, b = v, w, a class constant, and a function called through such a name or getattr, as in _e = eval). A value Saikou cannot establish (a parameter without a default, an attribute, a call result, a name bound by a loop, or a **mapping that may set the keyword) fails closed: when a fix for that threat class is claimed it blocks, because the fix cannot be verified; otherwise it is a warning when it is new. from m import *, globals() and locals() make every name unknown. A sink that is new in the output always blocks. One that was already there blocks only when a fix for that threat class was claimed; otherwise it is a warning naming what was left alone.

parserPythonDepends (see text)verify, diff
Weak hash over a password sink_weak_hash_secret

MD5 or SHA-1 applied to password-class data. Use a password KDF (scrypt, argon2, PBKDF2). Values count as the file itself fixes them: constants and what is computed from them (not, and/or, comparisons, arithmetic, x if c else y, bool(), int(), len(), indexing), and names bound only by plain assignment, in every binding to the same truth (also a = b = v and a, b = v, w, a class constant, and a function called through such a name or getattr, as in _e = eval). A value Saikou cannot establish (a parameter without a default, an attribute, a call result, a name bound by a loop, or a **mapping that may set the keyword) fails closed: when a fix for that threat class is claimed it blocks, because the fix cannot be verified; otherwise it is a warning when it is new. from m import *, globals() and locals() make every name unknown. A sink that is new in the output always blocks. One that was already there blocks only when a fix for that threat class was claimed; otherwise it is a warning naming what was left alone.

parserPythonDepends (see text)verify, diff
Hardcoded key, salt or secret hardcoded_secret_material

A secret-sounding name (password, api_key, secret_key, ...) is assigned a literal that looks like real key material. Labels, paths, environment-variable names and dotted identifiers are not flagged. Blocks, except when gating a change to a test file (under test/, tests/ or testing/, or test_*.py, *_test.py, conftest.py, tests.py): fixture tokens are test data, so there it is a warning, unless the value is a recognisable provider key (AWS, GitHub, Slack, Stripe live, Google, OpenAI, Anthropic) or a private key. Absolute paths and paths with .. never count as test files. Verifying a claimed fix always blocks.

parserPythonDepends (see text)verify, diff
Validation computed but never used guard_computed_but_unused

A value from a validation/sanitising call (sanitize_*, validate_*, os.path.basename, realpath, ...) is never read, so the unsanitised value still reaches the sink. Blocks when new or when a fix was claimed; otherwise a warning.

parserPythonDepends (see text)verify, diff
Interpolated string reaches a raw sink via a wrapper shared_sink_injection_path

A helper forwards its argument into a raw sink, and a caller passes it an interpolated string. Parameterising other callers does not close this path; the sink itself must be fixed.

parserPythonDepends (see text)verify, diff
Validation computed but never used (JS/TS) js_guard_computed_but_unused

const safe = sanitize(x) appears once in the file and is never referenced again. Structural check (no parser). A ternary on a guard is not flagged.

mechanicalJavaScript, TypeScriptDepends (see text)verify, diff
Async guard used without await js_async_guard_in_boolean

A function defined async in this file is used as a condition without await. A Promise is always truthy, so the guard never rejects.

mechanicalJavaScript, TypeScriptDepends (see text)verify, diff
Async guard left floating js_floating_guard_promise

assertAllowed(x).catch(log): the code continues before the guard resolves.

mechanicalJavaScript, TypeScriptDepends (see text)verify, diff
Minified or bundled file skipped js_generated_skipped

Structural guard checks assume human-written, line-based code, so generated files are skipped with this warning. Harden the source, not the build output.

mechanicalJavaScript, TypeScriptWarnsverify, diff
Public API broken api_break

With strict API on: public symbols removed, or a signature changed so that an old call no longer works. Adding an optional parameter is compatible and not flagged.

parserPythonBlocksverify, diff
Protected symbol altered must_preserve_violated

A symbol you marked must-preserve was removed or changed.

parserPythonBlocksverify, diff
Analyser findings hidden, not fixed findings_suppressed_not_fixed

bandit is run twice, normally and with --ignore-nosec. Findings visible only in the suppression-blind run were silenced, never counted as fixed. Needs bandit installed.

toolPythonBlocksverify, diff
New analyser findings new_analyser_findings

bandit reports findings that were not present before the change.

toolPythonWarnsverify, diff
Model reported nothing left unfixed empty_deferred_list

On non-trivial input an empty list of unfixed issues is usually a reporting failure.

mechanicalsaikou harden resultsWarnsverify
Claimed fixes the analyser does not confirm unsupported_fix_claims

The model claims fixes but the analyser confirms zero removals. Treat the claims as unverified.

mechanicalsaikou harden resultsWarnsverify
Analyser findings not present in the input new_findings

The hardened output has analyser findings the original did not.

mechanicalsaikou harden resultsWarnsverify

Checked against the real tools

The suppression check is the one an AI agent trips most easily, so it is held to the answers of the tools whose markers it judges. For Python, 1,697 generated before/after pairs went to bandit 1.9.4, ruff 0.17.1 and semgrep 1.181.0 (executed), and to flake8 7.4.1, sonar-python and CodeQL (their published marker patterns). In 879 pairs a tool honours the new marker: Saikou blocks 873, warns on 6 and leaves 0 unreported. For JavaScript and TypeScript, 761 pairs went to ESLint v9.39.5, TypeScript 5.9.3 and semgrep 1.181.0: of 186 honoured markers Saikou blocks 174 and warns on 12 (type-checker directives), 0 unreported.

Python: pairs per reference tool

Reference toolHonours the new markerSaikou blocksSaikou warnsNot reported
bandit35534960
flake815815800
ruff15314850
sonar-python30230200
CodeQL18418400
semgrep747400

JavaScript and TypeScript: pairs per reference tool

Reference toolHonours the new markerSaikou blocksSaikou warnsNot reported
ESLint11011000
TypeScript120120
semgrep646400

Where no tool honours the marker, Saikou blocks anyway when it looks like a security suppression (585 Python pairs, 105 JavaScript and TypeScript pairs): on another line, naming another rule, or in a file the tools cannot read. The test suite re-checks every verdict on each run, and a weekly job asks the tools again and fails when an answer changes.

This is a statement with a scope, not a promise. Not covered: other languages, other versions of these tools, marker forms that are not among the pairs. The full coverage statement is generated from the same test data.

Measured on code nobody wrote for it

A check that wrongly blocks real code is also a defect. 2,824 real files each got a harmless edit (a trivial new function) and went through diff mode: 0 were blocked. Run the same files as if they were new code, and some are: they contain a real eval, exec or shell=True, which new code should have to justify.

CorpusFilesHarmless edit blockedSame files as new code, blocked
CPython 3.11 standard library600033
flask, fastapi, starlette, aiohttp, requests, pydantic, httpx, jinja2, werkzeug38008
JavaScript (express and its dependencies)82602
TypeScript (mostly declaration files)1,01800

Each false positive found while measuring is locked in as a regression test, in the engine self-test (123 checks, no network, no key: saikou selftest) or in the test suite. Method: scripts/fp_corpus.py; raw results: docs/measurements/.

Use it

  1. Install
    pip install saikou

    Python 3.9 or newer. The engine uses the standard library only.

  2. Check a claimed fix
    saikou verify before.py after.py --claimed-threats injection

    Strict: what the fix claims to repair has to be repaired.

  3. Gate a pull request
    saikou diff --base origin/main

    Checks every changed file, blocks only what the change introduced. Output as text, JSON or SARIF.

Where else it runs

GitHub Action
- uses: SuperfastSimon/saikou@v1
  with:
    only-agent-prs: "true"

Findings appear in code scanning and the job summary. only-agent-prs checks only pull requests opened by bots or AI agents.

pre-commit
repos:
  - repo: https://github.com/SuperfastSimon/saikou
    rev: v1.2.2
    hooks:
      - id: saikou
Claude Code plugin
/plugin marketplace add SuperfastSimon/saikou
/plugin install saikou-harden@saikou

The code-hardener agent asks for your threat model, hardens, checks its own output with Saikou, and writes only after you approve the diff.

Bring your own model
export LLM_API_KEY=...
saikou harden app.py --threat injection

Any OpenAI-compatible endpoint, including a local one. Dry run by default; --write only applies a result that passed verification. Your code goes to the provider you choose, under their terms.

As a library
from saikou import scan_transformation
findings = scan_transformation(before, after, language="python")
In your browser

The checker runs a subset of the checks in JavaScript on this page; nothing is sent anywhere.

Free and paid

Everything above is free and open source under Apache-2.0, now and later. Paid plans are planned for teams that need to show auditors that fixes were checked independently. They are not on sale yet.

PlanPriceWhat it adds
Open sourceFreeEngine, CLI, GitHub Action, pre-commit hook, Claude Code plugin, in-browser checker.
Pro (planned)about €19 / org / monthSigned evidence-ledger export mapped to NIS2 Art. 21(2)(e) and ISO 27001 A.8.25–8.28, plus an organisation policy file (must-preserve symbols, stricter rules, allowlists).
Team (planned)about €49 / org / monthEverything in Pro, plus a sticky pull-request comment and a trend report of checked fixes over time.

Planned prices, subject to change. Interested? Tell me what you would need - I read every message.

Questions

Is Saikou a vulnerability scanner?

No. It judges changes: it compares the code before and after a fix and asks whether the fix changed the thing that mattered. Keep your static analyser; Saikou checks that fixes to its findings are real.

Does "passes" mean my code is secure?

No. It means no check blocked the change. Saikou reports what it checked and how, and it certifies nothing. The limits say what it does not look at.

How is this different from an AI autofix tool?

An autofix tool writes a fix. Saikou judges a fix, whoever or whatever wrote it, and treats the author's description of the fix as an unverified claim. They work together: let the agent fix, let Saikou check the result before it is merged.

Which languages does it check?

Python is parsed on both sides (ast_verified); with --analyser and bandit installed (pip install "saikou[analyser]"), bandit also runs, as extra evidence. JavaScript and TypeScript get structural guard checks and the suppression checks tested against ESLint, the TypeScript compiler and semgrep. Go, Java, C#, PHP, Ruby, Rust, C and C++, Kotlin, Swift, shell and SQL get textual checks (structural). Anything else gets sanity checks only (asserted). Every report states the tier per file.

Does my code leave my machine?

verify, diff and the browser checker run locally and send nothing. Only saikou harden sends code, to the model provider you configure, under that provider's terms.

Why is there no score?

A number invites trust the checks have not earned, and it hides which check said what. You get findings, each labelled with how it was established, and a verdict per file.

Can it block a pull request?

Yes. saikou diff exits with 1 on a hard fail, so any CI can gate on it; the GitHub Action does this for you and can limit itself to pull requests opened by bots or AI agents.

What does it cost?

Nothing. The engine and every integration are open source under Apache-2.0. Paid plans for audit evidence are planned and not on sale yet.

What Saikou does not do

  • It certifies nothing. It reports what it checked and how - never that code is secure.
  • It does not run your code. Behaviour is checked structurally (syntax tree, API surface) for Python, and not at all for other languages.
  • It is not a vulnerability scanner. It judges changes. Keep your SAST; Saikou checks that fixes to its findings are real.
  • Analyser evidence is Python-only (bandit). Other languages get structural checks, and every report says so.
  • One file at a time. diff checks every changed file, but there is no cross-file data-flow analysis.