Thermal barrier
A finished basement is occupied space, so the foam gets a qualifying thermal barrier in front of it: 1/2 in gypsum board, 23/32 in wood structural panel, or a tested equivalent. Foam left bare behind a stud wall with no board depends on an exception or an approved assembly; confirm which with the official before you frame.