Intern Track Roadmap

AI safety: review before copying

This course builds a four-question checklist for reviewing AI code suggestions in a Rails app before accepting them. Separate lessons cover each question: whether a suggestion does what was asked, adds a security issue, duplicates existing logic, or breaks this codebase's conventions. Examples include an unscoped uniqueness validation, a create action fixed with permit!, an inline published query, and a controller holding business logic. A worked example on an Article predicate applies all four questions by reading the code and tracing inputs by hand.

What you'll learn

  • ✓Why fluent, idiomatic AI code can still enforce the wrong rule
  • ✓Checking a suggestion against the exact wording of the request
  • ✓Spotting mass assignment risks such as permit! in AI fixes
  • ✓Keeping one definition of a rule on the model, such as a published scope
  • ✓Comparing suggestions with this project's layer contract and service object pattern
  • ✓Tracing edge inputs by hand, such as a draft with nil published_at
Free preview · Lesson 1 2 min read

Plausible but wrong: the AI review problem

An AI assistant suggests a validation, a query or a whole controller action, and every line reads like something a competent Rails developer would write: tidy indentation, the right method names, the usual Rails idioms. None of that tells you whether the code is correct. A language model's fluency…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...