How and why cooperation evolves, particularly among nonrelatives, remains a major paradox for evolutionary biologists and behavioral ecologists. Although much attention has focused on fitness consequences associated with cooperating, relatively little is known about the second component of evolutionary change, the inheritance of cooperation or reciprocity. The genetics of behaviors that can only be expressed in the context of interactions are particularly difficult to describe because the relevant genes reside in multiple social partners. Indirect genetic effects (IGEs) describe the influence of genes carried in social partners on the phenotype of a focal individual and thus provide a novel approach to quantifying the genetics underlying interactions such as reciprocal cooperation. We used inbred lines of guppies and a novel application of IGE theory to describe the dual genetic control of predator inspection and social behavior, both classic models of reciprocity. We identified effects of focal strain, social group strain, and interactions between focal and group strains on variation in focal behavior. We measured ψ, the coefficient of the interaction, which describes the degree to which an individual's phenotype is influenced by the phenotype of its social partners. The genetic identity of social partners substantially influences inspection behavior, measures of threat assessment, and schooling and does so in positively reinforcing manner. We therefore demonstrate strong IGEs for antipredator behavior that represent the genetic variation necessary for the evolution of reciprocity.