  In some systems, the behavior of the constituent units can create a `context'
that modifies the direct interactions among them. This mechanism of indirect
modification inspired us to develop a minimal model of context-dependent
spreading. In our model, agents actively impede (favor) or not diffusion during
an interaction, depending on the behavior they observe among all the peers in
the group within which that interaction occurs. We divide the population into
two behavioral types and provide a mean-field theory to parametrize mixing
patterns of arbitrary type-assortativity within groups of any size. As an
application, we examine an epidemic spreading model with context-dependent
adoption of prophylactic tools such as face-masks. By analyzing the
distributions of groups' size and type-composition, we uncover a rich
phenomenology for the basic reproduction number and the endemic state. We
analytically show how changing the group organization of contacts can either
facilitate or hinder epidemic spreading, eventually moving the system from the
subcritical to the supercritical phase and vice versa, depending mainly on
sociological factors, such as whether the prophylactic behavior is hardly or
easily induced. More generally, our work provides a theoretical foundation to
model higher-order contexts and analyze their dynamical implications,
envisioning a broad theory of context-dependent interactions that would allow
for a new systematic investigation of a variety of complex systems.
