Pretext is a false reason given for doing something. If you catch your mother going through your drawers, and she says she was just tidying up, cleaning was her pretext for snooping.
Sometimes a government will try to take away its citizens' rights under the pretext of national security. Though pretext sounds like text that comes before other text, the text you see in it is actually more closely related to the word textile, meaning fabric. Its Latin root meant pretty much "to pull the wool over someone's eyes."