islam is a religion of loyalty and respect for promises, contracts and covenants. almighty allah has said:
o you who have believed, fulfil [all] agreements. (5:1)
and he said:
fulfil [every] commitment; indeed, the commitment is that [about which one will be] questioned. (17:34)
and he cited as being among the people of understanding: those who fulfil the covenant of allah and do not break the contract. (13:20)
when two messengers came to the prophet peace be upon him from musaylimah the liar1 and said what they said, he told them, "was it not that an envoy is not killed, i would have struck you both with the sword." so, it became part of his sunnah not to kill an envoy. (abu dawud)
from the examples of the prophet's peace be upon him adherence to agreements with non-believers was that of the treaty of hudaybiyyah, which he drew up with the representative of quraysh, suhayl ibn `amr. one of the treaty's clauses stated that any man coming from the quraysh to join the muslims must be sent back, and while they were still in the process of writing the rest of the treaty, abu jandal, the son of suhayl ibn `amr approached bound in chains. he had managed to come from the valley of makkah and join the muslims.
suhayl said, "o muhammad, this is the first one whose return i demand." the prophet peace be upon him said, "we have not yet completed the document." he replied, "then i will never make any agreement with you." the prophet peace be upon him said, "give him to me with compensation." he said, "i will not give him to you." the prophet peace be upon him said, "yes, do so." suhayl said, "i will not." abu jandal began to shout at the top of his lungs, "o company of muslims! shall i be returned to the polytheists and tortured to renounce my religion after i have come as a muslim?!" the messenger of allah peace be upon him told him,
"o abu jandal, be patient and expect reward. for allah will bring about for you and those oppressed with you a relief and a way out. we have made a peace treaty with the people and given them a promise on that, and they have given us a promise in the name of allah, so do not betray it." (al-bukhari)
similarly, when abu baseer, from the tribe of thaqeef who were allied with the quraysh, escaped, he went to the prophetpeace be upon him. the quraysh sent two men after him to bring him back and the prophet peace be upon him agreed to return him according to the conditions of the treaty of hudaybiyyah. this is clear evidence of the prophet's peace be upon him respect for and adherence to agreements and pacts, even in a case where it appeared to be unfair to muslims.
another example of his observance of agreements with non-muslims is what was related by al-baraa' ibn `azib: when the prophet peace be upon him intended to perform `umrah [in the year following the treaty], he sent word to the makkans requesting permission to enter the city. they had stipulated that he [and his companions] could stay there only three nights, that they could enter only with their swords sheathed and that they would not invite anyone to islam.
when these clauses were being inscribed by `ali ibn abi talib may allah be pleased with him, he wrote: this is what has been agreed to by muhammad, the messenger of allah peace be upon him. they said, "if we knew you were the messenger of allah we would not have prevented you and would have followed you. rather, write: this is what has been agreed to by muhammad ibn `abdullah."
he peace be upon him said, "by allah, i am muhammad ibn `abdullah, and by allah, i am the messenger of allah," but told `ali may allah be pleased with him, "erase 'messenger of allah'." `ali may allah be pleased with him said, "by allah, i will never erase it." so, he said, "show it to me." and when he showed it to him the prophet peace be upon him erased it with his hand.
after they had entered makkah and spent three days there, the quraysh came to `ali may allah be pleased with him and said, "tell your companion to leave." when he conveyed it to the messenger of allah peace be upon him he said, "yes," and departed. (al-bukhari and muslim) he complied with their conditions and did not stay beyond the three nights.
allah's messenger peace be upon him warned against treachery and breach of promise, saying,
"whoever gives a man a pledge of security, and then kills him – i am disassociated from the killer even if the victim should be an unbeliever." (an-nasa'i - graded saheeh by al-albani)
and he peace be upon him said, "no people breaks a treaty but that there is killing between them." (al-hakim - graded saheeh by al-albani)
the prophet peace be upon him sought refuge in allah from such behaviour and said,
"i seek refuge in you from infidelity, for indeed, it is the worst trait." (abu dawud and an-nasa'i – graded as hasan by al-albani) he peace be upon him prohibited it and said,
"for every traitor there will be a banner by which he will be known on the day of resurrection." (al-bukhari and muslim)
he peace be upon him also made it clear that he would not break a promise, saying, "i would not violate an agreement." (ahmad and abu dawud – graded saheeh by al-albani)