Libyan authorities granted immunity to former rebels who fought to oust Moammar Gaddafi's regime and has criminalised any glorification of the former leader, in laws passed on Thursday.
"There is no punishment for acts made necessary by the February 17 revolution," read the law published on the National Transitional Council's website.
The immunity covers "military, security or civilian acts undertaken by revolutionaries with the aim of ensuring the revolution's success and its goal," the NTC added.
February 17 marks the start of a popular uprising which led to the collapse of Gaddafi's regime last year.
It was unclear if the law includes acts committed after October 23, when the NTC declared Libya's liberation following the capture and killing of strongman Gaddafi.
Rights groups say war crimes were committed by both sides during the 2011 conflict and warn of torture in detention centres run by militias made up of former rebels.
In further legislation to govern the country's transition, the NTC criminalised the glorification of Gaddafi or his regime.
"Praising or glorifying Moammar Gaddafi, his regime, his ideas or his sons... is punishable by a prison sentence," said the text of the law read out to reporters by a judicial official after a high-level meeting.
"If those news reports, rumours or propaganda cause any damage to the state, the penalty will be life in prison," the official quoted the text as saying.
"In conditions of war, there is a prison sentence for any person who spreads information and rumours which disrupt military preparations for the defence of the country, spread terror or weaken the citizens' morale," he added.
According to the law, Libya is still in a state of war following the 2011 bloody conflict that pitted Gaddafi loyalists against NATO-backed rebel forces.
A third law for the transition stipulates prison sentences for anyone who "attacks the February 17 revolution, denigrates Islam, the authority of the state or its institutions."
And another law confiscates all property and funds belonging to figures of the former regime, including Gaddafi's relatives, placing them under the care of the judiciary.
The tough legislation comes just weeks before elections for a constituent assembly which the NTC has pledged to hold in June.