The teenager, who cannot be named for legal reasons, is not allowed to leave the jurisdiction of England and Wales after he was made a ward of the court.
At a hearing in the family division of the High Court in London, Justice Hayden took the action against the boy of joint British and Libyan nationality after local social services staff raised fears that he too might travel to Syria.
He said he had balanced the teenager's human rights and added, "The balance falls clearly in protecting this young man, ultimately from himself".
Three of the boy's brothers had reportedly gone to fight for the al-Nusra Front - a group with links to al-Qaeda.
Also Read
Two had died in their teens and the third had been wounded but was still fighting in Syria. A friend of the teenager had also been killed in the fighting.
He also questioned how parents could have no idea that their children might be planning to travel to war-torn areas of the Middle East for "martyrdom".
He said that while he could understand how children could trick parents by saying they were visiting a friend when they were going on a night out, it was hard to understand how children could mislead their parents into getting them a passport to travel.
The woman, identified as JNH, was detained at a bus station in Ankara on Monday after Turkish authorities acted on their own intelligence.
Turkish officials said that correspondence and images on the woman's mobile phone indicated she was planning to head to IS territory.
A UK Foreign Office spokesperson said, "We can confirm the detention of a British national in Ankara and we are providing consular assistance".