The Silk Road was very secure during the peak of the Mongolian Empire, basically the early 13th to 15th centuries.
Most of it was subsumed in Mongol controlled territory, and the movements of troops along or around it also acted as a "policing" mechanism.
Prior to the Mongols, the nearly-as-ferocious Turks maintained the security over most the Silk Road.
During times when there was no "dominant power," bandits and robbers were a real problem, as pointed out in other answers. At such times, only relatively short "stretches" of the roads, between nearby cities, were reasonably safe, and most of the shipping took place over those stretches in "relays." People that went beyond those relatively safe stretches really "paid their money and took their chances."