Tariff
A tariff is a tax on imports or exports between sovereign states. It is a form of regulation of foreign trade. It is a policy that taxes foreign products to encourage or protect domestic industry. It helps limit trade deficits. The tariff is historically used to protect infant industries and to allow import substitution industrialization.
Trade agreement
A trade agreement (also known as trade pact) is a wide-ranging taxes, tariff and trade treaty that often includes investment guarantees. When two or more countries agree on terms that helps them trade with each other. The most common trade agreements are of the preferential and free trade types are concluded in order to reduce (or eliminate) tariffs, quotas and other trade restrictions on items traded between the signatories. 
The logic of formal trade agreements is that they outline what is agreed upon and the punishments for deviation from the rules set in the agreement. Trade agreements therefore make misunderstandings less likely, and create confidence on both sides that cheating will be punished; this increases the likelihood of long-term cooperation. An international organization, such as the IMF, can further incentivize cooperation by monitoring compliance with agreements and reporting third countries of the violations. Monitoring by international agencies may be needed to detect non-tariff barriers, which are disguised attempts at creating trade barriers.