This paper considers two firms that engage in joint production. The prospect of repeated interaction introduces dynamics, in that actions that firms take today influence the costliness and effectiveness of actions in the future. Repeated interaction also facilitates the use of informal agreements (relational contracts) that are sustained not by the court system, but by the ongoing value of the relationship. We characterize the optimal relational contract in this dynamic system with double moral hazard. We show that an optimal relational contract has a simple form that does not depend on the past history. The optimal relational contract may require that the firms terminate their relationship with positive probability following poor performance. We show how process visibility, which allows the firms to better assess who is at fault, can substantially improve system performance. The degree to which process visibility eliminates the need for termination depends on the nature of the dynamics: If the buyer’s action does not influence the dynamics, the need for termination is eliminated; otherwise, termination may be required.