Prison wardens are usually preoccupied with keeping people inside their walls. Now six Canadian prisons are taking steps to shoo away some pesky, flying visitors.

The Correctional Service of Canada has earmarked $6 million for electronic systems to prevent tiny drones from dropping illegal drugs, cellphones or other contraband into the yards of its institutions.

The prison service is alarmed by cases of small, easily purchased flying devices delivering forbidden items weighing up to five kilograms to prisoners from the air.

In one case, the service intercepted a drone-carried package containing $26,500 worth of drugs and tobacco at medium-security Matsqui Institution in British Columbia just before Christmas 2017.

The service fears the camera-equipped copters could also be used in illicit surveillance operations to glean intelligence that might help with escapes.

In addition, it wants to be able to catch anyone on the ground attempting to just throw a package of contraband over a perimeter fence.

It is seeking a contractor to supply, install and test intrusion-detection systems as well as provide training on how to operate and maintain them.

The systems will be evaluated in a pilot project over the next four years at six prisons: Mission in B.C., Stony Mountain in Manitoba, Cowansville and Donnacona in Quebec, Collins Bay in Ontario, and Dorchester in New Brunswick.

A report will then provide recommendations on next steps with respect to a cross-country rollout, said Correctional Service spokeswoman Esther Mailhot.

Detecting drugs and other contraband is an "ongoing and challenging task" despite practices including searches of offenders, visitors, employees, cells, and vehicles, sometimes using ion scanners and detector dogs, Mailhot said.

"CSC continues to research and introduce new technology as it becomes available to better facilitate the detection of contraband, including drone detection," she said. "Preventing the introduction of contraband and reducing the use of illicit substances by offenders in correctional institutions is a priority for us."

Federal solicitation documents describing the project say initial research conducted with the help of the National Research Council indicates a radar-based detection system represents the "most mature technology" for intercepting drones. However, it is possible to jam radar systems.

The chosen setup should warn the operator of the presence of an approaching drone at "as great a distance from the perimeter of the institution as possible" to give staff time to mount a response, the documents say.

The prison service also wants the system to:

— Detect an intruder approaching the fence to do a "throw-over";

— Automatically identify detected targets, such as a person, car, bird or drone, based on characteristics and behaviour;

— Provide a means for staff to see, even at night, where a drone drops its payload and be able to identify nearby people;

— Support a means of allowing friendly drones to be used without generating nuisance alarms.