The new Prime Minister spent six years as Home Secretary but Theresa May's legacy at the Home Office is not one to be proud of. She cut front line police services relentlessly and her record on civil liberties was appalling.
Two years ago, at the height of summer, she rushed through legislation that gave GCHQ the power to force companies to hand over their customers' personal data, including phone records and information about emails and browsing history.
She used the spectre of terrorism to justify the legislation, called the Data Retention and Investigator Powers Act (DRIPA), but it was poorly drafted and deeply flawed. Among other things, it effectively gave the Government the right to monitor mobile phone data and internet browsing history without the approval of a judge. That's why I took the unusual step of joining forces with my Conservative party adversary David Davis to sue the Government in the High Court.
We won our case last summer, but the Government appealed to the European Court of Justice. In the meantime, May bought forward new legislation, the Regulation of Investigatory Powers Act (RIPA), which is as similar to the last legislation as it sounds. It is currently going through Parliament, where it is being debated in the House of Lords. Labour won a series of valuable concessions, including an independent review of all bulk powers, increased judicial oversight, improved thresholds for access and an undertaking that a far smaller number of public bodies would be able to access that data. But it still places too much power in the hands of state agencies, with too few protections for the public.
Thankfully that could still change. On Tuesday the advocate general of the European Court of Justice issued a legal opinion that is broadly supportive of the case we set out in the UK's highest court. His opinion is not the last word on the subject, but it is highly unusual for the European court to take a different view. The legal opinion is hugely significant because it supports our case that domestic governments shouldn't be allowed to demand access to reams of digital and electronic information, without independent authorisation. It also makes it clear they should exhaust all other less intrusive options before doing so. Significantly, the initial finding concludes the collection of bulk data is only legal if the information is used by law enforcement agencies to tackle serious crimes.
David Davis, who was promoted to the cabinet last week, when he was handed responsibility for negotiating the UK's exit from the EU, will no doubt appreciate the irony that the European court has stepped in to protect the UK from legislation passed by his own Government - particularly as he campaigned so vociferously for Brexit.
The collection and retention of personal data by corporations and governments makes many of us feel instinctively uneasy. We are happy for Netflix to use our past purchases to recommend films we might enjoy or for Google to use similar technology to bring up the most relevant search results. But many of us don't want our mobile phone data or internet browsing history to be used for commercial gain and the idea that it can be monitored by the state without good reason is deeply disturbing.
The security services have an important job to do keeping us safe and they carry it out with distinction but many of us question whether mass surveillance and state snooping is a price worth paying. Judicial oversight is essential if we are to maintain the right balance between civil liberties and state power. I hope the new Prime Minister will reflect on this. Strong leaders are capable of recognising they made mistakes in the past and taking steps to rectify them.
Tom Watson is deputy leader of the Labour Party, and the Labour MP for West Bromwich East
This blog first appeared on Tom's website, and can be read here