Benula Bensam, 24, had filed a lawsuit against Bharara, federal prosecutors Reed Brodsky, Richard Tarlowe and the US Marshals Service in the US district court in July.
US District Judge Andrew Carter, however, dismissed the claims Bensam had filed against Bharara, Brodsky, Tarlow, Department of Justice and the US Marshals Service "for failure to state a claim on which relief can be granted."
The law student had got into trouble during the Gupta trial in June after she sent three letters to presiding Judge Jed Rakoff on the case.
During one of the court proceedings in the trial, Bensam was escorted out of the courtroom by US marshals and questioned over the letters she had sent to the judge.
She said in the lawsuit that the marshals questioned her at length and refused to return her cell phone saying she could get it back only after she had answered all their questions.
The marshals also attempted to take her picture with a mobile phone. Bensam also alleged that her phone had been tampered with by the court security.
In the lawsuit Bensam had alleged she was subject to "unreasonable search and seizure for unlawful stop, detention, interrogation, seizure of property, search of property, search of communications and demand for identification." She is representing herself.
Carter said Bensam's only allegations against Brodsky and Tarlow are that they "knew of the letters [she] had written to Judge Rakoff" and "may have instigated the involvement of the US marshals."
Similarly, Bensam's allegations that Bharara "may have instigated the involvement of the US marshals," and "has advocated the use of intrusive surveillance" fail to state a claim that he failed to do anything that violated Bensam's rights, the judge ruled.
"Bensam's claims against defendants Brodsky, Tarlow and Bharara are therefore dismissed for failure to state a claim on which relief can be granted," the order said.
Five members of the US marshals service, who were on duty during the incident involving Bensam, have also been sued although the lawsuit does not identify them by name.
Carter has ruled that the US attorney for the marshals service should ascertain the identity of the five members. The attorney is then required to provide the information to Bensam and the court within 60 days of the date of the order.
Bensam must then file an amended complaint, which would replace and not supplement the original one, naming the five Marshal agents within 30 days of receiving the information.