Nesting behaviour predicts heat tolerance evolution and climate vulnerability in bees Authors: Carmen R B da Silva, Julian E Beaman, James B Dorey, Tessa Bradford, Tobias J Smith, Ros Gloag, Vanessa Kellermann Published: 2026 ABSTRACT AbstractSpecies vulnerability to climate change depends in part on their capacity to evolve in response to increasing heat. Within terrestrial ectotherms, heat tolerance generally corresponds weakly to current climates, which has led many to conclude that this trait is evolutionarily constrained. However, most studies have not accounted for the role of microclimates, potentially obscuring signals of local adaptation. We examine heat tolerance in 95 species of wild bees that vary in nesting behaviour across the latitudinal extent of Australia. We show that species nest (ground, wooden cavities, or plant stems) micro-climate temperatures predict heat tolerance evolution, where stem nesters have evolved the highest heat tolerances, and ground nesters have evolved the lowest heat tolerances due to their ability to evade extreme heat. A moderate level of phylogenetic inertia in heat tolerance is explained by patterns of related species sharing nesting behaviours. This indicates repeated adaptive evolution of similar heat tolerances, rather than strong evolutionary constraints on heat tolerance. Finally, incorporating nesting behaviour into assessments of climate change vulnerability changes the rank order of which species are most at risk. This underscores the need to understand what drives the evolution of heat tolerance across species to better identify the taxa most at risk to climate change.Subject terms: Ecophysiology, Macroecology, Evolutionary ecology, Climate-change ecology, Phylogenetics Introduction Understanding and predicting the risks posed to biodiversity by climate change depend on understanding how tolerance to heat evolves1–5. A fundamental assumption is that an organism’s heat tolerance evolves in response to environmental heat exposure, such that biota in hot climates will be more heat tolerant than those living in cooler climates2,6,7. However, in terrestrial ectotherms the expected positive relationship between heat tolerance and environmental temperature is often weak or absent1,2,8–11. For example, species living at high and low latitudes often have similar heat tolerances2,8,11,12. Several explanations for this pattern have been proposed, including that heat tolerance reflects adaptation to past rather than present climates2,9, that heat tolerance in some taxa is evolutionarily constrained, due to low genetic variance or trade-offs1, or that species adapt to rare temperature extremes rather than climate averages, resulting in selection across geographic space that is more uniform than expected9,13. Mismatches between species’ heat tolerances and their environments could also arise if macro-scale ambient temperatures are decoupled from the micro-climates in which animals actually live14–16. While macro-scale climatic variables are commonly used to assess associations between climate and heat tolerance, individuals experience their environment at finer spatio-temporal scales16–18. This is especially true for small animals such as insects and other arthropods. For example, species whose habitats are generally shaded, or that have partially subterranean lifestyles will be buffered against the ambient air temperatures of their macro-climate14,15,19, and evidence is emerging that thermal tolerances vary according to micro-climate in a range of animals17,20. Likewise, variation in species behaviours that influence the micro-climates they typically experience, such as foraging or nesting behaviours, could impact selection on heat tolerance, and shape how heat tolerance evolves (i.e., the Bogert effect coined by Huey et al.19). If so, assessments of the vulnerability of species to climate change may be improved by incorporating micro-climate14,21. In this study, we investigate how heat tolerance evolves across 95 phylogenetically diverse species of adult bee (4 families, 22 genera, and 3484 individuals) spanning the entire latitudinal gradient of mainland Australia (Fig. 1A, Supplementary data 1). Bees are keystone species in terrestrial ecosystems due to their role as pollinators22, including agro-ecosystems all over the world where they make vital contributions to crop fruit set, worth billions of dollars annually in the USA alone23. Bees are also a valuable system for understanding the scale at which climates shape thermal tolerance because co-occurring species likely occupy different micro-climates due to differences in nesting behaviour. Some species nest in the ground, others in wood cavities (e.g., tree hollows or dead wood), while others nest in plant stems or existing holes in small twigs/branches (hereafter referred to as stem nesting bees)22. Based on these nesting behaviours, adults and young of stem nesting bees should be exposed to higher temperatures than bees that nest in wood cavities and the ground, due to the lack of insulation provided by thin stem nest walls. Similarly, bees that nest in the ground occupy the micro-climates most buffered from high air temperatures24. First, to determine the importance of nest micro-climate in dictating the evolution of heat tolerance we ask whether nesting behaviour can better explain inter-specific variation in heat tolerance than macro-scale temperature and precipitation data (i.e., regional weather station data that is used to model climatic variables at a 1 km2 resolution), while also considering species’ evolutionary history (see native bee phylogeny S Figs. 1 and 2). We also examine the extent at which patterns in heat tolerance and nesting behaviour are consistent with either evolutionary constraint (phylogenetic inertia) or adaptation. Second, we test whether nesting behaviour has shaped the evolution of heat tolerance in bees independently of phylogeny by determining whether nesting behaviour influences the strength of selection, or mode of selection (i.e., whether heat tolerance evolves towards different optima depending on nesting behaviour), on heat tolerance. We also assess for evidence of repeated evolution of heat tolerance depending on nesting behaviour independently of phylogeny. Third, we examine phenotypic plasticity in heat tolerance in a thermally-variable population of bees to ensure patterns in heat tolerance across nesting behaviours are not driven by plasticity. Fourth, we compare climate change sensitivity across species with and without consideration of nesting behaviour, and demonstrate that including micro-climate drastically changes the rank order of species climate sensitivity. With bees already threatened by warming and drying climates25, we show that nesting behaviour can help identify those bees most at risk to climate change. Native bee mean heat tolerance depends on their nest micro-climates. A Sites at which native bees were sampled and assayed for heat tolerance. Star indicates the site at which intraspecific plasticity in heat tolerance was investigated. Map colours indicate macro-scale mean maximum temperature of the hottest month (BIO588). B Native bee heat tolerance (CTMAX) across nesting behaviours (mean and standard error bars; n = 95 species, species specific sample sizes are listed in Supplementary Data 1). C Relationship between heat tolerance and micro-climate maximum temperature with species nesting behaviour indicated by colour; ground = brown, cavity = yellow, and stem = green. Solid line indicates the observed evolutionary regression slope and dashed line represents the optimal regression slope (i.e., unconstrained adaptive slope). Data and code to reproduce this figure can be found in the Figshare repository. Results and discussion Heat tolerance evolves in response to nest micro-climate temperatures To first determine whether heat tolerance varied across species in a way consistent with adaptation to current climates we extracted macro-scale climate data (from the site of collection) for two key climate variables that are commonly used to assess the association between heat tolerance and climate: maximum temperature and mean annual precipitation1,25,26. Like many studies before us9,12, we found that these macro-scale climatic variables explained only a small proportion of between-species variation in heat tolerance (Ournstein-Uhlenbeck phylogenetic mixed model: R2 = 0.06, Likelihood ratio test (LRT) = χ2(df = 1) = 5.67, P = 0.017, model AICc comparison in S. Table 1 shows poor performance compared to other models). Macro-scale estimates of climate, however, are unlikely to capture the temperatures that small ectotherms, such as bees, experience in their nests16,17. To capture nest micro-climates we extracted the predicted maximum temperatures and mean humidities species experience within ground, wood cavity, or stem nests (see details in Materials and Methods). Maximum nest micro-climate temperature, but not humidity, explained more variation in heat tolerance than macro-scale climate alone (Ornstein-Uhlenbeck phylogenetic mixed model: R2 = 0.13)(S. Table 1), such that, on average, bees nesting in stems across the latitudinal gradient were the most heat tolerant and those nesting in the ground were the least heat tolerant (LRT: χ2(df = 1) = 11.76, P < 0.005) (Fig. 1B, C and Fig. 2) (S. Table 1). This pattern suggests that ground-nesting behaviour buffers bees from selection for high heat tolerance, while stem nesting bees are adapted to their hotter micro-climates (Fig. 1B, C; Fig. 2) i.e. the Bogert effect14,19. Plotting the residuals of the relationship between heat tolerance and macro-scale temperatures across the phylogeny further supported that ground nesting bees are buffered from selection, as they had lower than expected heat tolerances given the macro-scale temperatures they experience, while stem nesting bees showed the opposite pattern (Fig. 2). However, whether this pattern reflects weaker selection for high heat tolerance at the adult life stage in ground nesting bees (as they use behaviour to escape hot temperatures throughout the day) or instead reflects selection towards lower heat tolerances at pre-adult stages, is unknown. A previous study that examined whether heat tolerance differed between adult bees (15 species) with different nesting behaviours at a site in urban North Carolina concluded that stem and ground nesting bees had similar heat tolerances, while cavity nesters (all bumble bees in their study) had the lowest heat tolerances27. The stronger association between heat tolerance and nest type we identify here could be due to the greater number and breadth of taxa and climates sampled, or reflects differences arising from the community compositions enforced by urban environments. We also examined whether body size was an important predictor of heat tolerance, given that smaller species exchange heat more rapidly than larger species28. However, we found no relationship between body size and heat tolerance (LRT: χ2(df = 1) = 1.85, p = 0.174) (S. Table 1). This result supports some studies in bees24,29, however, some other studies have found that heat tolerance is correlated with body size25,30. We also found no association between body size (wing length) and latitude (i.e., no support for Bergmann’s rule) (LRT: χ2(df = 1) = 1.85, p = 0.174) (S Figs. 3 and 4). Nesting behaviour and heat tolerance (CTMAX) of native bees. Pie charts represent the posterior probabilities of nesting ancestral states at each internal node. Bar plots represent the heat tolerance residuals from an OU phylogenetic mixed model and indicate whether bees have higher or lower thermal tolerances relative to their mean thermal macro-climate (BIO588); ground nesters tend to have low thermal tolerances for their macro-climate and stem nesters tend to have high thermal tolerances for their macro-climate (bar colour indicates heat tolerance). The final column represents the genus of each species tested (note that Homalictus is a subgenus of Lasioglossum but has been included in the list of genera as they represent a significant proportion of the Lasioglossum sampled. The blue highlight represents bee tribe/subfamily (subfamily provided when genera do not belong to a tribe). Bee photos were provided by JD, TS and Nick Volpe. *Note: Hylaeus appears twice in the phylogeny. This is because our phylogeny suggests that Hylaeus nubilosis actually sits in the clade containing Paleaorhiza and Meroglossa (S Fig. 1), where they have been noted to have similar facial features93. Data and code to reproduce this figure can be found in the Figshare repository. We examined how one type of behaviour (nesting) influences the evolution of heat tolerance, but this ignores other types of behavioural differences that could influence the micro-climates that species experience, such as sociality. In bees, sociality (whether they are solitary, communal or eusocial) might be important in shaping a species’ thermal environment31, as some eusocial bees are known to thermoregulate their nests32. Australia has only three genera of known eusocial bees (Tetragonula, Austroplebeia and Exoneurella tridentata) which are all within the family Apidae, making it difficult to independently assess how sociality influences heat tolerance evolution. Furthermore, the social status of many other Australian bee species is unknown or variable. For example, in some populations of Braunsapis and Exoneura, some nests have a solitary female, while others have multiple egg-laying females33,34. Thus, in this study we were unable to include sociality into our analysis. However, the two eusocial genera in our dataset (Tetragonula and Austroplebeia - which nest in cavities) tended to have low thermal tolerances, especially compared to other cavity nesting bees such as those within the genus Megachile. It is possible that eusocial species are less heat tolerant than communal or solitary species as they have some capacity to cool their nests by fanning, evaporative cooling, and nest evacuation32,35. As more data on Australian bee sociality becomes available in the future, it might reveal how social behaviours contribute to heat tolerance evolution. Studies in ectotherms have found strong signals of evolutionary history in heat tolerance, which have often been inferred to mean there are constraints in the capacity to evolve heat tolerance1,3. For example, some lineages might lack the standing genetic variance required to adapt rapidly with changing environments, resulting in a strong phylogenetic signal and heat tolerances that are poorly matched to their current environments36. However, phylogenetic signal in a trait does not necessarily imply constraints and could arise from adaptation37. If closely related species occupy and adapt to similar environments (e.g. similar nest micro-climates), these species will have similar trait values. Phylogenetic signal in this context more likely reflects phylogenetically structured adaptation. To examine whether there is evidence of phylogenetically structured adaptation, we first looked at whether phylogenetic signal was present in the heat tolerances of bees by examining the phylogenetic half-life (t1/2) of an intercept-only Ornstein-Uhlenbeck process model1,37. The phylogenetic half-life represents the average time it takes (in the units of the phylogeny) for a trait to evolve halfway from its ancestral state towards a new optimum37. A low t1/2 ratio (t1/2 ratio = phylogenetic half-life divided by tree hight) indicates fast adaptation, a high t1/2 ratio reflects slow adaptation (strong phylogenetic inertia), and a t1/2 ratio over 1 (i.e. t1/2 greater than the height of the tree) represents evolution via Brownian Motion. We found moderate phylogenetic signal, suggesting that heat tolerance was not evolving independently from the phylogeny, nor by Brownian Motion (t1/2 = 35.79 MY; tree height = 104.12 MY; t1/2 ratio = 0.34, CI = 0.22-0.47; S Fig. 3). We then compared this to the phylogenetic signal in the Ornstein-Uhlenbeck process model that examined the relationship between heat tolerance and micro-climate temperature (S. Table 2) to tease apart whether the phylogenetic inertia represents phylogenetically structured adaptation or constraints. The estimated t1/2 decreased (t1/2 = 28.60 MY; t1/2 ratio = 0.27, CI = 0.22 − 0.47), indicating that some of the phylogenetic signal in heat tolerance is explained by adaptation to micro-climate temperature. The remaining 27% of the phylogenetic signal from the intercept only model reflects low to moderate phylogenetic inertia37. Thus, heat tolerance is partly constrained by shared ancestry, but species have also evolved higher heat tolerances with warmer micro-climate temperatures (evidenced by the difference between the evolutionary and the optimal regression slopes in Fig. 1C) (see S Table 2 for full model coefficients). Nesting strategy impacts how heat tolerance evolves, resulting in repeated evolution across the phylogeny Another approach to understanding how nesting behaviour (and thus micro-climate temperature) influences the evolution of heat tolerance is to consider similarities between lineages in which a given nest type has evolved independently. Nesting behaviour is phylogenetically structured, such that only two independent transitions from the ancestral state of ground nesting to both stem and cavity nesting have occurred deep within the phylogeny giving rise to the stem/cavity nesting species we see today (Fig. 2, S Table 3). Within the stem and cavity nesting species, five and two transitions have occurred back to ground nesting, respectively (Fig. 2, S Table 3). The strong association between nesting behaviour and phylogeny means it is likely that nesting behaviour has influenced the strength or mode38 of selection on heat tolerance. If ground nesting bees experience weaker selection on high heat tolerance because they have greater potential for behavioural thermoregulation, and thus evolve more slowly towards their thermal optima than bees in more exposed nest types, then we expected to detect differences in the rate heat tolerance evolves depending on nesting behaviour. If bees with different nesting behaviours evolve at similar rates but towards distinct thermal optima, then we expected to detect differences in the mode of selection according to nesting behaviour. Such differences in selection mode would provide additional evidence that bees adapt to the temperatures of their nest micro-climate. Furthermore, the strong phylogenetic structuring of nesting behaviour could also explain the observed phylogenetic inertia in heat tolerance (above); that is, closely related species might share similar heat tolerances because they experience the same selective pressures. To better tease apart the manner in which nesting behaviour has influenced heat tolerance evolution we used two complementary analyses. First, we modelled how heat tolerance varies across the phylogeny to ask whether nesting behaviour principally influences the strength (rates) or mode of selection (i.e. optima at which thermal tolerance evolves towards). We compared a number of different models contrasting single and multiple rates and optima (for a comparison of models see Methods and S. Table 4) and found that heat tolerance was evolving towards distinct optima for each nesting behaviour, but that the rates of evolution were the same across nesting behaviours (σ2 = 0.34 °C per MY, low 95 CI = 0.30–0.36) (lowest AICc, S. Table 4). Stem nesters had the highest phenotypic optima (θ = 44.90 °C, 95 CI = 44.06–45.43), followed by cavity nesters (θ = 43.27 °C, 95 CI = 43.27–43.93), and ground nesters (θ = 42.88 °C, 95 CI = 42.88–43.45) (Fig. 2) (S. Table 5). That is, nesting micro-climates impact the mode of heat tolerance evolution. While we did not explicitly test a multi-rate and multi-optima model (because these models are known to be less reliable when working with less than a few hundred species39), if nesting behaviour influenced both the strength and mode of selection we expected that both the multi-rate and multi-optima models would perform similarly, however the multi-optima model considerably out-performed the multi-rate model (S. Table 4). Moreover, these models show that phylogenetic inertia alone does not explain heat tolerance, as we would then have expected support for a single rate model with no evolutionary optima. Instead, distinct selective modes are consistent with repeated evolution of heat tolerance among bees with shared nesting behaviours, suggesting adaptation to nest micro-climate underpins the evolution of heat tolerance. Our second approach assessed whether heat tolerance has evolved repeatedly depending on nesting behaviour. Using the Wheatsheaf index40 (w) we measured the strength of repeated evolution while accounting for phylogenetic relatedness. We also tested whether species with the same nesting behaviour had more similar heat tolerances than expected given that nesting behaviour is highly structured across the phylogeny (P). We again found evidence of repeated evolution of heat tolerance across all nesting behaviours. That is, species with similar nesting behaviours had similar heat tolerances irrespective of phylogeny. This was particularly true for both stem and ground nesters (Table 1. P < 0.05), with a weaker signal of repeated evolution in cavity-nesters, possibly due to the lower sample size for this group. In all, our estimates of distinct phylogenetic optima and repeated evolution in heat tolerance for bees with different nesting behaviours point to adaptive processes driving heat tolerance evolution. Indeed, this is an exciting example of repeated evolution in heat tolerance associated with a common behaviour. Table 1Wheatsheaf index (a measure of repeated evolution) and upper and lower 95% confidence intervals. The P-value tests whether the evidence of repeated evolution is particularly strong given the topology of the phylogenetic tree100 (one-sided test)Nesting behaviourwLower CIUpper CIP-valueStem0.970.951.020.016*Cavity1.261.231.300.305Ground0.840.830.860.032* Wheatsheaf index (a measure of repeated evolution) and upper and lower 95% confidence intervals. The P-value tests whether the evidence of repeated evolution is particularly strong given the topology of the phylogenetic tree100 (one-sided test) Phenotypic plasticity and population variation do not explain trends in heat tolerance An alternative explanation for why heat tolerance varies with nesting behaviour is that bees in stem nests could be acclimated to higher temperatures than bees nesting in the ground. That is, phenotypic plasticity could underpin differences in heat tolerance between stem, cavity, and ground nesters. To test whether phenotypic plasticity was contributing to differences between our stem and ground nesting bees, we sampled and assayed bees for heat tolerance once a month across the active foraging season at our most climatically variable high-latitude site (Melbourne, Fig. 1A; Nov-March, 542 individual bees assessed, 26 species with 3–80 individuals per species). This site was chosen because bees at higher latitudes experience greater seasonal variability in temperature and thus are the most likely to show plasticity in thermal tolerances based on the climate variability hypothesis (phenotypic plasticity increases with increased environmental variability41) (Fig. 1). We predicted that if phenotypic plasticity was driving the difference between stem and ground nesting bees then stem nesters at our high-latitude site would exhibit greater seasonal plasticity than sympatric ground nesters as the former are exposed to greater thermal variability. However, heat tolerance did not differ across the months of collection for either ground nesters or stem nesters (Fig. 3A, B) (Type III Wald χ2 test: χ2 = 4.10, p = 0.392). For ten species of bees, where we had estimated heat tolerance in two or more months, we looked at whether variation in heat tolerance could be explained by species (40.94% of variation explained) or by month/season (9.61% of variation explained) (Fig. 3C) (S. Table 6). The much higher proportion of variation being partitioned to the species level indicates limited seasonal plasticity in heat tolerance. Therefore, plastic differences in heat tolerance are unlikely to explain the differences we observe between stem, cavity and ground nesting bees. Plasticity could also underpin the significant relationship between heat tolerance and micro-climate temperature (Fig. 1C), but given the limited evidence for heat tolerance plasticity in our highest latitude populations of bees we think this is unlikely. More generally, little or no plasticity in heat tolerance within bee species is consistent with a growing body of literature across ectotherms42. Variation in heat tolerance across months and population. A Heat tolerance across the active period of bees (November - March) in Melbourne. Each data point reflects individual estimates, with stem-nesters in green and ground-nesters in brown B Seasonality in maximum temperature at this sample site (bar indicates +/- standard error). Note October was included as the month prior to trait estimation is likely to influence the plastic response. C Heat tolerances for ten species of bees where we estimated heat tolerance for at least two months across the active period of bees (November - March). Individual data points and means for each species (bars indicate +/- standard error). D Population means and species means (bars indicate +/- standard error) for heat tolerance for 43 species of bees. Sample sizes for each species and month are listed in Supplementary Table 6. Data and code to reproduce this figure can be found in the Figshare repository. Finally, given that only a single population was sampled for many of the 95 species in our total dataset, it is possible that the sampled population is not reflective of the species’ overall heat tolerance (i.e. different populations within a species might show local adaptation in heat tolerance). To assess whether local population adaptation might have influenced our findings, we partitioned heat tolerance variation at the species and population level for 43 species in which we had sampled at least two populations. Here we found that 28.93% of the variation in heat tolerance was attributable to species, while 7.46% of the variation was attributable to populations (63.48% residual variance). That is, variation between species was greater than the variation within species (Fig. 3D). Therefore using only a single (or averaged) population estimate is unlikely to have confounded the broad trends that we observed between species with different nest types (Fig. 3D). Micro-climates influence predictions of species sensitivity to climate change A major goal in evolutionary ecology is to predict species vulnerability to climate change1–5,8. Common metrics used in these predictions include thermal safety margins and estimates of species range shifts4,41,43. The micro-climates organisms occupy are rarely factored into vulnerability predictions (but see14,21). To test the importance of nesting behaviour (which determines bee micro-climate) on climate change vulnerability, we estimated thermal safety margins as the degrees distance between species heat tolerance and the maximum temperature of their environment. To emphasise the importance of how behaviour can influence species micro-climates, we first calculated species thermal safety margins based on the air temperatures bees were collected from. Here we found that ground nesters tended to be the most vulnerable, due to their lower thermal tolerances (Fig. 4A). However, when we calculated thermal safety margins considering nesting micro-climate temperature, we found that this trend in vulnerability was reversed (Fig. 4B, C). That is, species nesting above ground (in stems and cavities) had the narrowest safety margins (Fig. 4B, C). This is because the higher heat tolerances of stem and cavity nesters do not compensate in full for the hotter temperatures to which they are exposed (Fig. 1C, S Fig. 3). This pattern is consistent across geographic space, though margins become narrower for all species at locations closer to the equator (Fig. 4B). In other words, for any given location, stem nesters have narrower safety margins than sympatric ground nesters. Our analysis reveals that, in the absence of data on heat tolerance, species nesting behaviour could be a suitable proxy for ranking species vulnerability in a given location. We also show generally high heat tolerances in bees and subsequently broad thermal safety margins, similar to other diurnal insect pollinators such as butterflies12. But sublethal effects of temperature are likely to impact populations at much lower temperatures than those calculated by safety margins44–46, hence safety margins should be used to rank species vulnerabilities, not predict the temperature at which they will go extinct. Finally, we only considered adult bees and the thermal safety margins of pre-adult stages could differ. Bee thermal safety margins depending on air temperatures or nest microclimate temperatures. Thermal safety margins of bees depending on: (A) species air temperature thermal safety margins and, B nest micro-climate temperature thermal safety margins, across latitude, and C Nest micro-climate thermal safety margins. N = 95. Data and code to reproduce this figure can be found in the Figshare repository. Our results suggest stem nesters have the lowest capacity to escape unfavourable environmental temperatures and are likely to be the most impacted by anthropogenic climate change in the near term. Importantly though, as all bees must forage outside their nests and therefore be exposed to a shared climate when foraging, even ground-nesters will be impacted from warming climates in the longer term. Indeed, some models predict that thermoregulators (i.e. those that can escape unfavourable climatic conditions, in this case, ground-nesting bees) will be the least at risk in the short term, but the most at risk in the long term, because the buffering effect of behaviour on the evolution of heat tolerance will drive an increasing mismatch between the heat tolerance that they will need to survive climate change14. Near-term risks, however, are those most relevant to today’s population management and conservation decisions. Given we also show that phenotypic plasticity is unlikely to substantially increase heat tolerance in the short term, which is an emerging theme in ectotherms in general42, our estimates of safety margins are likely to capture near term risk. Our results highlight the importance of factoring in micro-climates based on differences in species behaviour into predictions of climate change vulnerability (Fig. 4A, B). Concluding remarks Here we show that associations between adult bee heat tolerance and thermal environment are stronger when we consider an important behaviour that determines species’ micro-climates. By accounting for nesting behaviour, bees in our study therefore adhere to the expected, but rarely found, relationship between heat tolerance and environmental temperature2,8,9. Selection on heat tolerance acts at the level of the nest micro-climate, such that bees that nest in the ground evolve towards different evolutionary optima in heat tolerance than those that nest above ground in stems or tree cavities. Although outside the scope of this study, other behaviours that may modify the nest micro-climate might similarly shape how heat tolerance evolves (e.g. sociality31). The implications for predicting the vulnerability of bees and other ectotherms to changing climates is two-fold. First, confirmation that heat tolerance evolves with increasing environmental temperature supports the view that bees could also adapt to future climates. Whether such evolutionary responses will be enough to keep pace with changing climates remains an open question, but even small adaptive shifts in heat tolerance can substantially reduce extinction risk47. Second, even where future evolutionary responses are set aside, understanding what drives the evolution of heat tolerance across species can help to identify at-risk taxa. In bees, stem nesters have evolved the highest heat tolerances but also occupy the warmest micro-climates and thus have the narrowest thermal safety margins. Including the relevant micro-climates that species occupy into models that predict and rank species vulnerability to climate change may improve our ability to determine the winners and losers of climate change. Methods Bee collection We collected bees from 16 sites on the eastern side of Australia during two field trips. The first field trip took place January - March 2020 and the second October 2020 - February 2021 (see supplementary S. Table 7 collection sites and order of collection). Bees were collected from flowering plants by sweep netting and were placed into 30 mL collection vials with foam plugs to allow airflow. We then placed vials of bees into a portable cooler with ice bricks that have been cooled in the refrigerator (wrapped in tea towels) to maintain bees at a comfortable temperature. We provided bees with a piece of paper towel dipped in 40% sugar solution to maintain homeostasis prior to thermal assays. Heat tolerance assays We estimated the heat tolerance of individual bees following the protocol of da Silva et al. 20224. Briefly, each bee was placed into a watertight glass 5 mL testing vial and vials were labelled 1–150. Bee vials were placed haphazardly into two 75-vial testing racks. Once loaded, we placed racks into a water bath set to 26 °C. Water temperature was then increased by 0.1 °C per minute using a TeTechnologyⓇ LC 200 liquid heater/cooler, controlled by an TETechnologyⓇ TC 720 temperature control device and powered by a Peltier power supply. Water was circulated using a pond pump and the water temperature was increased until each individual bee lost complete movement. The time and temperature that each bee reached their critical upper thermal limit (CTMAX) was recorded. At the end of each assay, we placed bees into 99% ethanol for later identification and genotyping. Wing length Because body size is associated with thermal tolerance in some studies30,48, we assessed whether it explains significant variation in heat tolerance, using wing length as a proxy for body mass as they are tightly correlated49. We removed the right wing from 10 individuals haphazardly selected from each species (or as many individuals as possible depending on the number of individuals tested per species, sample sizes provided in Supplementary Data 2). Wings were mounted on microscope slides in a solution of ethanol and glycol. A photograph of each wing was taken using a Lecia M80 stereo microscope (Leica, Heerbrugg, Switzerland). Wing length was measured from where the wing attaches to the thorax, to the apex of the marginal cell (S Fig. 4), using ImageJ. Bee Identification Bees were first identified to family, genus and subgenus using keys in Smith50 and Michener22. Species-level identifications were subsequently undertaken using the following keys:22,51–69. Keys were used in conjunction with the online photo libraries and digital keys on the PaDIL Pollinators website (www.padil.gov.au/search/pollinators), digital keys by Michael Batley, Australian Museum (https://michaelbatley.github.io/Bee-ID-SH/main.htm, https://michaelbatley.github.io/Bee-ID-SM/main.htm) and online distribution maps (Atlas of Living Australia, www.ala.org.au and iNaturalist, www.inaturalist.org). In several cases, identifications of species that lack keys were made with assistance from bee taxonomists at the Australian Museum and Museums Victoria (see Acknowledgements). Voucher specimens were lodged in the Kellerman Lab reference collection, La Trobe University. For bees that could not be confidently identified using taxonomic keys, we instead used mitochondrial CO1 barcoding to generate a species ID. As many Australian bee species have not yet been formally described, those that did not match a specimen on BOLD or GenBank were assigned a morpho-species name (see sequencing details below). Nesting behaviour We assigned bees to one of three nesting categories (ground, stem, or cavity nesting) based on nest type descriptions in taxonomic and reference texts (cited in Supplementary data 2). The category stem includes bees living in plant stems, twigs, and small narrow branches as they have similar thermal properties. Some species, such as those in the genus Hylaeus, can sometimes be found nesting in stems, twigs, or existing cavities in larger branches or trunks. For these species we allocated nesting strategies to the category where there were more numerous reports in the literature. A summary of each species physiological, climatic and nesting behaviour can be found in Supplementary Data 1 and 2. Ultraconserved element phylogeny We selected 75 species from our total dataset for ultraconserved element sequencing. Species with high sample sizes and those that represented unique subgenera within the collection were prioritised. DNA was extracted at the South Australian Museum from a single leg using a modified version of the Canadian Centre for DNA Barcoding Glass Fiber Plate DNA Extraction Protocol in PALL Acroprep ADVANCE 96-Well Filter Plates (1 ml 3.0 µm glass fibre70). The Meyer and Kircher71 protocol was followed to prepare indexed libraries for Illumina sequenllcing, incorporating the on-bead method of Fisher et al.72 and Li et al.73. Indexed samples were quantified fluorometrically on a Quantus fluorometer (Promega, Madison,WI, USA) and pooled into groups of five for the hybridisation step, based on similar concentration. MyBaits UCE Hymenoptera 2.5Kv2AB kit (Arbor Biosciences, USA) was used to capture UCE sequences, following the myBaits User Manual version 5.01. DNA concentration of the capture reactions was measured on a Quantus fluorometer and the libraries were pooled in equimolar quantities. Final fragment length distribution and molarity of the bee UCE library was determined on a TapeStation 2200 using high-sensitivity ScreenTape and reagents (Agilent Technologies, Santa Clara, CA, USA). Sequencing was conducted on a NovaSeq 6000 SP single lane at the Australian Genomic Research Facility (AGRF) in Melbourne with 150 bp paired-end read cycles. We used the program Phyluce version 1.7.174 to assemble the UCE contigs, check assemblies, match probes, generate fasta files, and align sequences. We used IQ-TREE 2 version 2.2.075 for UCE phylogenetics with modelFinder76 using 1,000 bootstraps, and MF models. Using the scheme created by modelFinder, we employed IQ-TREE to build a constrained tree with the Apoid wasp outgroups Ammophila cybele, Oxybelus analis, and Sphecius hogardii. Original UCE phylogeny is shown in S Fig. 2. We used Timetree77 to generate median divergence times for each of the family clades from the following studies75,78–86. Dates are as follows: Wasp outgroups to bees (106.6–137.9 MYA), Halictidae to Colletidae (Ceylalictus perditellus to Leioproctus launcestonensis) (83–112.8 MYA), Halictidae to Apidae (Ceylalictus perditellus to Braunsapis hyalina) (70.8–148.0 MYA), Halictidae to Megachilidae (Ceylalictus perditellus to Megachile deanii) (37.6−141.5 MYA), Apidea to Colletidae (Braunsapis hyalina to Leioproctus launcestonensis) (70.8−148.0 MYA), Megachilidae to Colletidae (Megachile deanii to Leioproctus launcestonensis) (70.8−148.0 MYA), Stenotritidae to Colletidae (Stenotritus sp to Leioproctus launcestonensis) (52.2−91.7 MYA). Adding further branch tips via CO1 sequencing In addition to the specimens chosen for UCE sequencing, our heat tolerance dataset included some additional species (for which > 4 individuals were assayed). CO1 data was collected from GenBank and BOLD for 34 species (some species for which we had no UCE data, and some species so that we had an overlap in UCE and CO1 data to make an integrated UCE and CO1 tree. For the species where no CO1 data was available online, we sequenced the remaining 29 species to ensure that these additional species could be included in analyses. We extracted DNA from one specimen per species using a 5% chelex solution. We then amplified a ~ 655 bp region of CO1 (primers: LCO1490 and HCO219887) and performed Sanger sequencing (Macrogen Inc, Seoul). COI sequences were then trimmed and cleaned for ambiguous base calls, and species IDs checked via BLAST and BOLD (https://boldsystems.org/; none of these barcode sequences matched Wolbachia sequences). We then generated separate CO1 phylogenies for each genus using IQ-TREE. To integrate species from the CO1 phylogenies into the UCE phylogeny, we standardized CO1 tree branch lengths to match the UCE tree using a scaling factor. This factor was calculated for shared species between the two trees. The scaling factor was derived by summing branch lengths from the genus or sub-genus root in both trees, dividing the CO1 sum by the UCE sum, and averaging this ratio across all shared species when multiple common species were present. Finally, we divided the CO1 branch lengths by the scaling factor to align them with the UCE tree. The final phylogeny used in our analysis included 52 UCE samples (not all UCE sequences were included in the trait analysis as those species had low sample sizes) which made up the backbone of our phylogeny (at least one UCE sample was included for each genus in the combined phylogeny) and 43 CO1 tips (N = 95). Note that Supplementary Fig. 1 has 123 species, here we included as many species as possible to construct as robust a phylogeny as possible, but some species were not included in the heat tolerance evolution analysis due to low sample sizes (n < 4). Climate and micro-climate data acquisition We extracted historical climate data (1970–2000) for each collection site from WorldClim288. We extracted maximum temperature of the hottest month (BIO5) and mean annual precipitation (BIO12) at a 30 arc seconds resolution using the R package raster89. We then calculated the mean hottest temperature of the hottest month and mean annual precipitation for each species across their collection locations to use in our phylogenetic mixed models assessing whether heat tolerance is correlated with climatic factors. We also extracted micro-climate data for each species depending on their nesting substrate using NichmapR v3.3.290 and a global surface climate database91. For ground nesting species, we extracted maximum soil temperature at a depth of 50 cm in full sun. A global analysis of bee ground nest depth suggests that many bees nest between 10–23 cm deep on average (but up to 90 cm)92. However, in Australia, Lasioglossum and Leioproctus (which represent many of the ground nesters in our study) are known to excavate nests over 100 cm deep69,93. For stem nesting bees we collected maximum air temperature at 1.2 m above-ground because thin stems are unlikely to provide substantial thermal buffering for bees. Because cavity nesters are likely to be somewhat buffered from extreme temperatures (e.g., stingless bees nesting in tree hollows), but less so than bees that nest deep in the soil, we took the mean temperature of ground (100 cm in soil) and stem (1.2 m in the air) habitats and applied this to the cavity nesters at each collection site. We calculated micro-climate humidity for each collection site/nest type combination using the same methods as above; however, as cavity humidity is likely to more closely resemble air humidity than soil humidity, we therefore estimated cavity humidity as 75% of air humidity at the same site. As for regional climate variables, we used the mean maximum nest micro-climate temperature and humidity experienced by a species across all of their collection sites. Phylogenetic trait analyses Phylogenetic trait analyses were conducted in the program R v4.5.0. While most phylogenetic comparative methods control for phylogenetic non-independence assuming traits evolve according to Brownian motion (BM; random movement), Ornstein Uhlenbeck (OU; evolution towards an optimum) process models more accurately describe trait evolution as they are able to treat trait evolution as a stochastic process (e.g., genetic drift) and a deterministic process (e.g., evolution towards phenotypic optima). Phylogenetic comparative methods that use an OU process, which can be used to examine evolution towards trait optima and control for phylogenetic inertia, have been argued to be more suitable for testing evolutionary hypotheses using physiological trait data37,94,95. In the case where traits do not evolve towards an optima, models revert to using a BM model of evolution94,95. Thus, we used the package slouch v2.1.596 to determine how phylogeny, local climate (maximum temperature of the hottest month (BIO5) and annual precipitation (BIO12), and micro-climate (estimates of maximum temperature and mean humidity within the nest) shape heat evolution. We computed models based on different predictions we had for how CTMAX might evolve across bee species (S. Table 8; species with sample sizes over 4 individuals, and species that had both heat tolerance and genetic data were included in analysis). We asked whether macro-climate variables or micro-climate variables better explained variation in heat tolerance across the cline (local climate and micro-climate variables were not mixed within models). We conducted model comparison using AICc (Akaike Information Criterion) to determine which model best explains variation in heat tolerance evolution. We also examined the relationship between micro-climate temperature and latitude (S Figure 7). We put wing length into the best fitting model and assessed whether it explained significant variation in heat tolerance. We conducted a grid search to assess for measurement error. We assessed the significance of the factors in the best fitting model by conducting likelihood ratio tests. How does nesting behaviour drive heat tolerance evolution? To determine how nesting behaviour shapes the rate or mode of heat tolerance evolution, we simulated nesting behaviour across the native bee tree 1000 times using the make.simmap function from the phytools v2.4-4 package97. To determine the number of nesting behaviour state changes across the phylogeny (and the confidence in each node state) we calculated the posterior probabilities of each internal node. We then computed and compared a range of OUwie models98 using the 1000 character mapped phylogenetic trees as per Moen et al.95 (Fig. 2). We compared evolutionary models where heat tolerance evolves at a single evolutionary rate (BM1); different evolutionary rates depend on nesting behaviour (BMS); evolves towards a single trait optimum (OU1); or evolves towards different trait optima depending on nesting behaviour (OUM). These analyses were iterated across the 1000 trees for the BMS and OUM models, but not for the BM1 or the OU1 models as they do not depend on simulated ancestral states. Models were compared using AICc (Akaike Information Criterion). We assessed the robustness parameter estimates, and whether there was likely to be significant differences between CTMAX evolution depending on nesting behaviour by conducting a bootstrap analysis with 1000 simulations as per Moen et al.95. To investigate whether patterns in heat tolerance are driven by nesting behaviour and not solely shared ancestry we calculated the wheatsheaf index (w), which is a measure of repeated evolution. It measures and compares the euclidean distance between species traits while considering relatedness40. We estimated w for each nesting behaviour, and assessed whether heat tolerance is more similar within each of these groups than we would expect at random by conducting a bootstrap analysis using the package windex 2.1.099. Phenotypic plasticity To determine whether seasonal plasticity contributed to differences in CTMAX within our dataset, we examined how heat tolerance varied among species across their active period during the summer months in Melbourne. We chose Melbourne because it is the most seasonally variable site, and we would therefore expect that if plasticity was contributing significantly to the variation in our results we would observe the biggest plastic shifts in CTMAX in Melbourne across the season. This does not rule out the possibility that developmental plasticity contributes to plasticity in CTMAX. Bees were collected via sweep netting over native plants once a month between November 2020 to March 2021. Each month between 70 and 120 bees were assessed for CTMAX using the methods above. We looked at seasonal variation in heat tolerance using two approaches. The first approach included all individuals assessed for heat tolerance (27 species with a minimum of three individuals, Fig. 3A). We used a mixed effects linear model in the package lme4 1.1-37100 in R to ask whether heat tolerance varied across month and nest type, with month and nest type deemed fixed effects and species as a random effect. This analysis allowed us to ask whether heat tolerance changed across months and whether species with different nesting ecologies differed in how their heat tolerance changed across the months, which we would interpret from testing the interaction between month and nest type. This analysis did not allow us to explicitly ask whether individual species varied in their heat tolerance across months, which would require individual species to be sampled across multiple seasons. For our second approach we created a second dataset that included only species with at least three individuals per month, assessed in at least two months (10 species, Fig. 3B). Using this dataset as above we used a mixed effects linear model to ask whether heat tolerance varied across month and nest type, with month and nest type deemed fixed effects and species as a random effect. For this dataset we were also interested in whether variation in heat tolerance could be portioned to the species level or the month. We quantified the contribution of different sources of variation by fitting linear mixed-effects models and partitioning total phenotypic variance into components attributed to the random effects species and month and the residual variation. Population comparison To determine the extent to which populations varied in their heat tolerance, we reduced the full bee dataset to species where we had sampled more than three individuals from at least two populations (43 species). Using these data we quantified the contribution of different sources of variation (population/species) by fitting linear mixed-effects models and partitioning total phenotypic variance into components attributed to the random effects species and population and the residual variation. Thermal safety margins To rank species vulnerability to climate change, we calculated each species thermal safety margin as the distance (in degrees) between their heat tolerance and their nesting micro-climate temperature. We then compared these to thermal safety margins that were calculated using air temperatures only, as is the standard method43. This comparison was made to emphasise the importance of considering individual species behaviour when calculating risk to climate change. Reporting summary Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article. Supplementary information Supplementary Information Descriptions of Additional Supplementary Files Supplementary Data 1 Supplementary Data 2 Reporting Summary Transparent Peer Review file Acknowledgements We would like to thank Harley Thompson for assisting with laboratory work (extracting DNA from cryptic species and helping with wing length assessments). For assistance in bee identification we thank Ken Walker at Museums Victoria and Michael Batley at the Australian Museum. We thank Rawnsley Park Station in the Flinders Ranges, The Cairns Botanical Gardens, Big4 Carnarvon Gorge Caravan Park, Flinders University, The University of Queensland, Monash University, and Australia Zoo (Steve Irwin Wildlife Reserve) for allowing us to sample bees on their properties. We thank Nick Volpe for the use of native bee photos. Finally, we thank Michael Schwarz and Mark Stevens for early advice when planning the study. Author contributions CRBdS, RG and VK conceptualised the study. CRBdS led the field work and experiments with assistance from JEB and JBD. TB conducted the DNA extractions and library preparation for the ultraconserved element phylogeny. TS led the morphological bee identification with assistance from CRBdS and JBD. CRBdS collected wing length data. VK and RG extracted DNA from cryptic species and species with high sample sizes that were not included in the UCE sequencing. JBD constructed the multispecies ultraconserved element phylogeny. CRBdS and VK constructed the UCE - CO1 combined phylogeny. CRBdS conducted the phylogenetic trait analyses. CRBdS, RG and VK wrote the first draft of the manuscript. All authors edited the manuscript. Peer review Peer review information Nature Communications thanks Bryan Danforth and the other anonymous, reviewer(s) for their contribution to the peer review of this work. A peer review file is available. Funding This work was funded by an Australian Research Council Discovery Project Grant to VK and RG (DP200101272), a Monash University Advancing Women’s Success Grant and a Macquarie University Research Fellowship (MQRF0001197-2022) to CRBdS, and Holsworth Wildlife Research grant to JBD. Data availability Data and code for this study can be accessed from the Figshare repository (10.6084/m9.figshare.30214918). Accession numbers for CO1 sequence data generated in this study are listed in Supplementary Data 1 with an asterisk. We also used existing sequences from GenBank and BOLD where all accession numbers are listed in Supplementary Data 1 without an asterisk. The ultraconserved element sequence data is available in the NCBI Sequence Read Archive (Bioproject: PRJNA1314398 [https://www.ncbi.nlm.nih.gov/bioproject/PRJNA1314398/]). Code availability The code used to analyse this data and produce the figures can be found on Figshare (10.6084/m9.figshare.30214918) and contains R scripts and data for each analysis. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. These authors contributed equally: Ros Gloag, Vanessa Kellermann. Supplementary information The online version contains supplementary material available at 10.1038/s41467-026-73689-7. References Associated Data Supplementary Materials Supplementary Information Descriptions of Additional Supplementary Files Supplementary Data 1 Supplementary Data 2 Reporting Summary Transparent Peer Review file Data Availability Statement Data and code for this study can be accessed from the Figshare repository (10.6084/m9.figshare.30214918). Accession numbers for CO1 sequence data generated in this study are listed in Supplementary Data 1 with an asterisk. We also used existing sequences from GenBank and BOLD where all accession numbers are listed in Supplementary Data 1 without an asterisk. The ultraconserved element sequence data is available in the NCBI Sequence Read Archive (Bioproject: PRJNA1314398 [https://www.ncbi.nlm.nih.gov/bioproject/PRJNA1314398/]). The code used to analyse this data and produce the figures can be found on Figshare (10.6084/m9.figshare.30214918) and contains R scripts and data for each analysis.