  Cooperation in an open dynamic system fundamentally depends upon information
distributed across its components. Yet in an environment with rapidly enlarging
complexity, this information may need to change adaptively to enable not only
cooperation but also the mere survival of an organism. Combining the methods of
evolutionary game theory, agent-based simulation, and statistical physics, we
develop a model of the evolution of cooperation in an ageing population of
artificial decision makers playing spatial tag-mediated prisoner's dilemma
games with their ingroup neighbors and with genetically unrelated immigrant
agents. In our model with six strategies we introduce the concept of
time-varying tags such that the phenotypic features of 'new' agents can change
into 'approved' following variable approval times. Our Monte Carlo simulations
show that ingroup-biased ethnocentric cooperation can dominate only at low
costs and short approval times. In the standard 4-strategy model with fixed
tags, we identified a critical cost $c_{\mathrm{crit}}$ above which cooperation
transitioned abruptly into the phase of pure defection, revealing remarkable
fragility of ingroup-biased generosity. In our generalized 6-strategy model
with time-varying tags, elevated cooperation was observed for a wider region of
the parameter space, peaking at intermediate approval times and cost values
above $c_{\mathrm{crit}}$. Our findings show that in an open system subject to
immigration dynamics, high levels of social cooperation are possible if a
fraction of the population adopts the strategy with an egalitarian generosity
directed towards both native and approved naturalized citizens, regardless of
their actual origin. These findings also suggest that instead of relying upon
arbitrarily fixed approval times, there is an optimal duration of the
naturalization procedure from which the society as a whole can profit most.
