Skip to main content
“Shift left” is a common phrase in modern DevOps and secure development lifecycles. It means moving detection and mitigation of defects — especially security issues — as early as possible in the delivery process, toward the left side of a typical development workflow. Think of a simple left-to-right delivery flow:
  • On the far left you write code in an editor.
  • Next you commit changes to Git.
  • The CI pipeline builds and tests the change.
  • Staging runs more complete tests.
  • Finally you deploy to production, where real users access the application.
Shift-left means catching important issues earlier in that flow — ideally in the editor or pre-commit stage, rather than waiting until production. Why this matters: the earlier you find a bug, the cheaper and faster it is to fix, and the less likely users are exposed to a vulnerability. A concrete example: following one bug backward from production Imagine an online store where customers search for an order by entering an order ID. The application takes whatever the user types and inserts it into a SQL query without validation or parameterization. Normally, a customer types 1042 and the application runs:
An attacker could instead type ' OR 1=1 -- into the search box. Because the application concatenates input directly into the SQL, the query becomes:
The condition 1=1 is always true, so the database may return every order in the table, exposing other customers’ information. This is SQL injection: user input treated as SQL code instead of data. Discovery in production and the immediate response When this bug is discovered in production, incident response typically focuses on containment and remediation. A developer may push an urgent hotfix like:
That hotfix can stop immediate abuse, but it’s brittle as a long-term solution. Depending on the severity and data exposure, you may also need to notify customers and perform an incident review. Now move one step left: staging
A simple software delivery pipeline diagram showing steps from editor (code) to commit (git), CI, staging, and production. The production stage shows a bug in an orders.js file and users affected.
In staging you run the full application and can run automated attacks against it using DAST tools such as OWASP ZAP. Dynamic Application Security Testing (DAST) treats the running application like an external attacker would: it sends malicious inputs and monitors responses to detect runtime vulnerabilities (for example, SQL injection, XSS, authentication issues).
A dark-themed "STAGING" diagram showing an order-ID search UI connected to a database. A highlighted "SQL Injection" high-risk warning and arrows show data flow between an attacker icon and the application.
Move farther left: CI with SAST The CI pipeline builds and runs tests for every change. Integrating SAST (Static Application Security Testing) tools such as CodeQL into CI lets you analyze source code for insecure patterns before changes are merged. SAST inspects the code itself and can flag dangerous constructs like unsanitized string concatenation into SQL. A typical vulnerable Node.js/Express snippet looks like:
SAST would flag that id (user-controlled) is embedded directly into the SQL string, indicating a high-risk pattern. Even earlier: commit hooks and local scanning Pre-commit hooks can run quick scanners (for example, Semgrep) locally and block insecure commits:
This ensures obvious patterns are caught before they reach CI. The leftmost place: the editor / IDE Installing extensions and linters in your editor (e.g., VS Code with SonarLint or CodeQL extensions) gives immediate, inline feedback while developers author code. The editor can underline risky lines, show why they’re dangerous, and suggest safer alternatives. Safe coding: parameterized queries / prepared statements The correct, long-term fix for SQL injection is to separate code from data using parameterized queries or prepared statements. The database will treat user input as data, never executable SQL. For example:
Pipeline stages, goals, and common tools Best practices summary
  • Apply multiple layers of defense: editor checks, pre-commit scanning, CI SAST, staging DAST, and production monitoring.
  • Prefer parameterized queries and safe APIs over ad-hoc input validation.
  • Automate feedback whenever possible so developers receive fast, actionable results.
  • Treat DAST as a complement to SAST — each finds different classes of issues.
Shift-left reduces risk, accelerates developer feedback loops, and lowers the cost and impact of fixes by detecting issues earlier — ideally before they reach production.
Links and references

Watch Video