Wa `alaykum As-Salamu waRahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Putting a knife on a child in order to protect him is an objectionable act and there is no sound source for it. It is not allowed to do such a thing.
Answering your question, the late Saudi scholar, Sheikh Ibn Baz (may Allah have mercy on him) stated:
This is an objectionable act and there is no sound source for it. It is not allowed to do such a thing. What is legally sanctioned is to seek refuge from them by Allah’s complete words from every devil and poisonous pest, as has been confirmed from the Prophet (peace be upon him). He used to seek protection by those words for his grandsons al-Hasan and al-Husain Ibn `Ali (may Allah be pleased with them all).
It is also sanctioned to make du`a’ for them by asking Allah to protect them from every evil. As for putting a knife or something similar, of iron, wood or other substances, with the belief that such will protect them from the jinn, it is an evil practice that is not allowed.
Similar is the ruling with respect to hanging an amulet over them, which is what is called al-tama’im. This is not allowed because the Prophet (peace be upon him) said: “Whoever hangs an amulet, Allah will not complete[his affair] for him” (Ahmad, Ibn Hibban and others)
In another narration, the Prophet (peace be upon him) said: “Whoever wears an amulet has committed shirk.” (Ahmad and al-Hakim)
Almighty Allah knows best.
Source: Islamic Fatawa Regarding Women, Compiled by Muhammad Ibn Abdul-Aziz Al-Musnad and translated by Jamal Al-Din Zarabozo, Darussalam, 1996.