Draft guidance has been issued on how schools in England should search pupils for guns or knives without consent.
Folding knives with short blades may not be unlawful, guidance says
If they think screening would help, occasional random searches of groups of pupils can be conducted, it says.
Staff must have reasonable suspicion to search an individual pupil and should not rely on stereotypes - though gang symbols might be sufficient evidence.
Two trained staff must search, the same sex as the suspect. They can remove outer clothing and "pat down" a pupil.
If there is any doubt about the safety of a search, police should be called in.
The guidance, published for consultation by the Department for Education and Skills, tells schools how to use powers that were written into last year's education act by the Violent Crime Reduction Act.
It says schools can use airport-type walk-through metal detectors or hand-held "wands" costing as little as £30 to screen pupils for weapons.
If some pupils are carrying weapons then parents probably already know, and will give credit to the school for acting to stop it
At any time where there are "reasonable grounds" for suspecting someone has a weapon, they can be frisked.
"This is a legal standard and not a subjective one," the guidance says.
"The searcher must assess what constitutes, in each particular case, reasonable grounds for suspicion that a pupil may have a weapon with him or in his possessions."
It stresses: "Reasonable suspicion cannot be based on generalisations or stereotypical images of certain groups or categories of pupils ...."
But if there is reliable information that members of a gang habitually carry weapons then wearing a distinctive item of clothing or other badge of membership may provide reasonable grounds.
It says schools should publicise their rules.
Some might feel reluctant to do so if they feel it implies admitting a problem which could reduce admissions.
"But if some pupils are carrying weapons then parents probably already know, and will give credit to the school for acting to stop it," the document says.
Anyone authorised to carry out a search must have had specific training - but even then a head teacher cannot require a member of staff to search someone.
Personal searches can involve removing outer clothing and searching pockets, but should not be more intimate than that.
"The searcher can pat down a person's clothing, without directly touching the body."
The search should be done in private to preserve pupils' dignity, with due regard to religious sensitivities - if, for example, it is necessary to remove religious headwear.
"Failure to take proportionate steps to preserve the dignity and privacy of any searched pupil may lead to a breach of the pupil's rights under the Human Rights Act."
A spokesperson for the National Union of Teachers said its information was that knives and guns in schools were "not an issue".
"The difficulty lies in the fact that anything - even a pencil - can be turned into a vicious weapon in the wrong circumstances."