New York (CNN) A 19-year-old man who authorities say texted undercover agents that he planned to conduct a terror attack in the name of ISIS in New York was ordered held without bail on Friday.

Awais Chudhary appeared in the United States District Court for the Eastern District of New York in Brooklyn and was charged with one count of material support to a terrorist organization, specifically ISIS. He did not enter a plea during his court appearance.

Chudhary was born in Pakistan, and authorities allege he was inspired by ISIS and planned to conduct a stabbing or bombing attack in Queens. He was under constant surveillance by law enforcement and did not pose a danger to the public, a law enforcement source told CNN on Thursday.

He interacted with agents on a message board where he discussed plans to commit a stabbing in his Queens neighborhood, prosecutors said in court. He was arrested Thursday when he went to pick up a knife, which he ordered online, at an Amazon lockbox, prosecutors said.

Chudhary's attorney, Sam Jacobson, attempted to paint him as a child and asked the judge to consider the "level of fantasy." He also implied that the agents lured Chudhary into buying a knife.

Read More