The permanent structure will replace a temporary barrier which has been in place since 2013.
Work on the trap is a collaboration between Historic Environment Scotland (HES) and the City of Edinburgh Council.
Construction will begin on Monday and is scheduled to last until March 2016. The trap consists of a wall about 3ft (1m) high, topped with metal railings.
HES director of heritage management Barbara Cummins said: "It's important that the public are assured that we have no immediate concerns regarding the rock face, however as impenetrable as the castle rock might appear, it's not immune to the effects of the weather.
"The constant freeze and thaw during the winter months can open up cracks in the rock face, which then allows a plant known as valerian to take root.
"Once this germinates the bulb expands and, over long periods of time, this process can cause rocks to fracture and fall."
There will be some traffic and parking restrictions on Johnston Terrace while the work is carried out.
Ms Cummins added: "At the moment we have a temporary structure in place which offers significant protection, and we supplement that by having our highly trained staff abseil down the rock on a regular basis to carefully remove loose fragments from the surface.
"Whilst these measures help to minimise the risk of rock falls, the regular monitoring and scaling is time consuming and ultimately disruptive to visitors to the castle and drivers on Johnston Terrace, which has to be closed whilst work is being carried out.
"The new rock trap will enhance our current risk control arrangements and reduce disruption in the process."
A new rock trap is to be constructed at Edinburgh Castle.