The hearing, to determine if Khan should remain in custody until his trial, was continued until Oct. 21.
Prosecutors filed a motion Wednesday night asking Judge Susan Cox, a federal magistrate judge, to keep the detention hearing closed to the public. Their explanation was sealed.
Khan, a U.S. citizen, is charged with attempting to provide material support to foreign terrorists. A conviction carries a maximum 15-year prison term.
Khan is accused of trying to fly to Syria to help ISIS. FBI agents arrested him at O'Hare International Airport on Saturday as he tried to board a flight to Turkey.
Investigators said Khan left a letter for his parents in his bedroom expressing disgust with western society. FBI agents found maps and drawings of an ISIL flag.
Khan had a $4,000 round-trip plane ticket to Istanbul, but told agents he planned to stay permanently and serve Islamic forces.
The Associated Press contributed to this report.