Safeguard
Application Security•

How do you build a secure web app when AI helps write the code?

A stage by stage path from requirements to deployment for a web app built with AI help, using OWASP ASVS, NIST SSDF and SLSA as the checkpoints.

Safeguard Security Team
4 min read

Build a secure web app with AI help by setting security requirements first, letting automated checks gate every change, proving where builds come from, and deploying with least privilege. Standards such as OWASP ASVS, NIST SSDF and SLSA give you the checkpoints. The AI changes how fast code appears, not what must be verified.

Which requirements come before any code?

Start with what the app must withstand. OWASP's Application Security Verification Standard (ASVS) is a list of testable requirements in areas like authentication, session management, access control, input validation and cryptography. It defines three levels, so you can pick the depth that matches the app's risk.

Choose a level, copy the relevant requirements into your tracker, and give them to your AI tools as context. A prompt that says "implement login" produces something different from one that says "implement login meeting these ten requirements, with rate limiting and no user enumeration in error messages".

What should the pipeline check on every change?

Think of the pipeline as the one reviewer that never gets tired. NIST SSDF (SP 800-218) groups practices into preparing the organization, protecting the software, producing well secured software, and responding to vulnerabilities. In pipeline terms, that becomes a short list of automatic checks.

  1. Secret scanning on every commit, so keys never reach history.
  2. Static analysis for flaws in your own code.
  3. Dependency analysis against known vulnerabilities, plus a check that each package is the intended one.
  4. Tests, including ones for rejected inputs and for authorization.
  5. Infrastructure files checked for open storage and wide permissions.

Make the important ones block the merge. A check that only warns gets ignored within weeks.

How do you trust what you deployed?

SLSA, a supply chain framework, focuses on build integrity. Its idea is provenance: a signed record of which source, which builder and which steps produced an artifact. Deploy only artifacts that have it, and your production environment can refuse anything that was built on a laptop or tampered with after the fact.

A constructed example. A team ships a web app on Friday. The container image deployed is the one built by the pipeline from commit abc123, and the deploy step verifies that signature. A developer who pushes a hand-built image to the registry finds it rejected at the cluster. The rule cost an hour to set up and removed a whole class of surprise.

What changes if the app itself uses AI?

If users can talk to a model through your app, you have a new attack surface. The OWASP Top 10 for LLM Applications covers prompt injection, insecure handling of model output, and excessive agency. Treat model output as untrusted input: validate it before it reaches a database query, a shell or a browser. Limit what any model-driven feature can do, and log it.

Where does Safeguard fit?

Safeguard provides dependency and SBOM scanning, reachability analysis to show which flagged vulnerabilities your code can actually call, and policies and gates for pull requests. You can see a gate in action in the demo below.

Open the full version at /demos/gate-pull-request.

How to check or apply this

  1. Pick an ASVS level and import its requirements into your backlog.
  2. Add the five automatic checks above to the pipeline and mark them required.
  3. Generate build provenance and verify it at deploy time.
  4. Give pipelines and apps short-lived credentials with narrow roles.
  5. Add monitoring for authentication failures and unusual data access.
  6. Write a short response plan for a vulnerable dependency, with a named owner.

Quick check

Do AI generated changes need extra review?

They need the same gates plus a reviewer who reads for plausible but wrong logic, especially around access control.

Which ASVS level should we start with?

Choose by risk. Apps that handle sensitive data or money generally warrant a higher level than a brochure site. Start with the level you can actually test.

Sources

  1. OWASP Application Security Verification Standard
  2. NIST SP 800-218, Secure Software Development Framework
  3. SLSA, Supply chain Levels for Software Artifacts
  4. OWASP Top 10 for Large Language Model Applications

Last reviewed: 18 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.