Input validation recipe