State tax filing

Does the "divorce or separation agreement" have to be legally recorded, or is an informal agreement sufficient?