A konfederacja (Polish for "confederation") was an ad hoc association formed by Polish-Lithuanian szlachta (nobility), clergy, cities, or military forces in the Polish-Lithuanian Commonwealth for the attainment of stated aims. A konfederacja often took the form of an armed rebellion aimed at redressing perceived abuses or trespasses of some (e.g. royal) authority. Such "confederations" acted in lieu of state authority or to force their demands upon that authority. They could be seen as a primary expression of direct democracy and right of revolution in the Commonwealth, and as a way for the nobles to act on their grievances and against the state's central authority.
In the late 13th century, confederations of cities, aiming to support public safety and provide security from rampant banditry, appeared, with the first confederation being that of several towns (Poznań, Pyzdry, Gniezno and Kalisz in Greater Poland) in 1298. In the mid-14th century, confederations of nobility, directed against the central authorities, emerged, with the first such confederation being that of 1352. During interregnums, confederations (essentially vigilance committees) formed to replace the inactive royal court, protect internal order, and defend the country from external dangers. The confederations, as a right of revolution, were recognized in Polish law through the Henrician articles (1573), part of the pacta conventa sworn by every Polish king since 1576. They stated (in the articulus de non praestanda oboedientia, a rule dating to 1501 from Privilege of Mielnik) that if the monarch did not recognize or abused the rights and privileges of the nobility (szlachta), the nobles would no longer be bound to obey him and would have the legal right to disobey him.