News of the project, aimed at preventing child abductions, comes as a Scottish Office report on sex offenders recommends that all education authorities and independent schools should have such programmes in place to help pupils live safely and to enable them to reject "inappropriate behaviours".
The report, by Angus Skinner, the Government's chief social work inspector, also suggests that schools should help develop relationship and parenting skills in boys and men as part of a long-term solution to help them build proper emotional ties and prevent them becoming abusive.
Ministers have accepted these recommendations in principle but unions warn that curriculum and staff time is limited.
The Scottish curriculum already has building blocks in place to take these suggestions on board, including personal and social education, health education, home economics and moral education. The concentration is on the 5-14 stages.
"Keeping Myself Safe", the Edinburgh project, which will be piloted in five primaries and a special school after Easter, breaks new ground in being targeted specifically at the very youngest children. Susan Hamilton, Edinburgh's principal education officer (personal safety), said it is also "cognitively compatible" with their learning stage, which existing programmes are not. "Most young children do not understand what a stranger is since it is too abstract a concept," Dr Hamilton said. "Existing programmes leave pupils more confused than anything else. When we asked children what they had been learning in personal safety classes, for example, one said they shouldn't go with crocodiles and another was worried about being captured by aliens on the way home."
Dr Hamilton said "getting it right" was crucial. The Edinburgh programme, which consists of up to eight hours of classroom lessons, is the product of two years' work by a multidisciplinary team of teachers, the police and health experts. It also draws on the most recent research, based on interviews with paedophiles, to set up safe and unsafe scenarios for pupils.
The project will include key features of Edinburgh's much-praised "Feeling Yes, Feeling No" programme, which has introduced primary six children to sex abuse topics for the past 10 years and earns particular praise from Mr Skinner.
The Government accepts the recommendation that schools should take action. Henry McLeish, the Home Affairs Minister, said: "We shall look to education authorities to establish personal safety programmes for pupils to help them develop the skills and confidence they need to enable them to live safely. "
The Skinner report says present educational provision on child safety is "patchy".
A Commitment to Protect is published by HMSO at Pounds 8.50.