# Vibe Coding, AI Risk & AI Evaluation | Stanford CS193T Lecture 6 with Cynthia Bailey

## Executive summary

This lecture provides a comprehensive overview of the AI product lifecycle, moving beyond initial development to cover responsible deployment, governance, and evaluation. Key topics include 'vibe coding' (using natural language to generate software tools), the necessity of monitoring for post-deployment risks like distribution shift, and adherence to frameworks like the NIST AI Risk Management Framework (NIST AI RMF). The discussion emphasizes that robust AI systems require careful planning for data provenance, ethical considerations, and continuous monitoring of ground truth.

## Key takeaways

- Vibe Coding Process (Agentic Engineering): Vibe coding involves using English as a programming language with tools like Claude Code and Codex. The professional process follows three steps: 1) Prepare a detailed scope of work (using the 'elephant and goldfish' process). 2) Hand the spec to a fresh coding agent (Goldfish) in a coding environment. 3) Review the generated code by a second, skeptical Goldfish agent, even if the human cannot read code. (Timestamp: 0:00)
- Post-Deployment Monitoring is Critical: AI systems require monitoring after deployment because conditions change. Risks include 'distribution shift' (changes in the real-world data distribution) and changes in user behavior (e.g., prompt injection attempts). Pre-deployment testing on historical data cannot catch these novel failures. (Timestamp: 15:00)
- NIST AI Risk Management Framework (AI RMF): The NIST AI RMF is a guidance framework, not a precise standard. It mandates a continuous, whole-life cycle approach with three components: Map (self-reflection on risk/data sources), Measure (inventing new ways to quantify risk and performance), and Manage (implementing mitigation strategies). (Timestamp: 32:00)
- Evaluation Challenges and Bias: Evaluating AI is difficult because 'ground truth' (the actual state of the world) is often obscured by 'data sets of convenience' (data that is readily available but not representative of reality). Furthermore, evaluation must account for 'survivorship bias,' which ignores data on outcomes for those who were excluded or 'fired.' (Timestamp: 40:00)

## Technical details

- Vibe Coding / Agentic Engineering: A method of using natural language (English) to guide AI tools (e.g., Claude Code, Codex) to generate functional software tools, allowing the AI to 'write itself out of a job' for recurring tasks. This is presented as a professional alternative to calling a full LLM every time. (Timestamp: 0:45)
- Distribution Shift: A change in the real-world conditions or data distribution that causes an AI model, trained on historical data, to fail or behave unexpectedly when deployed in a new environment. (Timestamp: 15:00)
- NIST AI RMF: The National Institute of Standards and Technology's framework for managing AI risk. It guides organizations to adopt a cyclical approach: Map (risk assessment), Measure (performance metrics), and Manage (mitigation). (Timestamp: 32:00)
- Survivorship Bias: A statistical flaw in AI evaluation where data is only collected on the samples that 'survived' a process (e.g., retained employees), leading to an incomplete understanding of the overall population's performance. (Timestamp: 40:00)
- LLM-as-Judge Pattern: A technique used to address the difficulty of measuring subjective or nuanced AI outputs (like bias or kindness) at scale. A second LLM is used to evaluate the responses generated by the primary LLM. (Timestamp: 55:00)

## Practical implications

- When building AI tools, always plan for the post-deployment phase, anticipating changes in user behavior and data distribution.
- Adopt a structured, multi-stage development process (like the Goldfish/Elephant process) to maximize code quality and minimize human reliance on code reading ability.
- When designing evaluation metrics, recognize the limitations of historical data and actively plan for how to address potential biases like survivorship bias.
- For organizational compliance, understand the data classification rules (e.g., Stanford's data classifications) and ensure the chosen AI tools are approved for the risk level of the data being processed.

## Topics

AI Governance, Responsible AI, Software Engineering, Machine Learning Evaluation, Natural Language Processing, Stanford Online, NIST AI Risk Management Framework (NIST AI RMF)

Source: https://www.youtube.com/watch?v=0Uk4uLjuEeY
