Building Reliable Autonomous Agents: A Causal Perspective