Lord Advocate Frank Mulholland QC is promising prosecutors will "take a firm line" with those who carry out attacks on buses, trains and other forms of public transport.
The new pilot scheme will mean there will be a presumption that anyone involved in criminal behaviour on public transport will be prosecuted.
For violent offences where a transport worker is injured, there will be a presumption that the case will be dealt with by a sheriff and jury - increasing the chance of a jail sentence being imposed.
The pilot will run throughout December and will go on until January 6.
Launching the scheme, the Lord Advocate said:"For those who carry out attacks on public transport workers, no matter what injury is caused, prosecutors will take a firm line and offenders will face serious petition proceedings."
He said: "I hope that this policy will act as a deterrent as I want people to feel and be safe while travelling on our buses and trains. Anyone who jeopardises the safety of others will have to face the consequences of their actions."
Both Transport Minister Keith Brown and the British Transport Police welcomed the initiative.
Mr Brown said: "The increased threat of a jail sentence can only strengthen existing efforts to improve safety on our buses, trains and the wider transport network.
"For those foolish enough to even consider attacking public transport workers prosecutors are leaving them in little doubt of the consequences, and will also help reduce fear of crime."
Chief Superintendent Ellie Bird, Divisional Commander (Scotland) of British Transport Police, said: "I welcome and wholeheartedly support the prosecution policy announced by the Lord Advocate.
"Although crime on Scotland's rail network is at a nine-year low, keeping passengers and rail staff safe is a priority."