legally mandated