Robot swarms can solve tasks that are impossible or too hazardous for single robots. For example, following a nuclear radiation leak, a user may wish to establish a distributed communication chain that partly extends into the most dangerous areas to gather new information. The challenge is to create long chains while maintaining chain connectivity (‘connected reach’), where those at the distant end of the chain are more likely to be disconnected. Here we take the concept of dynamic ‘boldness’ levels from animal behavior (Stegodyphus social spiders) to explore such risky environments in a way that adapts to the size of the group. Boldness is implemented as a continuous variable associated with the risk appetite of individuals to explore regions more distant from a central base. We present a decentralized mechanism for robots, based on the frequency of their social interactions, to adaptively take on ‘bold’ and ‘shy’ behaviors. Using this new bioinspired algorithm, which we call SPIDER, swarms are shown to adapt rapidly to the loss of bold individuals by regenerating a suitable shy–bold distribution, with fewer bolder individuals in smaller groups. This allows them to dynamically trade-off the benefits and costs of long chains (information retrieval versus loss of robots) and demonstrates the particular advantage of this approach in hazardous or adversarial environments.