The 46-year-old actress will portray Rebecca Wright, a tough criminal court judge who spends her off-time partying and being reckless, while the 33-year-old actor will play Gary Boyd, a psychiatrist and expert witness who is Wright's on-and-off again lover.
Walsh is best known for her role as Dr. Addison Montgomery on the ABC medical dramas Grey's Anatomy and Private Practice. She also appeared as Gina Hess on FX's Fargo, and currently stars on DirecTV's Full Circle.
Hansen came to fame as Dick Casablancas on The CW's Veronica Mars, and starred as Kyle Bradway on Starz series Party Down. He last appeared on CBS' midseason comedy Bad Teacher.
Bad Judge was created by Will Ferrell and Adam McKay, who co-founded website Funny or Die and co-wrote Anchorman, Talladega Nights and The Other Guys. The program co-stars Theodore Barnes, John Ducey, Tone Bell and Miguel Sandoval, and will premiere on NBC this fall.