2.47 As for obligatory, occasional and desiderative acts taught in the Vedas and associated with some result or other, you, an aspirant established in Sattva, have the right only to perform them:  You have no right to the fruits known to be derived from such acts. Acts done with a desire for fruit bring about bondage. But acts done without an eye on fruits form My worship and become a means for release. Do not become an agent of acts with the idea of being the reaper of their fruits. Even when you, who are established in pure Sattva and are desrious of release, perform acts, you should not look upon yourself as the agent. Likewise, it is necessary to contemplate yourself as not being the cause of even appeasing hunger and such other bodily necessities. Later on it will be said that both of these, agency of action and desire for fruits, should be considered as belonging to Gunas, or in the alternative to Me who am the Lord of all. Thinking thus, do work. With regard to inaction, i.e., abstaining from performance of duties, as when you said, 'I will not fight,' let there be no attachment to such inaction in you. The meaning is let your interest be only in the discharge of such obligatory duties like this war in the manner described above.

Sri Krsna makes this clear in the following verse: