Skip to content
back to the map
concept
2 min read

Shift-left

The further left in the lifecycle a flaw is found, the cheaper it is to fix.

plugins de IDEpre-commit hookschecks de PR

What it is

Draw the software lifecycle from left to right: code, build, test, staging, production. Shift-left means moving security checks as far to the left of that line as possible, from production toward the developer's keyboard.

In practice: the hook that blocks before the commit

The most tangible example is pre-commit: a local hook that runs the same tools as the pipeline, but on the dev's machine, before the code even leaves. The configuration below runs and on every commit:

.pre-commit-config.yamlyaml
repos:
  - repo: https://github.com/gitleaks/gitleaks
    hooks:
      - id: gitleaks          # blocks the key before the commit
  - repo: https://github.com/semgrep/semgrep
    hooks:
      - id: semgrep
        args: ["--config", "auto"]   # the same rules as CI

Layered defense, not replacement

The local hook is fast and cheap, but it is not an authority: you can pass --no-verify and skip it. That is why the same check runs again on the PR and in the build, layers with different costs. Early (IDE, pre-commit) for fast feedback; later (CI) as the real gate that nobody skips.

The economic effect

The cost of a defect grows by orders of magnitude as it moves through the lifecycle: fixing a line in the editor takes seconds; the same problem in production can cost an incident, a leak and users' trust. Shift-left is not about liking security, it is about arithmetic.

The limit of shift-left

Moving checks earlier does not eliminate what comes later: some vulnerabilities only exist in the assembled system, with real configuration and data, which is the territory of and production monitoring. Shift-left complements late checks, it does not replace them.

Secrets scanningScanning for exposed credentials in code, commits and git history.see in glossary →SASTStatic analysis: examines the code without running it. It finds issues through flow analysis, not guesswork.see in glossary →DASTDynamic testing: attacks the running application from the outside, as a black box.see in glossary →

connections on the map

updated on 14/10/2026 · sources to go deeper · report an error

Unlocks

test what you learned

Loading questions…