Lawmaker Magda al-Adala said that the law means those found guilty of torture or abduction could face up to 10 years in prison.
The law is a measure of the many challenges Libya faces as it works to restructure its police and military force and overhaul its judiciary after more than four decades of dictatorship under ousted leader Moammar Gadhafi.
The government often depends on militias to fill the security vacuum, but has also tried to bring them under its authority and criticized their abuses, including the arrest and captivity of citizens without due process in illegal prisons.
It is not clear how the government will apply the law in the absence of a strong police force.
"The country is currently weak," Prime Minister Ali Zidan told reporters a day earlier, on Monday. "This is the reality as the nation moves from being weak to being strong and from chaos to order," he said.
Zidan himself has faced threats from armed groups who besieged him in his office last month over remarks he made threatening to summon outside help to confront militias.
Shortly after, his chief of staff Mohamed Ali Ghatous was abducted.
Ghatous was freed late Monday, according to deputy Prime Minister Abdel-Salam al-Qadi.
He gave no further details Tuesday about the kidnapping or release.
On the same day of the abduction, dozens of militiamen had also surrounded the Justice Ministry for another siege after the minister said that some of the militias were illegitimate and were operating illegal prisons.
Ghatous went missing as he was driving from Libya's third largest city of Misrata to the capital. His car was found by the side of the road. Zidan told reporters on Monday that four vehicles belonging to a militia were involved in Ghatous' March 31 abduction east of the capital Tripoli.