All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
Islam has urged Muslims to perfect their work to win the love of Allah the Almighty and the people as well because the Messenger (Blessings and peace be upon him) said: "Allah loves that when one of you does something, you do it well." {Related by Baihaqhi in Sho`ab Al-Eman}. Accordingly, a talented engineer or technician is offered a huge number of employment contracts from different companies and has the right to choose the company that makes the best offer and appreciates his expertise. In fact, Islam has guaranteed this right by making contentment and acceptance an element of the contract and commanded adherence to the agreed terms. This is attested to in the verse where Allah the Almighty says {What means}:" O ye who believe! fulfil (all) obligations." {Al-Mai`dah, 1}. Moreover, Kathir bin 'Amr bin 'Awf Al-Muzani narrated from his father, from his grandfather, that the Messenger of Allah (Blessings and peace be upon him) said: "………. And the Muslims will be held to their conditions, except the conditions that make the lawful unlawful, or the unlawful lawful." {Related by Tirmithi}.
Based on this, income earned from working for these companies is legitimate livelihood as long as the work itself is lawful from the perspective of Sharia, not against state regulations, nor undermines them. This is , of course, if the state allows such companies to attract resource persons in the first place. However, if the country lacks such persons, then it is permissible for the ruler or responsible bodies to stop them from working for these foreign companies due to the harm that will be caused by losing them and not having others to replace them.
An-Nawawi said: "In his book entitled "Al-Ghiathi", Al-Jouwaini (May Allah have mercy on him) said: "Collective duty is better than individual duty in terms of reward in the sense that its doer benefits the whole Muslim nation and wards off sin from it while the reward and benefit for an individual duty goes to one person." {Al-Majmou` Shareh Al-Mohath-thab, V.1:22}.
We recommend supporting these talented persons so as to encourage them not to leave their homeland. This can be done through creating proper jobs as well as offering wages and incentive that are more or equal to those offered by foreign companies. Another purpose is to keep them in country, benefit from their expertise, and encourage others to learn their skills and trades.
In the meantime, it isn`t permissible for these employment agencies to send incompetent staff to foreign or local companies as this damages the reputation of national manpower and makes outside parties refrain from attracting them. And Allah the Almighty knows best.