Internet firms will have to store data on what people access online for a year, under new surveillance law plans.
At the same time, ministers are proposing senior judges will have unprecedented powers to block operations to intercept communications.
The draft Investigatory Powers Bill aims to completely overhaul how police and security agencies use covert powers to detect and stop crime.
Home Secretary Theresa May is now unveiling the plans in the Commons.
- Follow the latest developments on our live page
The large and complex bill also contains proposals covering how the state can hack devices and run operations to sweep up large amounts of data as it flows through the internet.
The legislation brings together a variety of existing powers that cover how the home secretary and other ministers can authorise operations to intercept communications – such as telephone taps and other surveillance.
But it also proposes to order communications companies, such as broadband firms, to hold basic details of the services that someone has accessed online – something that has been repeatedly proposed but never enacted.
This duty would include forcing forms to hold a schedule of which websites someone visits and the apps they connect to through smart phones or tablets.
Police and other agencies would be then able to access these records in pursuit of criminals – but also seek to retrieve data in a wider range of inquiries, such as missing people.
Local councils will retain some investigatory powers, such as surveillance of benefit cheats, but they will not be able to access this online data.
Under the proposals, a new team of judges will form a new Investigatory Powers Commission, which the Home Office says will provide world-leading oversight of how police, MI5 and others intercept and gather data.
When police or security agencies apply to intercept someone’s communications, their plans would have to be first signed off by the home secretary – as is currently the case – but then approved by one of these judges.
In urgent situations, such as when someone’s life is in danger or there is a unique opportunity to gather critical intelligence, the home secretary would have the power to approve an interception warrant without immediate judicial approval.
The judges would also be able to refer serious errors to an outside tribunal which could then decide to tell the individual their data has been illegally collected.
‘Most important bill’
The draft bill also places a legal duty on British companies to help law enforcement agencies hack devices to acquire information if it is reasonably practical to do so.
The bill does not propose forcing overseas companies to comply with these orders.
Speaking at Prime Minister’s Questions, David Cameron said the bill was “one of the most important this House will discuss”, adding: “We must help the police and security and intelligence services to keep us safe.”
London Mayor Boris Johnson warned that the new powers must not be used as an “instrument of oppression”, saying the proposed law was “defensible if and only if it’s supervised by a judge”.
Mrs May has long called for new laws to give police and security services the power to access online communications data, saying some sites had become “safe havens” for serious criminals and terrorists.
She has argued for similar rules to those governing phone records – which can be accessed without a ministerial warrant – for online communications.
The bill will force companies to hold “internet connection records” for 12 months so they can be requested by authorities.
Such data would consist of a basic domain address, and not a full browsing history of pages within that site or search terms entered.
For example, police could see that someone visited www.bbc.co.uk – but not the individual pages they viewed.
Opposition parties, civil liberties campaigners and some Conservative MPs have raised concerns about the government’s plans, which were briefed to cabinet ministers on Tuesday and first announced in May’s Queen’s Speech.
Among the safeguards emphasised by Home Office sources would be a new criminal offence of “knowingly or recklessly obtaining communications data from a telecommunications operator without lawful authority”, carrying a prison sentence of up to two years.
Mrs May has said the bill does not include some “contentious” parts of the 2012 plan, dubbed a “snooper’s charter” by critics.