To conclude contracts with other countries, you must have an embassy on their territory. To maintain it, you must pay a part of your revenue per day.
After you have built an embassy, you can sign a non-aggression pact or a commercial agreement.
The probability of successful commercial agreement conclusion depends on the Ministry of foreign affairs development level (the amount of money invested in stars, salaries and staff).
The outcome of your offer to sign a non-aggression pact depends on your country’s military potential. The higher it is, the more chances you have to sign a non-aggression pact.