A federal judge has barred Roger Stone from talking about his case and anyone involved in it.

Judge Amy Berman Jackson announced Thursday afternoon, after a contentious and colorful hearing, that Stone may be jailed if he talks about the investigation he’s involved in, the case against him, or anyone involved in either. She noted that that includes communication over Facebook, Snapchat, and Instagram. She added that he can still look to raise money for his legal defense fund.

“You apparently need clear boundaries, so there they are,” she said.

The ruling came after Roger Stone apologized profusely to her , saying he regretted posting a picture of her with a crosshairs next to her head on his Instagram account earlier this week .

“I am kicking myself over my own stupidity,” he said.

He also said he has exhausted his savings and is struggling to pay rent and afford food for his family.

“I can’t rationalize my thinking because I wasn’t thinking and that’s my own fault,” he said.

Over the next 45 minutes, Judge Jackson and Jonathan Kravis, a lawyer from Special Counsel Robert Mueller’s team, grilled Stone about his Instagram post. The post in question criticized the judge as an Obama appointee and suggested the proceedings were rigged. Stone removed the post shortly after putting it up and formally apologized to the judge a few hours later.

In court, Stone’s attorney Bruce Rogow offered to place him on the witness stand, where he reiterated his apology to the judge and fielded questions. Over the course of lengthy questioning, he said he was sent several pictures of the judge—he insisted he didn’t know who sent them—and that he chose to post the one with the crosshairs. Stone also said he wrote the derogatory caption of the picture himself. And, noting that he hadn’t found the pictures, he claimed to lack technical proficiency.

The judge then asked him if he knew how to use Google search.

“How hard was it to come up with a photograph that didn’t have a crosshairs in the corner?” she said.

“I didn’t even notice it until it was brought to my attention by a reporter,” he insisted.

Kravis then asked Stone a battery of questions about how the picture got into his phone, who has access to his phone, what other social media platforms he uses (only Facebook, he replied), how many volunteers he has, who those volunteers are, etc. Kravis also asked if Stone still had the initial image of Jackson on his phone.

“I erased all the images, your honor,” Stone said, “because I didn’t want to make the same mistake twice.”