OPINION: The intelligence watchdog Cheryl Gwyn has criticised the Security Intelligence Service (SIS) for illegally accessing Customs information, and for being slow in dealing with her investigation. She accuses the SIS of dragging their feet and being reluctant to share their internal legal advice about whether they were acting lawfully.

This is a clear rebuke by the Inspector-General of Intelligence and Security and raises a number of concerns. The spy agencies have acted unlawfully before. The worst case was when the Government Communications Security Bureau (GCSB) snooped on Kim Dotcom, apparently unaware that as a permanent resident he could not be spied on by that agency. Former Cabinet Secretary Rebecca Kitteridge's damning report on the GCSB also found many others had been spied on illegally.

In this case, Gwyn in effect criticises Kitteridge, who is now head of the SIS. She says the SIS unlawfully obtained Customs data up till mid 2016 and was reluctant to engage with her office on the substantive issues. In effect, the SIS only gave its final view on the issue as late as August 2017. But this matter had dragged on for years.

DAVID WHITE/STUFF Inspector General of Intelligence and Security Cheryl Gwyn.

The SIS also "expressed some reluctance" about disclosing its own internal legal advice concerning the investigation. This was "contrary to the clear words of the legislation", says Gwyn, and long-standing practice and "impeded her ability to understand fully the operational situation".

Perhaps worst of all, she and the spies are also still at loggerheads about whether the SIS can treat the immigration data it collected illegally as if it had been collected lawfully under a new direct access agreement it now has with Immigration.

Spies are always tempted to go beyond their lawful powers. Perhaps this is a consequence of the fact that they must operate in secret and that for most of their history they have had no effective democratic oversight.

Working in the dark, they develop habits of cutting corners for their own convenience. It is exactly this habit that has led to some of the worst espionage scandals.

Gwyn is right to call the spies out on this matter and to alert the public to their unlawful activities and their apparent reluctance to face the music. This suggests that certain old habits persist even after Kitteridge herself took over at SIS.

Just what all this means remains somewhat unclear, although Gwyn says she intends to publish a report on the whole business before the end of the year. That might throw more light on the matter.

None of this would have become public knowledge without the diligent and persistent work of the Inspector-General. In effect she is the public's only real watchdog over the spies. Parliament's Intelligence Committee lacks her power; the politicians who act as the ministerial overseers of the services habitually become captive to them and have never told the public anything of use.

Democratic society owes Gwyn a debt of gratitude.

* An earlier version of the editorial incorrectly said that Kitteridge was keeping mum on the Inspector-General's report into the SIS illegally accessing Customs data. Kitteridge spoke to media soon after the report's release.