Prompts for secure AI-assisted coding
You are now building web applications with sensitive financial data, and are using test-driven prompting to make sure your code to validate customer emails is robust. Instead of asking the model to code directly, you’ll define explicit tests and edge cases first so that model generates code that satisfies them.
This exercise is part of the course
AI-Assisted Coding for Developers
Exercise instructions
- Write a prompt that tells the model to implement a Python function that validates email addresses that are in the format "[email protected]", rejects formats that do not contain the "@", and raises a ValueError for empty input.
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
 Start Exercise
Start Exercise