A senior Police Scotland officer who flagged-up concerns about a spying operation to flush out a journalist’s sources is being sidelined by the force, according to insiders.

Detective Superintendent Brenda Smith, one of the country’s experts on the Regulation of Investigatory Powers Act (RIPA), is expected to leave the crime campus at Gartcosh imminently for “project” work.

Scottish Tory MSP Douglas Ross said: “If this move is a punishment for having previously raised objections then it is clearly unacceptable, and people would expect Police Scotland to re-think this move.”

In 2015, Police Scotland’s Counter Corruption Unit (CCU) unlawfully used the RIPA to find out whether serving and retired officers had leaked details to a newspaper about the failed probe into murdered prostitute Emma Caldwell.

Under the law, the force was supposed to obtain judicial authorisation for the RIPA operation, but instead pushed through the applications internally.

The rogue operation led to Holyrood committee hearings and an Investigatory Powers Tribunal, which considered a remedy for the affected individuals.

Ms Smith, who was in the Specialist Crime Division, made it clear during the process that she believed judicial permission would be required. One of her internal emails stated: “I would suggest this falls into the category of requiring judicial authorisations.”

However, her advice was ignored and the row dogged Police Scotland for over a year and even landed on the First Minister’s desk.

It is understood Ms Smith is to be moved from her current position of Senior Responsible Officer – a role that means she has to report any errors made under the RIPA – to another job.

Force insiders said her knowledge of the RIPA and its successor, the Investigatory Powers Act, is unrivalled north of the border and the move reflects badly on the force.

One senior source said: “Brenda has been one of the few honest voices in all of the scandals the force has faced. It’s obvious that, with more dirt to come, her unwillingness to be silenced is seeing her sidelined.”

Another insider said: “The whole of Gartcosh is speechless.”

She gave evidence to a Holyrood committee last year on the IPB because of her expertise on lawful access to communications data such as phone records and texts.

Ross, who is the Scottish Conservative Shadow Justice Secretary, added: “It seems short sighted to move one of the country’s experts on investigatory powers away from a role where her knowledge would clearly be of the most use.”

A Police Scotland spokesperson said: "All appointments, secondments and selection to work on projects in Police Scotland are made to meet business needs and ensure we have the best person with the right skills in post. Superintendent Smith is a senior leader in Police Scotland whose specialist skills and knowledge are recognised and valued by senior management in the service and will continue to be relied upon as we further develop our ability to protect the public. Any such decisions are an internal matter for Police Scotland and it would be completely inappropriate to comment further at this time."