Taking effect from Monday, the law comes on the heels of the first assassination of its kind in the tiny gas-rich emirate.
Amir Shaikh Hamad bin Khalifa Al Thani signed the bill after it was approved by the cabinet and the Shura Council.
Fahd bin Mubarak al-Khayarin, the Shura's secretary general, denied the law was a knee-jerk reaction to the Yandarbiyev killing.
Al-Khayarin told journalists the bill had been debated "throughout December and over several sessions".
Although he declined to provide specific details, al-Khayarin hinted the legislation was "based on similar laws in neighbouring and Arab countries".
This suggests Doha will now allow detentions of suspected international terrorists based on secret evidence without a criminal trial.
Similarly, state-vetted defence counsels will now exist to ensure intelligence information heard during the trial is sufficiently secret to protect the security service's sources.
Yandarbiyev, who had been in Qatar for three years, died on Friday when a blast hit his white Land Cruiser in a residential area of Doha after he left weekly noon prayers at a mosque.
His 13-year-old son was wounded in the blast, which Qatari authorities are still investigating.
Russia had demanded Yandarbiyev's extradition, but its SVR foreign intelligence service denied Chechen rebel accusations that it was involved in the death of the 51-year-old former leader of the war-torn republic.