Social loafing is a common issue encountered by many software development teams. In practice, agile software development teams often use team expectations agreements (TEAs), which contain rules to prevent social loafing behaviour. However, few studies in the software engineering literature examine how these rules are specified in TEAs and whether they serve the purpose. The authors intend to provide a better understanding on how to specify rules in TEAs to prevent social loafing behaviour in agile software development teams. A mixed-method approach using both qualitative and quantitative data was employed. The results of our study show that agile software development teams specify the expectations of the whole team on meeting attendance and contribution, respect of tasks, roles and teammates, and collaboration with each other. These rules have the potential to prevent social loafing behaviours. However, specifying the rules in TEAs alone is not sufficient to make them effective. It needs to be complemented with team commitment to TEA rules. The work of the authors contributes to a better understanding of how to use TEAs to prevent social loafing in agile software development teams, and provides a conceptual basis for future research to investigate social loafing prevention using TEAs.This is an open access article under the terms of the Creative Commons Attribution-NoDerivs License, which permits use and distribution in any medium, provided the original work is properly cited and no modifications or adaptations are made.