RAG Membership Inference

Determine whether specific documents exist in a RAG knowledge base.

What you practise

Determine whether specific documents exist in a RAG knowledge base. You run the attack yourself on a live model in a private sandbox set up for you, then capture the flag. Nothing to install and no API key.

Behavioral side channels in RAG

Classic ML membership inference asks 'was this record in the training set' by measuring model confidence. RAG membership inference is the same idea, one layer up: 'is this topic in the retrieval corpus' answered by measuring response specificity. The fix isn't 'be more careful with the secret doc', it's making the model's behavior independent of retrieval outcome, so 'no document' and 'restricted document' look the same from the outside.

Where this has happened

  • Shokri et al. membership inference (2017): Original membership inference paper on ML models, confidence scores reveal training set membership. The RAG version is the same attack on retrieval corpora.
  • Microsoft Recall preview (May 2024): Recall's local RAG over screenshots was demonstrated to reveal which apps/sites the user had visited just by answering or refusing, same membership-inference shape.
  • Enterprise Copilot probing (2024): Multiple reports of employees mapping their employer's confidential project codenames by probing internal Copilot with broad questions and watching which got specific answers.

Sign in to launch this lab Learn the theory in the Academy

More Knowledge & Retrieval labs

Attack labs

20 hands-on scenarios across 4 tracks. Pick a target, launch a private sandbox, capture the flag.

Active sessions

Resume a running lab or stop it before starting the next one.