AI-Assisted Coding · Module 5Lesson 3

Study explanation · Lesson 03 · 17 min

AI security review with Codex App

A security review is a grading exercise. Codex runs a read-only audit that must cite files; you grade every finding Valid, False Positive or Noise, run your own manual scan, reconcile the two, and rank a top-3 backlog in docs/security-review.md.

Listen to this lesson

Hear the lesson read aloud, with each sentence highlighted as you go.

Narrated by an AI voice.

The audit is not accepted as truth

The instructor asks Codex for a read-only audit. Each finding must cite files and receive a grade. Then you close or ignore the AI output, run your own manual scan, and compare the two sets of findings. The useful artifact is the report you review, label, reconcile and prioritize.

From AI audit to ranked backlog · Lecture notes pp. 6-7
  1. 1Read-only auditCodex cites files for every finding
  2. 2GradeValid, False Positive or Noise
  3. 3Manual scanYour own pass, AI output closed
  4. 4ReconcileAgreement, AI-only, You-only
  5. 5Top-3 backlogRanked Valid findings with next actions

What a strong security prompt requires

The notes’ prompt names the files to inspect, forbids edits, asks for file, risk and repo relevance for every finding, and makes an empty category an acceptable answer. That last line matters: it removes the pressure to invent a finding to fill space. Prompt 5.2A in the library extends it with six focus areas and a table format.

Prompt from the notesPerform a read-only security audit of this Task Tracker repository. Inspect relevant files before answering, including app/, tests/, frontend if present, requirements or dependency files, Dockerfile, and GitHub workflows if present. Do not edit files. For each finding, cite the file, explain the risk, and state why it matters for this repo. If a category has no finding, say that explicitly rather than inventing one.

Three grades for every finding

Each AI finding gets exactly one grade and a one-sentence reason.

Finding grades · Lecture notes p. 6
GradeUse when...Example reasoning
ValidThe issue is real for this codebase and the risk explanation fits the project.The task body has no length limit, so a client can create oversized in-memory data.
False PositiveThe finding is wrong about behavior, severity, or project context.The audit claims SQL injection, but this learning project does not use SQL.
NoiseThe statement is technically true but too generic, trivial, or not actionable.“Validate all input” without a file, field, or concrete failure mode is not useful.

Read with careThe library’s grading prompt (5.2B) defines Valid a little more broadly than the notes: it also counts a course-scope limitation that would matter outside the learning context. Say which definition you used in your report.

Your manual scan

Close the AI output and look for yourself. The notes give six lenses and why each matters. Your findings here are usually Valid, but they still need evidence.

Manual scan checklist · Lecture notes pp. 6-7
Look forWhy it matters
Unbounded fieldsLong titles, descriptions, authors, or comment bodies can create storage and response-size risks.
Authorization or ownership gapsA no-auth course project may be intentional, but the production risk still needs to be named clearly.
Client-trusted dataData such as IDs, timestamps, or status changes may need server-side rules.
Error leakageRaw stack traces, internal paths, or verbose errors can expose implementation details.
Secrets or real dataCredentials, tokens, environment files, local paths, and real customer data should not be exposed.
Docker and CI defaultsRunning as root, broad permissions, or weak workflow assumptions may matter later.

Examples from the lecture

The notes walk through four typical findings. The common thread is context: grade how accurately Codex frames the risk for this project, not whether the sentence sounds alarming.

Examples from the lecture · Lecture notes p. 7
ExampleHow to think about it
No authentication, authorization, or ownership checks on task endpointsIn the learning project this may be an intentional scope decision. In production it is still a real risk. Grade based on how accurately Codex frames the context.
Unbounded task creation or string fieldsA concrete, repo-specific finding if the model or validation layer lacks length limits.
CORS allows null origins or broad methods/headersMay be acceptable for local development, but the risk should be documented before deployment.
Generic OWASP-style adviceUseful as background, but not a finding unless tied to a file, behavior, and project-specific risk.

The security review artifact

docs/security-review.md has four sections. The notes’ instructor emphasis: a useful audit cites real files, a weak audit gives generic advice, and the most important column is You-only, because it shows the judgment Codex did not supply.

Security review artifact structure · Lecture notes p. 7
Section in docs/security-review.mdWhat to include
AI findings tableFinding, file evidence, risk, grade, and one sentence explaining the grade.
My manual findingsFindings you identified without relying on Codex output. These are usually Valid, but still need evidence.
ReconciliationThree columns: Agreement, AI-only, You-only. The You-only column is where your business logic and threat-model judgment often appears.
Top-3 backlogThe three most important Valid findings, ranked by severity and given suggested owners or next actions.

Key ideaThe You-only column is the evidence of your judgment. An empty one usually means the manual scan was skipped.

Before you call it done

The notes’ verification checklist for this activity. The only code change the module allows here is an optional, explicitly approved one-line fix; prompt 5.2X asks for the diff without applying it and sends anything larger to the backlog.

  • Every AI finding has one grade: Valid, False Positive, or Noise.
  • Every grade has a one-sentence explanation.
  • The report includes at least one manual finding or a clear note explaining what you checked and found.
  • The reconciliation section includes Agreement, AI-only, and You-only categories.
  • The top-3 backlog contains concrete next actions, not just a list of risks.
  • No feature work or broad app/ edits were accepted as part of this activity.

Key takeaways

  • The AI audit is input to grade, not a report to submit.
  • Valid is real for this repo; False Positive is wrong about behavior, severity or context; Noise is true but not actionable.
  • Close the AI output and scan yourself with the six lenses.
  • You-only is the most important column; the backlog needs owners and next actions.

Built from the Module 5 lecture notes, prompt library and additional readings; the videos they accompany were not supplied.

Your study checkpoint

Ready to continue?

Mark the lesson complete once you have read it and tried its idea on something real.

Next · Lesson 4