Edit - responding to your comment edit, I don't know if it's common knowledge that HAL was written by humans (or not) but it's perhaps less clear with machine learning and AI algorithms used for modern autopilot systems, the systems learn and further program their own behavior beyond what the human programmers wrote, so in that sense I do think self-agency is emerging and as such there is responsibility on the part of both the car and it's creator, perhaps similar to how a parent is responsible for the independent actions of a young child.
And the answer wouldn't change: "Not unless we know it has independent subjectivity and self-awareness."
It always comes down to qualia. Our model of agency is based on a certain set of subjective experiences we take as working definitions of both self-awareness and free will.
We assume that other humans operate the same way. We can't know for sure, but life gets very complicated - and difficult - if we assume we're sentient but everyone else is just a meat robot. So assuming other humans have similar experiences is a reasonable position.
This breaks down with mechanical intelligence, because we can only understand it through visible behaviours. And of course you can have agency-like behaviours without human-like qualia and subjective awareness.
I strongly suspect this is not a solvable problem.
You can imagine some kind of hypothetical (magic) tool for measuring consciousness objectively. We can choose to believe in sentience, or we can choose not to. Neither position can be justified without objective measurement, and that isn't available without a magic device.
But even if it was available, the device would be paradoxical. The output of any objective consciousness measuring device still has to be experienced subjectively, which means it may be unreliable.
So - unsolvable.
Agency is just a nominative dignpost for saying that we can't say for certain what somebody's motives are given dome physical measures. That the outcome of a probability function with them as an agent is not deterministic in nature.
In that sense, HAL absolutely has agency. As certain as you to me.
If not, how is it different than a smart pile of meat?
Either AGI has free will and is responsible for its actions, or we don’t either.