Skip to content
AI|Course
← Analyze AI-Generated Code for Quality and Security

Lesson 7 of 7 · 5 hr

Capstone project

Build the pipeline that makes AI-assisted development safe for a real project, and prove that it catches real problems.

The brief

Pick a project you care about (a web API, a CLI tool or a library, at least a few hundred lines). Use an AI coding tool to add several features to it. Then build the review, analysis and testing system that decides whether that code may merge, and measure how well it works.

Work only on your own code or code you have permission to test. Run generated code in a sandbox, and never use real secrets or production data.

Requirements

  1. Baseline audit. Use the tool to generate at least five realistic features, including some in risky areas (input handling, authentication, file access, database queries). Record every flaw you find by reading, tools and tests. Classify each using the five categories from lesson 1 and a CWE ID where one applies.
  2. Review process. A pull request template and a risk-based review checklist tailored to the failure patterns you actually found.
  3. Automated analysis in CI. At least a linter, a type checker, one SAST tool, a secret scanner and a dependency scanner, with documented rules for what blocks a merge.
  4. Custom rules. At least three project-specific rules (for example, Semgrep) derived from flaws you found.
  5. Supply chain controls. A dependency policy, a check that blocks unreviewed new dependencies, an SBOM and a license check. Include a deliberate test using a nonexistent package name.
  6. Stronger tests. Property-based tests for at least two modules, a mutation testing report with surviving mutants addressed, and security regression tests for each vulnerability found.
  7. Seeded-bug evaluation. Plant at least 10 realistic vulnerabilities and quality bugs (for example from the CWE Top 25 list) in a branch. Measure which layer caught each, which slipped through, and the false-positive count.
  8. Iteration. Improve the pipeline based on what slipped through, and re-measure.
  9. Policy and write-up. A one-page AI-assisted development policy for the project, a results table (caught by layer, missed, false positives, time cost) and a candid list of what still depends on human judgment.

Suggested path

StepOutput
Generate features with an AI toolpull requests to audit
Audit and classify flawsfindings report
Build CI checks and custom rulesworking pipeline
Add dependency and supply chain controlspolicy and checks
Strengthen testsproperty, mutation and security tests
Plant bugs and measuredetection results
Improve and re-measurebefore and after table
Write the policy and reportpublic repo

Stretch goals

  • Add an LLM-based reviewer as a non-blocking commenter, and measure its precision against your seeded bugs and human review.
  • Compare two AI coding tools or models on the number and type of flaws they introduce.
  • Add a fuzz target for your main input parser.
  • Map your pipeline to NIST's SSDF practices and note the gaps.
  • Add provenance tracking: which commits or files were AI-assisted, and what review each received.

Share it

Publish the repo with the seeded-bug set, the pipeline and the results. The most useful reports state clearly which flaws only a human caught, since that tells other teams where not to relax.

Where to go next

DocsMITRE
CWE Top 25 Most Dangerous Software Weaknesses (opens in a new tab)

Use it to design your seeded bugs.

DocsNIST
NIST SP 800-218: Secure Software Development Framework (opens in a new tab)

Map your pipeline to a recognized framework.

DocsOWASP
OWASP Application Security Verification Standard (opens in a new tab)

A detailed requirement list to verify your application against.

Found a broken link or a mistake? Report it (opens in a new tab).