It was illustrated very clearly in God's statement to Cain: "If thou doest well thou shalt be accepted."
Satan's plan was to replace the principle "if thou doest well, thou shalt be accepted". He proposed replacing it with a different principle: "thou shalt be accepted independent of what thou doest". That is the opposite of agency.
Agency is to choose our end by our actions.
Satan wanted to destroy the plan of choosing our end by our actions. He wanted to reward good for evil.
Agency is not "the Right to Disobey". When we live within our rights there are no consequences for doing so. By contrast, there are awful punishments that await those who exercise their agency to reject the truth. Agency is different than a right.
The declaration of independence states that man all men are created with certain rights: life, liberty, and the pursuit of happiness. There are implicit bounds on those rights. We do not have the right to pursue happiness by becoming a serial murderer. That is outside of our rights. But as long as we live within those rights, the pursuit of those rights are without consequence.
Good choices enhance agency. But we don't have more rights or fewer rights by living within our rights. When we read of the war in Heaven, we immediately think of rights because of the heritage of our government. But Agency is different than a right. Agency increases as we exercise it properly, rights do not.
We see examples in the law of Moses where those who are not members of his church, not even Israelites in fact, are required to abide by some of God's laws when they are among God's people. Those who are visiting Israelites are required to keep the Sabbath day holy. Not only them, but even their servants are required to keep the Sabbath day holy.
The whole point of rights is that they are yours and the government can have no hold on you for living within your rights. That is what makes them rights.
But agency is different. We can choose, but sooner or later we will be held accountable. Consider whether the follow scriptures are teaching that we have a RIGHT to do whatever we want, or whether our agency to choose is different that a RIGHT because we will be held accountable for every exercise of it.
Matthew 12: 36 But I say unto you, That every idle word that men shall speak, they shall give account thereof in the day of judgment.
Alma 12: 13 Then if our hearts have been hardened, yea, if we have hardened our hearts against the word, insomuch that it has not been found in us, then will our state be awful, for then we shall be condemned.
14 For our words will condemn us, yea, all our works will condemn us; we shall not be found spotless; and our thoughts will also condemn us; and in this awful state we shall not dare to look up to our God; and we would fain be glad if we could command the rocks and the mountains to fall upon us to hide us from his presence.
Those who are found to have hardened their hearts against the truth will find themselves condemned even by their thoughts. Does being guilty for one's thoughts sound like one is exercising a right? No, rights are things that belong to us to do with as we please. Agency is not a right to disobey.
Joseph Fielding Smith said: "I have heard people say, and members of the church too, 'I have a right to do just as I please.' My answer is 'No, you do not.' You haven't any right at all to do just as you please. There is only one right that you have and that is to do just what I read to you: keep the commandments of Jesus Christ.
He has a perfect right to tell us so.
We have no right to refuse.
I do not care who the man is, I do not care where he lives or what he is, when the gospel of Jesus Christ is presented to him he has no right to refuse to receive it.
He has the privilege. He is not compelled to receive it
because our father in Heaven has given to every one of us in the church and out the gift of agency.
That free agency gives us the privilege to accept and be loyal to our Lord's commandments,
but it has never given us the right to reject them.
Every man who rejects the commandments of our father in heaven is rebellious."