This paper introduces instrumental-variable estimators for exponential-regression models that feature two-way fixed effects. These techniques allow us to develop a theory-consistent approach to the estimation of cross-sectional gravity equations that can accommodate the endogeneity of policy variables. We apply this approach to a dataset in which the policy decision of interest is the engagement in a free-trade agreement. We explore ways to exploit the transitivity observed in the formation of trade agreements to construct instrumental variables with considerable predictive ability. Within a bilateral model, the use of these instruments has strong theoretical foundations. We obtain point estimates of the partial effect of a preferential-trade agreement on trade volume that range between 20% and 30% and find no statistical evidence of endogeneity.