Inter-firm relations have increasingly been analyzed by means of transaction cost economics (TCE). However, as has been widely acknowledged, TCE does not include dynamics of learning, adaptation or innovation, and it does not include trust. It assumes that efficient outcomes arise, while that may be in doubt, due to complexity and path-dependency of interactions between multiple agents that make, continue and break relations in unpredictable ways. We use the methodology of Agent-Based Computational Economics (ACE) to model how co-operation, trust and loyalty emerge and shift adaptively as relations evolve in a context of multiple, interacting agents. Agents adapt their trust on the basis of perceived loyalty. They adapt the weight they attach to trust relative to potential profit and they adapt their own loyalty, both as a function of realized profits. This allows us to explore when trust and loyalty increase and when they decrease, and what the effects are on (cumulative) profit.