Something I prepared earlier...
Józef Piłsudski (a Polish revolutionary leader) in 1901 escaped to Galicia a (Polish dominated) part of the A-H empire. His activities against the Russian empire in Poland in 1904 and 1905 appear to have been independent of the A-H empire. In 1906 Józef Piłsudski set up a military school [purportedly to support the Combat Organization of the Polish Socialist Party] in Krakow, Galicia, purportedly with the "connivance" of Austrian authorities. In context, Krakow as part of the Austrian empire, which enjoyed significant autonomy including Polish as the language of government. As a consequence, Krakow was viewed as the center of Polish national revival and culture. Accordingly, it is likely any "connivance" was largely limited to the Galicia local government, which would have been more sympathetic to such causes.
From 1908 Józef Piłsudski transformed the membership to the ZMC. The ZWC's main purpose was to prepare Polish oficer cadres for a future Polish army for likely hostilities with Russia. From its inception, ZWC received crucial support in the highest circles of the Austria Empire which was preparing for war with Imperial Russia. As the Austro-Hungary government preferred to have more control over the secret paramilitary organizations, two legal organizations, subordinated to ZWC were created in 1910 with the approval of officials in Austria-Hungary, who would be able to supervise those legal organizations to a much larger extent then the secret ZWC - this indicates the precusor Polish groups were independent of the A-H administration.
So in summary, a Polish revolutionary organisation originating from Poland managed to establish a training base within the A-H empire, but within two years it had started its transformation into the basis of a formal Polish military. This can be contrasted with Serbia, where elements of its formal army continued to be routinely involved in acts of insurgency/ terrorism in neighbouring states.