Much of the developing world, including Kenya, is rapidly urbanizing. Rising food and fuel prices in recent years have put the food security of the urban poor in a precarious position. In cities worldwide, urban agriculture helps some poor people gain access to food, but urban agriculture is less common in densely populated slums that lack space. In the Kibera slums of Nairobi, Kenya, households have recently begun a new form of urban agriculture called sack gardening in which vegetables such as kale and Swiss chard are planted into large sacks filled with topsoil. This paper examines relationships among sack gardening, social capital, and food security in Kibera. We used a mixed methods approach, combining qualitative interviews with a household survey, as well as focus group discussions with both farmers and non-farmers. We present evidence that sack gardening increases social capital, especially for those households that undertake sack gardening in groups. We also find that sack gardening in the Kibera slums has a positive impact on household food security by improving household dietary diversity and by reducing the need to resort to painful coping mechanisms that are used during food shortages.