Passive learning of active causal strategies in agents and language models