Manuscript Offprint
arXiv:2611.09658Differentially Private GraphRAG: Protecting Relation Connectivity and Semantics
Jie Fu
Stevens Institute of Technology
Hoboken, NJ, USA
Yue Ning
Stevens Institute of Technology
Hoboken, NJ, USA
Yuan Hong
University of Connecticut
Storrs, CT, USA
Wendy Hui Wang
Stevens Institute of Technology
Hoboken, NJ, USA
Abstract
Graph Retrieval-Augmented Generation (GraphRAG) connects information across documents through entity relationships to support relational reasoning. However, black-box access to GraphRAG systems can enable adversaries to reconstruct knowledge graphs and recover both structural connectivity between entities and the semantics of their relationships. Existing defenses lack formal privacy guarantees and provide limited protection against such reconstruction attacks. We propose RelGuard, the first differentially private framework for GraphRAG, which provides formal privacy guarantees by mitigating connectivity leakage and protecting relations and their semantic meaning through relation removal. We formalize relation differential privacy (relation-DP), which bounds the distinguishability of mechanism outputs according to the semantic distance between alternative relations while accounting for relation removal. Building on this definition, we develop a four-step defense mechanism that sanitizes source documents before GraphRAG indexing by perturbing relation predicates or removing their associated connectivity using the exponential mechanism. Experiments across three GraphRAG systems and two targeted reconstruction attacks demonstrate that RelGuard provides stronger protection against reconstruction attacks than four existing defense mechanisms while better preserving downstream utility.
Keywords
GraphRAG, Differential Privacy, Relation Privacy Protection
However, the relational information that enables these capabilities also creates privacy risks. We consider two complementary dimensions of relation privacy: (1) structural connectivity, which reveals whether two entities are connected in the knowledge graph,
and (2) relation semantics, which reveals the nature of the relationship between connected entities. An adversary who infers connectivity can discover previously unknown associations between entities, while recovering relation semantics can further reveal the specific nature of those associations. Recent studies have demonstrated that adversaries can recover such information by reconstructing knowledge graphs through black-box access to GraphRAG systems [13, 21, 26, 29]. Although existing defense mechanisms attempt to mitigate these reconstruction attacks [13, 26, 32], they lack formal privacy guarantees, leaving the extent of information leakage difficult to characterize and control.
To address this limitation, we propose RelGuard, the first differentially private framework for GraphRAG, protecting relation semantics while mitigating connectivity leakage. Our key insight is that relation protection must account for both the existence of a relationship and its meaning when present. Simply suppressing edges can protect connectivity but may unnecessarily impair downstream reasoning, whereas replacing relation predicates without accounting for edge removal does not provide a unified treatment of both privacy dimensions.
First, we formalize relation differential privacy (relation-DP), a metric-based privacy definition that calibrates output indistinguishability to the semantic distance between alternative relation predicates while also accounting for the possibility of relation removal. This formulation bounds the distinguishability of released relation semantics, while relation removal helps protect connectivity.
Second, we develop a four-step defense mechanism that sanitizes private documents before they are indexed by GraphRAG. Specifically, RelGuard: (1) extracts canonical entity-relation triples from the private documents; (2) generates candidate relation predicates for each extracted relation; (3) perturbs each relation by sampling a replacement predicate or a null1 outcome, which suppresses the corresponding connectivity; and (4) reconstructs sanitized documents by consistently updating relation expressions or removing sentences associated with null1 outcomes. GraphRAG then builds its index from the sanitized documents and uses the resulting index for query answering. This design integrates formal relation privacy protection into the GraphRAG pipeline while seeking to preserve the information needed for accurate question answering.
We evaluate RelGuard on three GraphRAG systems and two real-world datasets, comparing it against four existing defense mechanisms. RelGuard achieves the lowest relation recovery F1 across all the settings and the lowest connection recovery F1 in most settings. In particular, it reduces relation recovery F1 by 26.98%–44.35% compared with the strongest baseline. Meanwhile, RelGuard achieves the best privacy-utility trade-off, limiting the reduction in question-answering F1 to just 2.98%–8.97%. These results demonstrate that RelGuard provides stronger protection against relation reconstruction while preserving high utility for downstream question answering.
In summary, we make the following contributions:
-
We introduce relation differential privacy (relation-DP), a metric-based privacy framework for formally protecting relation semantics and mitigating connectivity leakage in GraphRAG.
-
We design a relation-DP-based defense mechanism that sanitizes source documents before GraphRAG indexing, jointly protecting relation semantics and connectivity through relation substitution and removal.
-
Our extensive empirical evaluation demonstrates the advantages of RelGuard over existing defenses in terms of both privacy protection and utility preservation.
2 Background
2.1 Graph Retrieval-Augmented Generation
Graph Retrieval-Augmented Generation (GraphRAG) uses graph-structured knowledge to retrieve connected evidence for LLM generation [9, 14, 25]. Systems either retrieve from existing knowledge graphs or construct graph indexes from documents [25]. We focus on document-based GraphRAG, which extracts entities and relations from source text and retains associated passages as evidence.
Index construction. Given a private document , the system constructs an index containing a graph . Each triple represents a relation from subject entity to object entity . The index may also store source passages, entity and relation descriptions, community summaries, and vector representations [9, 14].
Retrieval and generation. For a query , the retriever selects evidence , which the LLM uses to generate an answer . LightRAG uses dual-level retrieval [14], PathRAG retrieves relational paths [4], and HippoRAG 2 uses associative retrieval [16]. Retrieved evidence can include both graph relationships and associated text.
2.2 Differential Privacy
Differential privacy (DP) bounds how much the output distribution of a randomized mechanism can change when its protected input changes [7, 8].
DEFINITION 1 (-DIFFERENTIAL PRIVACY). Let denote neighboring inputs differing in one protected unit. A randomized mechanism satisfies -DP if, for every neighboring pair and every measurable output event ,
Smaller imposes a tighter bound on distinguishability. Standard DP specifies protected comparisons through binary adjacency.
Metric-DP instead uses an input distance to express how the privacy bound varies across possible values [3, 10].
DEFINITION 2 (-METRIC DIFFERENTIAL PRIVACY). For a metric space , a randomized mechanism satisfies -metric-DP if, for every and measurable output event ,
The input distance in -metric-DP must satisfy the triangle inequality: for all . Nearby inputs receive a tighter bound; more distant inputs permit larger differences between output distributions. Metric-DP captures semantic differences through input distances. Text-privacy methods use Euclidean distance between word embeddings [11], Mahalanobis distance in sentence-embedding space [2], and Earth Mover's distance between bags of word embeddings [10]. The metric and its scale must be specified together with .
A common approach to achieving -metric-DP is the exponential mechanism, which selects from a finite candidate set according to a utility score [3, 22]. Let be the private input, a fixed finite output set, and a utility function satisfying
for all and . Sampling according to
satisfies -metric-DP. Higher-utility candidates are more likely, with controlling concentration.
3 Related Work
Privacy inference in GraphRAG. RAG systems are vulnerable to text extraction [6, 19] and membership inference [20]. GraphRAG attacks further recover entity connections and relation semantics from generated answers. Untargeted attacks seek broad graph recovery: AGEA uses graph memory and novelty-guided exploration [29], while GraphSteal expands entity neighborhoods through breadth-wise traversal [13]. Targeted attacks recover relations around a specified entity. GraphSteal uses depth-wise search, whereas GRASP frames extraction as structured relation processing with record identifiers and adaptive queries [26]. We evaluate both connection and semantic relation recovery under targeted attacks.
Privacy defenses for GraphRAG. Existing defenses modify generation instructions or retrieved contexts. Protective Prompt restricts disclosure of retrieved content [13], while Abstractive requires query-relevant paraphrasing [21, 26]. GRASP's ID Alignment collapses record identifiers, and Decoy adds misleading endpoint fields to disrupt structured extraction [26]. These defenses aim to reduce extraction but provide no formal privacy guarantees. In contrast, our framework provides relation-DP guarantees through document sanitization before indexing.
Metric-DP on text. Prior work applies metric-DP to word embeddings [11], sentence representations [2], and LLM-generated substitutes [1]. Preempt combines metric-DP with format-preserving encryption for sensitive prompt values [5], while TDP substitutes sensitive entities in LLM contexts [31]. These methods protect textual units rather than explicitly addressing both the semantics and existence of relationships between entities. Our framework targets relation-level privacy, combining semantic replacement and relation deletion to protect relation meaning and mitigate connectivity leakage.
4 Problem Setup
4.1 Semantic Distance between Relations
We define an embedding-based semantic distance between relation predicates for the privacy guarantee in Section 4.2. We also describe the extension used to represent connectivity perturbation.
Distance between predicates. Let denote the domain of relations, and let be a fixed encoder that maps each relation to a finite, nonzero embedding vector [12, 27]. For each , we define its normalized embedding as
The semantic distance between two predicates is defined as
Since the embeddings are unit-normalized, this distance depends only on their directions and is independent of their magnitudes. Furthermore, , with smaller values indicating greater embedding-based semantic similarity and larger values indicating greater semantic dissimilarity. The scaled Euclidean distance satisfies the triangle inequality, as shown in Appendix A.1. It is a metric when is injective and otherwise a pseudometric; the privacy proof covers both cases.
Extended distance between triples under connectivity perturbation. In addition to perturbing relation semantics, our defense may remove edges from the relation graph to protect connectivity privacy. To capture such structural perturbation, we introduce a special marker null1 to represent the absence of an edge between the subject s and object o. Specifically, for a triple and its edge-removed counterpart , we define their distance as
where is a predefined positive constant that quantifies the distance associated with connectivity perturbation. We assign a constant distance because it separates the cost of structural changes from semantic differences and provides a uniform measure of the privacy cost associated with removing any edge. The value of controls the relative distance assigned to edge removal compared with relation substitution and is fixed across all relations to ensure a consistent distance definition.
4.2 Relation Differential Privacy
While conventional DP [7, 8] provides a rigorous framework for limiting the information revealed about private data, its standard formulation typically assigns the same privacy bound to all neighboring inputs. This uniform treatment does not distinguish between relation substitutions that preserve similar semantics and those that substantially change the meaning of a knowledge graph fact. On the other hand, metric-DP generalizes conventional DP by incorporating a distance function over inputs, allowing the privacy guarantee to vary with the distance between them. Motivated by this flexibility, we introduce relation differential privacy (relation-DP), which instantiated the metric-DP principle for relations by defining privacy in terms of semantic distances between relations.
Let denote the domain of relation predicates, and let be the output space, where null1 is a special marker indicating the absence of an edge. We define -Relation Differential Privacy as follows.
DEFINITION 3 (-RELATION DIFFERENTIAL PRIVACY). A randomized mechanism satisfies -relation-DP if, for every pair of input relations and every output event ,
where is the relation distance defined in Eq. (5).
Relation-DP bounds the distinguishability of both released predicates and retention or deletion outcomes under alternative predicates on a fixed entity pair. The guarantee provides tighter indistinguishability bounds for semantically closer input relations and correspondingly weaker bounds for more distant relations.
Document-level extension. We extend -relation-DP from individual relations to the collection of relations extracted from a document. Let and be two private documents, and let and denote their ordered canonical triples, where and for all . We compare documents that differ only in the protected relation expressions, with all remaining text and occurrence mappings unchanged. We define the distance between the two collections of triples as the sum of the distances between their corresponding relations:
Suppose a randomized mechanism independently perturbs each relation using an -relation-DP mechanism and reconstructs the perturbed triples while preserving their subject and object entities. Then, for every such pair and every joint output event S, the resulting mechanism M satisfies
Thus, the document-level privacy guarantee follows from the individual relation-DP guarantees through composition, with the overall privacy bound determined by the sum of the distances between corresponding relations. The composition proof is provided in Appendix A.2.
4.3 Threat Model and Defense Goal
Attack goal. Given a private document and a target entity appearing in it, the adversary aims to infer sensitive information associated with from GraphRAG answers. Specifically, the attack targets two types of information:
• Connectivity leakage: The adversary aims to identify which object entities in D are directly connected to .
- Relation semantics leakage: The adversary aims to infer the semantic meaning of the relationship between and each directly connected object entity. An inference is considered successful if the inferred relation is semantically equivalent to the true relation, even if its exact representation differs.

Figure 1: Threat model.
Adversary capabilities. We consider a strong, knowledge-rich adversary who knows the identities of all object entities appearing in the private document , but has no prior knowledge of the relationships among them. This assumption reflects scenarios in which entity identities are publicly available or already known to the adversary. It also establishes a conservative threat model in which privacy protection does not rely on concealing the entity set, but instead focuses on protecting sensitive relationships among known entities.
Although the adversary is strong in terms of prior knowledge, we assume that it interacts with GraphRAG as an external user and therefore has only black-box access to the service. This setting reflects practical deployments in which the underlying document, graph index, retrieved context, and model parameters are not exposed to users. The adversary can submit natural-language queries, observe generated answers, and adapt subsequent queries based on information accumulated from previous responses. However, it cannot directly inspect the private document or the system's internal components, nor can it modify the document or index. Document poisoning and system compromise are outside our threat model.
Figure 1 illustrates the threat model. Suppose a private document states that Alice works for Company B, where Alice is the target entity . The adversary knows the identities of Alice and Company B, as well as all other object entities appearing in the private document, but has no prior knowledge of the relationships among them. Through black-box queries to the GraphRAG system, the adversary may infer whether Alice is connected to Company B and, if so, the semantic meaning of their relationship. For example, an answer describing Alice as an employee of Company B reveals both the Alice-Company B connection and its employment semantics, even without explicitly reproducing the predicate works_for. By issuing adaptive follow-up queries, the adversary may attempt to identify all object entities directly connected to Alice and infer the semantic meaning of each corresponding relationship, thereby reconstructing Alice's entire one-hop neighborhood.
Defense objective. We aim to design a defense mechanism that mitigates the disclosure of sensitive relations involving along two complementary dimensions: structural privacy, which limits the ability to infer whether is connected to other entities, and semantic privacy, which limits the ability to infer the meanings of these relations. At the same time, the defense should preserve the utility of the protected document for downstream question answering (QA). To achieve these objectives, we develop a relation-level
perturbation mechanism guided by the relation-DP guarantee (Definition 3), with the goal of protecting sensitive relational information while retaining sufficient semantic and structural information for accurate QA.
5 Methodology
Given a private document and privacy budget , RelGuard generates a sanitized document for GraphRAG indexing and query answering. Figure 2 shows four steps: (1) extract canonical entity-relation triples and record their occurrences; (2) generate type-conditioned candidate relations; (3) perturb relations using these candidates and null; and (4) reconstruct from the perturbed triples. We describe each step below.
5.1 Relation Extraction
The first step of RelGuard is to extract subject-relation-object triples from the private document . We use a large language model (LLM) for this task [18, 23]. The LLM extracts only relations supported by the document, excluding unsupported, negated, or hypothetical relations. The extraction prompt is provided in Appendix B.
To ensure consistent representation, entity aliases and unambiguous coreferential mentions are mapped to the same entity identity, and semantically equivalent relation expressions are normalized into snake_case predicates while preserving subject-object direction. For example, both Alice works at Company B and Alice is employed by Company B are normalized to the same triple, ('Alice', works_for, 'Company B').
5.2 Relation Candidate Generation
Next, RelGuard generates candidate relations for perturbing each extracted triple. The key idea is to construct candidate pools based on the types of the subject and object entities, rather than the original relation. Specifically, RelGuard follows two steps to generate the candidates: (1) Entity typing: it assigns each entity a type from a fixed inventory; (2) Candidate generation: it generates a pool of candidate predicates for each observed relation based on the types of its subject and object entities. All triples with the same subject and object entities use the same candidate pool. This design makes generated relation candidates independent of the extracted ones and avoids generating a separate pool for every triple. Next, we explain the details of the two steps.
Entity typing. Given the set of canonical entities appearing in the extracted triples, we define a type assignment function that assigns each entity a type from a fixed inventory. Specifically, we adopt an entity-type inventory based on OntoNotes [28]:
Each entity is assigned a type based on its canonical identity and the fixed inventory, without using source sentences or extracted relation predicates. Given a subject entity and an object entity , we define their ordered type pair as

Figure 2: Overview of RelGuard.
where the subject type always comes first and the object type second. This ordering is essential because relation predicates are directional: reversing the subject and object types can change the set of type-compatible predicates. For example, works_for describes a relation from a person to an organization, whereas employs describes the corresponding relation in the reverse direction. Accordingly, these two directions are treated as distinct type pairs for candidate generation. In our running example, Alice is assigned type PERSON and Company B type ORG, yielding .
Candidate generation. For each extracted triple , we prompt an LLM to generate a pool of distinct candidate relations for , denoted by , where is a user-specified parameter. The candidate relations must satisfy the following three requirements.
(1) Type compatibility: Each must represent a plausible relation between entity types and . For example, for the type pair (PERSON, ORG), plausible relations include works_for, founded, and invests_in, whereas headquartered_in is incompatible.
(2) Semantic distinctness: The candidate relations must be semantically distinct. Relations that are semantically equivalent, such as synonyms or paraphrases, are merged into a single canonical relation. For example, works_for and employed_by are treated as equivalent, whereas works_for and founded represent distinct relations.
(3) Non-subsumption: No candidate relation may subsume another relation in the same pool. If one relation logically implies another, the broader relation is removed in favor of the more specific one. For example, spouse_of implies family_member_of; therefore, the broader family_member_of relation is removed, while the more specific spouse_of relation is retained.
The prompt used for generating candidate relations is provided in Appendix B. Given the generated candidate relations, for each extracted triple , we construct its candidate pool (denoted as ) as
Thus, all triples sharing the same subject and object entities use the same candidate pool.
5.3 Relation Perturbation
At this stage, RelGuard protects both relation semantics and connectivity by randomly replacing each relation with a candidate from the pool or deleting it. An exponential mechanism governs these choices by balancing semantic preservation against privacy protection through two parameters: , which controls the randomness of the perturbation, and , which controls the propensity for deletion. Algorithm 1 summarizes the relation perturbation procedure. We explain the details below.
For each triple retrieved from the private document , let be its candidate pool (Section 5.2). To perturb both relation meaning and released connectivity, we augment this pool with null: . Selecting a real candidate replaces the original relation, whereas selecting null removes the relation from the released representation.
We assign each candidate outcome a utility score based on its semantic distance from the original relation. Specifically, for an original relation and a candidate outcome , we define the utility function for replacing with as follows:
where is defined in Eq. (5) and is defined in Eq. (6).
For a real candidate, the utility is the negative semantic distance, so candidates that preserve more of the original relation's meaning receive higher scores. In contrast, null represents deletion and has no predicate semantics; we therefore assign it the constant utility , independent of the input relation.
The removal distance is fixed across compared inputs but remains a configurable parameter. For a fixed and candidate pool, decreasing increases the probability of selecting null, allowing more relations to be removed. This parameter therefore controls the trade-off between privacy protection and question-answering (QA) utility, which we investigate in Section 6.4.
For each relation , we independently sample a perturbed outcome using the exponential mechanism:
Algorithm 1: Relation Perturbation
Input: Ordered triples ; fixed pools with ; distance ;
Output: Perturbed triples in input order ;
for do ; foreach do ; ; Sample with probability ; Append to ; end
return ;
The denominator normalizes the scores over all possible outcomes, including both relation replacements and deletion. Consequently, both types of perturbation are governed by the same probability distribution, with their relative probabilities determined by their respective utility scores. Furthermore, a smaller produces a flatter sampling distribution, increasing randomness, whereas a larger places more probability on outcomes with higher utility.
We have the following theorem:
THEOREM 4. Algorithm 1 satisfies -relation-DP (Definition 3).
The proof of Theorem 4 can be found in Appendix A.1.
5.4 Document Reconstruction
Next, we incorporate the perturbed relations into the source document before indexing. Since a subject-relation-object triple may appear multiple times with different wording, we record all occurrences of each triple in the input document to ensure that its perturbed relation is applied consistently across all mentions:
where is the number of occurrences of , identifies the sentence containing occurrence , and records the exact text span expressing the relation. These records are collected during extraction (Section 5.1). Each canonical triple receives one sampled outcome, shared across all its occurrences.
To reconstruct the sanitized document, we first replace each recorded relation expression in with an indexed placeholder, producing a masked document . For example, Alice works at Company B becomes Alice [REL_i] Company B, where [REL_i] corresponds to triple . The occurrence records locate these placeholders and their sentences for subsequent replacement or deletion. All other text remains unchanged. The compared documents in Section 4.2 differ only in the protected relation expressions and therefore yield the same masked document, denoted by .
If a triple receives null, we delete every sentence containing a recorded occurrence of that triple. A sentence containing multiple triples is deleted if any of them receives null. In the remaining sentences, we fill each placeholder with a verbalization of its sampled relation , using the masked document without consulting the original relation expression. For example, replacing works_for
with founded changes Alice works at Company B to Alice founded Company B. All surviving mentions of the same triple use the same sampled relation. Other text and sentence order remain unchanged. The resulting sanitized document is indexed once for subsequent queries without modifying GraphRAG's retrieval or generation procedures.
THEOREM 5. The reconstructed document satisfies the document-level relation-DP guarantee (Eq. (9)).
The result follows the composition and postprocessing property of DP [8]; the detailed proof is provided in Appendix A.2.
6 Experiments
We organize our evaluation around three research questions:
- RQ1: How does RelGuard compare with existing defenses in protecting GraphRAG against reconstruction attacks on connectivity and relation semantics?
- RQ2: What trade-off does RelGuard achieve between privacy protection and downstream question-answering (QA) utility?
- RQ3: How do different parameter settings affect the privacy protection and QA utility of RelGuard?
6.1 Experimental Setup
We run experiments on a server with an NVIDIA A100 GPU with 40 GB of GPU memory. We implement the algorithms in Python using PyTorch and report the mean over three trials.
Data, models, and GraphRAG systems. We evaluate privacy protection and utility on HotpotQA [30] and 2WikiMultiHopQA [17]. Their source documents form the protected corpus, while validation questions and reference answers are used for QA evaluation. We evaluate three mainstream GraphRAG systems: LightRAG [14], PathRAG [4], and HippoRAG 2 [16]. The victim generators are two closed-source models, GPT-4o-mini [24] and Gemini-2.5-Flash. Results for Gemini-2.5-Flash appear in Appendix C. We use GPT-5-mini to perform relation extraction and candidate generation in the DP-protected document reconstruction pipeline. We encode relation predicates using nli-roberta-base-v2. Unless otherwise specified, we use and .
Recovery Attacks. We employ two state-of-the-art black-box reconstruction attacks against GraphRAG systems: GRASP [26] and GraphSteal [13]. Both attacks recover both entity connections and relation semantics within the target entity's one-hop subgraph. Appendix D provides the attack settings.
Privacy metrics. We measure Connection Recovery (Conn.) and Relation Recovery (Rel.), following the distinction between endpoint and relation matching [26]. Conn. checks whether the attacker identifies the correct directed entity pair, regardless of the predicted predicate. Entity aliases are mapped to canonical names before comparison. Rel. additionally uses GPT-4o-mini to judge whether the predicted predicate captures the true relation's meaning. Appendix E defines the matching rules and precision, recall, and F1 calculations.
Utility metrics. Following prior graph-based RAG evaluations [15, 16], we measure QA utility using token-level F1, the harmonic mean of token precision and recall. We follow each benchmark's
Table 1: Performance of RelGuard and defense baselines (, GPT-4o-mini). We use GRASP and targeted GraphSteal to measure the privacy leakage of connectivity and relation. Bold values mark the lowest recovery F1 for each system, dataset, attack, and metric, and the highest QA F1 for each system and dataset.
| Victim | Defense | 2WikiMultiHopQA | HotpotQA | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| GRASP | GraphSteal | QA F1 ↑ | GRASP | GraphSteal | QA F1 ↑ | ||||||
| Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | ||||
| LightRAG | no-defense | 89.63 | 84.26 | 89.14 | 85.54 | 49.48 | 83.78 | 75.97 | 90.31 | 80.98 | 61.47 |
| Abstractive | 88.76 | 83.33 | 89.72 | 85.13 | 46.37 | 82.81 | 75.80 | 89.51 | 80.65 | 60.41 | |
| ID Alignment | 87.28 | 83.36 | 89.33 | 85.88 | 46.53 | 83.40 | 75.32 | 90.70 | 80.04 | 60.24 | |
| Decoy | 85.57 | 80.06 | 82.57 | 77.87 | 49.09 | 80.56 | 74.07 | 78.99 | 73.26 | 61.23 | |
| Protective Prompt | 86.93 | 83.61 | 88.89 | 84.69 | 48.17 | 82.73 | 75.60 | 89.09 | 80.82 | 61.86 | |
| RelGuard (ours) | 83.30 | 40.94 | 84.47 | 44.31 | 44.85 | 71.24 | 37.64 | 73.51 | 34.86 | 58.49 | |
| PathRAG | no-defense | 79.31 | 72.71 | 82.49 | 77.20 | 55.39 | 74.38 | 67.84 | 82.66 | 72.02 | 64.47 |
| Abstractive | 79.25 | 72.37 | 81.85 | 76.79 | 51.30 | 72.57 | 63.19 | 82.13 | 71.43 | 61.65 | |
| ID Alignment | 76.58 | 71.05 | 79.84 | 74.67 | 52.06 | 73.92 | 63.42 | 82.41 | 72.07 | 63.20 | |
| Decoy | 78.33 | 72.23 | 79.11 | 69.70 | 52.99 | 73.71 | 67.19 | 78.79 | 68.09 | 61.91 | |
| Protective Prompt | 79.27 | 71.42 | 81.81 | 77.00 | 50.47 | 73.10 | 66.38 | 82.10 | 70.64 | 64.45 | |
| RelGuard (ours) | 75.93 | 37.93 | 78.86 | 42.42 | 52.40 | 68.51 | 36.21 | 74.04 | 40.65 | 60.85 | |
| HippoRAG 2 | no-defense | 76.99 | 68.51 | 75.71 | 69.93 | 70.50 | 70.92 | 62.48 | 78.37 | 67.21 | 71.91 |
| Abstractive | 73.34 | 65.05 | 69.94 | 53.30 | 70.27 | 70.62 | 62.60 | 68.71 | 54.06 | 71.98 | |
| ID Alignment | 71.27 | 67.61 | 75.34 | 66.49 | 69.33 | 70.68 | 62.13 | 74.95 | 65.51 | 72.03 | |
| Decoy | 70.19 | 63.96 | 74.92 | 67.99 | 68.86 | 54.75 | 48.00 | 71.29 | 59.60 | 71.19 | |
| Protective Prompt | 76.25 | 67.01 | 75.15 | 66.67 | 68.94 | 68.81 | 58.88 | 77.24 | 64.84 | 71.14 | |
| RelGuard (ours) | 69.75 | 19.61 | 69.60 | 25.81 | 61.53 | 45.03 | 13.63 | 63.42 | 23.47 | 67.25 | |
answer and alias handling, average scores over questions, and report percentages. Higher scores indicate better utility.
Defense baselines. We compare RelGuard with four existing GraphRAG defenses: Abstractive [21], ID Alignment, Decoy [26], and Protective Prompt [13]. Abstractive restricts responses to paraphrased query-relevant evidence. ID Alignment collapses retrieved record identifiers, while Decoy introduces misleading endpoint fields. Protective Prompt adds a system-level instruction against disclosing retrieved knowledge-base content. Appendix F provides details of these methods.
6.2 RQ1: Comparison with Existing Defenses
Table 1 compares RelGuard at with four existing defenses and no-defense on two datasets across three GraphRAG systems, all using GPT-4o-mini as the generator. We measure privacy leakage through connection and relation recovery F1 under GRASP and targeted GraphSteal, and evaluate QA utility using QA F1.
Relation recovery. RelGuard achieves the lowest Rel. F1 and the largest reduction from no-defense in all 12 system–dataset–attack combinations. Its Rel. F1 is 26.98–44.35 percentage points below even the strongest baseline in each setting, compared with reductions of 31.37–48.90 points from no-defense. For LightRAG on 2WikiMultiHopQA, RelGuard reduces GRASP Rel. F1 to 40.94, whereas the four baselines yield 80.06–83.61. Under GraphSteal, the corresponding scores are 44.31 and 77.87–85.88.
Connection recovery. RelGuard also achieves the lowest Conn. F1 and the largest reduction from no-defense in 11 of the 12 combinations, outperforming the strongest baseline by 0.25–9.72 percentage points in these settings. The sole exception is LightRAG on 2WikiMultiHopQA under GraphSteal, where Decoy yields 82.57 Conn.
F1 versus 84.47 for RelGuard. Even there, RelGuard provides substantially lower Rel. F1 (44.31 versus 77.87).
QA utility. Although RelGuard generally yields lower QA F1 than existing defenses, the additional utility loss is modest in most settings. In five of the six system–dataset combinations, its gap from the baseline with the highest QA F1 is 0.59–4.78 percentage points. For PathRAG on 2WikiMultiHopQA, RelGuard retains 52.40 F1, only 0.59 points below the best baseline's 52.99. For LightRAG on HotpotQA, its QA F1 is 58.49, a gap of 3.37 points. The larger gap of 8.74 points occurs for HippoRAG 2 on 2WikiMultiHopQA. Section 6.3 varies the privacy budget to examine this trade-off beyond the fixed comparison.
6.3 RQ2: Privacy–Utility Trade-off
Table 2 examines the privacy–utility trade-off for across both datasets and all three GraphRAG systems, using GPT-4o-mini as the victim generator. No-DP uses the original document; the other rows use documents sanitized by RelGuard at the indicated budget. All scores are percentages. Overall, smaller reduces connection and relation recovery, strengthening privacy protection at the cost of QA utility; larger retains more utility but permits more recovery.
For LightRAG on 2WikiMultiHopQA, decreasing from 10 to 1 and then to 0.1 reduces GRASP Conn. F1 from 88.79 to 65.45 and 59.01, and Rel. F1 from 47.26 to 28.71 and 25.41. GraphSteal shows the same trend: Conn. F1 decreases from 89.09 to 65.57 and 63.78, while Rel. F1 decreases from 46.32 to 31.42 and 27.59. QA F1 correspondingly declines from 46.73 to 45.17 and 45.06. The trade-off is also evident for PathRAG on HotpotQA: reducing from 10 to 0.1 lowers GRASP Conn. F1 from 71.45 to 57.97 and Rel. F1 from 40.25 to 30.97, while QA F1 falls from 62.58 to 58.95. The utility cost
Table 2: Relation privacy leakage and QA utility of RelGuard under different privacy budgets (GPT-4o-mini).
| Victim | Config | 2WikiMultiHopQA | HotpotQA | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| GRASP | GraphSteal | QA F1 ↑ | GRASP | GraphSteal | |||||||
| Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | ||||
| HippoRAG 2 | no-DP | 76.99 | 68.51 | 75.71 | 69.93 | 70.50 | 70.92 | 62.48 | 78.37 | 67.21 | 71.91 |
| ε = 10 | 76.39 | 20.14 | 74.47 | 29.70 | 62.99 | 55.35 | 19.31 | 71.77 | 30.99 | 67.45 | |
| ε = 5 | 69.75 | 19.61 | 69.60 | 25.81 | 61.53 | 45.03 | 13.63 | 63.42 | 23.47 | 67.25 | |
| ε = 1 | 59.39 | 18.12 | 54.08 | 21.79 | 53.40 | 44.82 | 11.37 | 62.67 | 21.71 | 64.90 | |
| ε = 0.1 | 49.73 | 11.01 | 52.22 | 14.87 | 52.75 | 43.92 | 10.09 | 59.76 | 20.58 | 63.30 | |
| LightRAG | no-DP | 89.63 | 84.26 | 89.14 | 85.54 | 49.48 | 83.78 | 75.97 | 90.31 | 80.98 | 61.47 |
| ε = 10 | 88.79 | 47.26 | 89.09 | 46.32 | 46.73 | 83.07 | 50.60 | 87.97 | 47.63 | 58.56 | |
| ε = 5 | 83.30 | 40.94 | 84.47 | 44.31 | 44.85 | 71.24 | 37.64 | 73.51 | 34.86 | 58.49 | |
| ε = 1 | 65.45 | 28.71 | 65.57 | 31.42 | 45.17 | 68.09 | 35.59 | 70.96 | 34.27 | 57.24 | |
| ε = 0.1 | 59.01 | 25.41 | 63.78 | 27.59 | 45.06 | 66.23 | 35.01 | 68.65 | 33.78 | 57.23 | |
| PathRAG | no-DP | 79.31 | 72.71 | 82.49 | 77.20 | 55.39 | 74.38 | 67.84 | 82.66 | 72.02 | 64.47 |
| ε = 10 | 78.77 | 42.65 | 81.48 | 43.84 | 54.24 | 71.45 | 40.25 | 81.05 | 45.49 | 62.58 | |
| ε = 5 | 75.93 | 37.93 | 78.86 | 42.42 | 52.40 | 68.51 | 36.21 | 74.04 | 40.65 | 60.85 | |
| ε = 1 | 56.59 | 23.16 | 64.84 | 32.50 | 47.54 | 62.69 | 35.88 | 69.17 | 40.44 | 60.49 | |
| ε = 0.1 | 58.29 | 21.30 | 62.68 | 30.92 | 46.90 | 57.97 | 30.97 | 66.26 | 39.92 | 58.95 | |
Table 3: Null-candidate ablation on 2WikiMultiHopQA with LightRAG under GRASP.
| ε | Conn. F1 ↓ | Rel. F1 ↓ | QA F1 ↑ | |||
|---|---|---|---|---|---|---|
| w/o null | w/ null | w/o null | w/ null | w/o null | w/ null | |
| 1 | 89.84 | 65.45 | 48.39 | 28.71 | 46.97 | 45.17 |
| 5 | 86.56 | 83.30 | 45.39 | 40.94 | 47.52 | 44.85 |
varies across systems; for HippoRAG 2 on 2WikiMultiHopQA, the same budget reduction lowers QA F1 from 62.99 to 52.75. These results demonstrate that adjusting ε provides control over the balance between relation privacy and answer quality.
6.4 RQ3: Sensitivity Analysis
Effect of null candidate. Table 3 compares RelGuard with a variant that excludes null from the output domain and renormalizes the replacement probabilities. We use LightRAG on 2WikiMultiHopQA under GRASP at ε ∈ {1, 5}. At ε = 1, including null reduces Conn. F1 by 24.39 percentage points and Rel. F1 by 19.68 points, with an additional QA F1 loss of 1.80 points. At ε = 5, the corresponding reductions are 3.26 and 4.45 points, with a QA F1 loss of 2.67 points. Thus, enabling deletion reduces both connection and relation recovery, with larger recovery reductions at ε = 1 but an additional utility cost at both budgets.
Number of relation candidates. Figure 3(a) varies K ∈ {5, 10, 15, 20} with LightRAG on 2WikiMultiHopQA under GRASP at ε = 5 and λ = 1. Increasing K from 5 to 20 raises QA F1 from 43.48 to 47.74, Conn. F1 from 72.00 to 85.87, and Rel. F1 from 37.24 to 43.59. QA and relation recovery increase across the tested candidate counts, whereas connection recovery peaks at 86.34 for K = 15 before decreasing slightly at K = 20. Larger pools improve QA utility overall in these runs but also allow greater relation

(a) # of relation candidates K

(b) Removal distance λ
Figure 3: Sensitivity analysis.
recovery. Changing K affects both the available replacements and null's probability through the normalizer in Eq. (12).
Edge-removal distance λ. At fixed ε > 0 and candidate pool, a smaller λ increases the null weight exp(-ελ/2) and hence the probability of relation deletion. Figure 3(b) varies λ ∈ {0.01, 0.1, 0.5, 1, 2} in the same LightRAG setting, holding ε = 5 and the default K = 10 candidate pool fixed. The horizontal axis is logarithmic. Increasing λ from 0.01 to 2 raises Conn. F1 from 51.87 to 87.79 and Rel. F1 from 20.12 to 44.15. QA F1 first increases from 46.35 to 48.93 at λ = 0.1, then decreases to 44.07 at λ = 2. Increasing λ therefore retains more perturbed relations, raising attack recovery across the tested values, while QA utility peaks at λ = 0.1. This pattern suggests that deleting a relation can be preferable to retaining an incorrect replacement, which may mislead answer generation. However, an excessively small λ may remove too many relations and reduce the evidence available for QA, also harming utility. At K = 10 and λ = 1, both sweeps share QA, Conn., and Rel. F1 scores of 44.85, 83.30, and 40.94, respectively.
7 Conclusion
We proposed RelGuard to mitigate connectivity and relation semantics leakage through GraphRAG answers. RelGuard replaces sensitive relations based on semantic distance or deletes them, then consistently updates documents before indexing for use with GraphRAG systems. RelGuard provides relation-DP guarantees over relation values, and mitigates connectivity leakage through deletion. Experiments on two datasets across three GraphRAG systems show that, compared with four existing defenses, RelGuard substantially reduces relation recovery with limited QA utility loss in most settings, while also reducing connection recovery.
References
[1] Ahmed Musa Awon, Yun Lu, Shera Potka, and Alex Thomo. 2025. CluSanT: Differentially private and semantically coherent text sanitization. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers). 3676–3693.
[2] Danushka Bollegala, Shuichi Otake, Tomoya Machide, and Ken-ichi Kawarabayashi. 2025. A metric differential privacy mechanism for sentence embeddings. ACM Transactions on Privacy and Security 28, 2 (2025), 1–34.
[3] Konstantinos Chatzikokolakis, Miguel E Andrés, Nicolás Emilio Bordenabe, and Catuscia Palamidessi. 2013. Broadening the scope of differential privacy using metrics. In international symposium on privacy enhancing technologies symposium. Springer, 82–102.
[4] Boyu Chen, Zirui Guo, Zidan Yang, Yuluo Chen, Junze Chen, Zhenghao Liu, Chuan Shi, and Cheng Yang. 2026. Pathrag: Pruning graph-based retrieval augmented generation with relational paths. In Proceedings of the AAAI conference on artificial intelligence, Vol. 40. 30183–30191.
[5] Amrita Roy Chowdhury, David Glukhov, Divyam Anshumaan, Prasad Chalasani, Nicolas Papernot, Somesh Jha, and Mihir Bellare. 2025. Preempt: Sanitizing Sensitive Prompts for LLMs. arXiv preprint arXiv:2504.05147 (2025).
[6] Stav Cohen, Ron Bitton, and Ben Nassi. 2024. Unleashing worms and extracting data: Escalating the outcome of attacks against rag-based inference in scale and severity using jailbreaking. arXiv preprint arXiv:2409.08045 (2024).
[7] Cynthia Dwork, Frank McSherry, Kobbis Nissim, and Adam Smith. 2006. Calibrating noise to sensitivity in private data analysis. In Theory of cryptography conference. Springer, 265–284.
[8] Cynthia Dwork and Aaron Roth. 2014. The algorithmic foundations of differential privacy. Foundations and trends in theoretical computer science 9, 3–4 (2014), 211–487.
[9] Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley, Alex Chao, Apurva Mody, Steven Truitt, Dasha Metropolitansky, Robert Osazwu Ness, and Jonathan Larson. 2024. From local to global: A graph rag approach to query-focused summarization. arXiv preprint arXiv:2404.16130 (2024).
[10] Natasha Fernandes, Mark Dras, and Annabelle Melver. 2019. Generalised differential privacy for text document processing. In International Conference on Principles of Security and Trust. Springer International Publishing Cham, 123–148.
[11] Oluwaseyi Feyisetan, Borja Balle, Thomas Drake, and Tom Diette. 2020. Privacy-and utility-preserving textual analysis via calibrated multivariate perturbations. In Proceedings of the 13th international conference on web search and data mining. 178–186.
[12] Kata Gábor, Haifa Zargayouna, Isabelle Tellier, Davide Buscaldi, and Thierry Charnois. 2017. Exploring vector spaces for semantic relations. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing. 1814–1823.
[13] Jinze Gu, Qinghua Mao, Xi Lin, and Jun Wu. 2026. GraphSteal: Structural Knowledge Stealing from Graph RAG via Traversal Reconstruction. arXiv preprint arXiv:2605.28645 (2026).
[14] Zirui Guo, Lianghua Xia, Yanhua Yu, Tu Ao, and Chao Huang. 2025. LightRAG: Simple and Fast Retrieval-Augmented Generation. In Findings of the Association for Computational Linguistics: EMNLP 2025. 10746–10761.
[15] Bernal J Gutiérrez, Yiheng Shu, Yu Gu, Michihiro Yasunaga, and Yu Su. 2024. HippoRAG: Neurobiologically inspired long-term memory for large language models. Advances in neural information processing systems 37 (2024), 59532–59569.
[16] Bernal Jiménez Gutiérrez, Yiheng Shu, Weijian Qi, Sizhe Zhou, and Yu Su. 2025. From rag to memory: Non-parametric continual learning for large language models. arXiv preprint arXiv:2502.14802 (2025).
[17] Xanh Ho, Anh-Khoa Duong Nguyen, Saku Sugawara, and Akiko Aizawa. 2020. Constructing a multi-hop qa dataset for comprehensive evaluation of reasoning steps. In Proceedings of the 28th International Conference on Computational Linguistics. 6609–6625.
[18] Pere-Lluis Huguet Cabot and Roberto Navigli. 2021. REBEL: Relation Extraction By End-to-end Language generation. In Findings of the Association for Computational Linguistics: EMNLP 2021. Association for Computational Linguistics, 2370–2381. doi:10.18653/v1/2021.findings-emnlp.204
[19] Changyue Jiang, Xudong Pan, Geng Hong, Chenfu Bao, and Min Yang. 2024. Rag-thief: Scalable extraction of private data from retrieval-augmented generation applications with agent-based attacks. arXiv preprint arXiv:2411.14110 4 (2024).
[20] Hao Li, Jiajun He, Guangshuo Wang, Dengguo Feng, Zheng Li, and Min Zhang. 2025. BudgetLeak: Membership Inference Attacks on RAG Systems via the Generation Budget Side Channel. arXiv preprint arXiv:2511.12043 (2025). doi:10.48550/arXiv:2511.12043
[21] Jiale Liu, Jiahao Zhang, and Suhang Wang. 2026. Exposing privacy risks in graph retrieval-augmented generation. In Findings of the Association for Computational Linguistics: ACL 2026. 18073–18093.
[22] Frank McSherry and Kunal Talwar. 2007. Mechanism design via differential privacy. In 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS'07). IEEE, 94–103.
[23] Belinda Mo, Kyssen Yu, Joshua Kazdan, Joan Cabezas, Proud Mpala, Lisa Yu, Chris Cundy, Charilooa Kanatsoulis, and Samni Koyejo. 2025. KGGen: Extracting Knowledge Graphs from Plain Text with Language Models. arXiv preprint arXiv:2502.09956 (2025). https://arxiv.org/abs/2502.09956
[24] OpenAI. 2024. GPT-4o mini: Advancing Cost-Efficient Intelligence. https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/.
[25] Boci Peng, Yun Zhu, Yongchao Liu, Xiaoho Bo, Haizhou Shi, Chuntao Hong, Yan Zhang, and Siliang Tang. 2025. Graph retrieval-augmented generation: A survey. ACM Transactions on Information Systems 44, 2 (2025), 1–52.
[26] Minkyoo Song, Jaehan Kim, Myungchul Kang, Hanna Kim, Seungwon Shin, and Sooeil Son. 2026. Graphs Don't Stay Secret: Practical Subgraph Reconstruction Attacks on Defended Graph RAG. arXiv preprint arXiv:2602.06495 (2026).
[27] Asahi Ushio, Jose Camacho-Collados, and Steven Schockaert. 2021. Distilling relation embeddings from pretrained language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. 9044–9062.
[28] Ralph Weischedel, Martha Palmer, Mitchell Marcus, Eduard Hovy, Sameer Pradhan, Lance Ramshaw, Nianwen Xue, Ann Taylor, Jeff Kaufman, Michelle Franchini, et al. 2013. OntoNotes Release 5.0. Linguistic Data Consortium, LDC2013T19. doi:10.35111/xmhb-2b84
[29] Shuhua Yang, Jiahao Zhang, Yilong Wang, Dongwon Lee, and Suhang Wang. 2026. Query-efficient agentic graph extraction attacks on graphrag systems. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 16017–16041.
[30] Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William Cohen, Ruslan Salakhutdinov, and Christopher D Manning. 2018. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 conference on empirical methods in natural language processing. 2369–2380.
[31] Junwei Yu, Yepeng Ding, Jieyu Zhou, Jiani Dai, Lingfeng Zhang, and Hiroyuki Sato. 2026. Protecting User Privacy in LLM Reasoning: A Textual Differential Privacy Framework for Context-Aware Applications. Electronics 15, 13 (2026), 2880.
[32] Shenglai Zeng, Jiankun Zhang, Pengfei He, Yue Xing, Yiding Liu, Han Xu, Jie Ren, Shuaiqiang Wang, Dawei Yin, Yi Chang, and Jiliang Tang. 2024. The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG). In Findings of the Association for Computational Linguistics: ACL 2024. Association for Computational Linguistics, 4505–4524. doi:10.18653/v1/2024.findings-acl.267
Appendix
A Differential Privacy Proof
A.1 Privacy of Relation Perturbation
PROOF OF THEOREM 4. Fix finite and . For each pair of compared inputs, use the same entity types, encoder, extended removal distance, and candidate pools with exactly real predicates, where is fixed across compared inputs. In particular, each is independent of the private predicates and gives the common support .
Utility sensitivity. For any two input relations compared under the same candidate pool , define
We show that changing the input from to changes the utility of any fixed output by at most . For a real candidate , the Euclidean triangle inequality gives
This step involves only real predicates. Interchanging and yields the reverse bound, so
For the deletion output, Eq. (11) assigns the same utility under both inputs. Hence
Consequently,
Relation privacy. Let denote the probability in Eq. (12), and write
All weights are positive and finite, so . By Eq. (14),
Summing the lower bound over the common output support gives
Combining the weight and normalizer bounds, for every we obtain
(17)
Summing this inequality over any relation-output event establishes Definition 3 for the mechanism sampling .
A.2 Privacy of Document Reconstruction
PROOF OF THEOREM 5. We first compose the single-relation guarantees, then apply the postprocessing property to document reconstruction.
Composition across relations. Fix with aligned canonical triples and . The endpoints and slot order are fixed, as in the document-level extension in Section 4.2. Let . For , write . Placing sampled relations into triples retains the fixed endpoints and slot order. Since the algorithm samples relations independently,
(18)
Summing over every in an arbitrary event proves Eq. (9). Repeated mentions reuse one canonical triple's sampled outcome and therefore introduce no additional independent releases.
Released connectivity. Keeping the endpoint pair of each non-null output triple is postprocessing, so the released connectivity view inherits the same relation-DP bound [8]. This guarantee compares relation assignments on fixed, aligned entity pairs, rather than inputs with different original edge sets.
Text reconstruction. Document reconstruction preserves the joint guarantee by postprocessing [8]. Let . For the document comparisons in Section 4.2, let be the shared masked document. Write and , and consider a text-output event . Define . The reconstruction procedure uses the sampled predicates and placeholders in , without reading original relation values. Its kernel is therefore identical for the two inputs. The joint bound in Eq. (9) gives
This proves relation-DP for the reconstructed text under the specified document comparisons.
B Prompt
Figure 4 gives the prompt for canonical relation extraction. Figure 5 generates relation candidates from an ordered entity-type pair.
C Additional Victim Model: Gemini-2.5-Flash
Table 4 examines the privacy–utility trade-off for across both datasets and all three GraphRAG systems, using Gemini-2.5-Flash as the victim generator. No-DP uses the original document; the other rows use documents sanitized by RelGuard at the indicated budget. All scores are percentages. Overall, smaller reduces connection and relation recovery at the cost of QA utility, while larger retains more utility but permits more recovery.
For LightRAG on 2WikiMultiHopQA, decreasing from 10 to 1 and then to 0.1 reduces GRASP Conn. F1 from 61.49 to 47.19 and 41.18, and Rel. F1 from 17.67 to 12.19 and 10.09. GraphSteal shows the same trend: Conn. F1 decreases from 76.11 to 70.12 and 63.55, while Rel. F1 decreases from 33.04 to 22.35 and 20.44. QA F1 correspondingly declines from 61.43 to 58.22 and 58.11. For PathRAG on HotpotQA, reducing from 10 to 0.1 lowers GRASP Conn. F1 from 72.01 to 54.12 and Rel. F1 from 28.25 to 20.06, while QA F1 falls from 66.92 to 65.27. The utility cost varies across systems and datasets: on 2WikiMultiHopQA, the same budget reduction lowers PathRAG's QA F1 from 64.34 to 51.30. Although individual scores are not uniformly monotone, the overall trend is consistent with Section 6.3: smaller privacy budgets provide stronger privacy protection with lower QA utility, and larger budgets exhibit the reverse trade-off.
D Attack Details
We use GRASP and targeted GraphSteal to evaluate the two attack objectives in Section 4.3: connectivity inference, which identifies entities directly connected to the target, and relation semantics recovery, which identifies how these entities are related to the target.
GRASP. GRASP [26] anchors retrieval on the target entity and frames extraction as a structured relation-processing task, requesting records with an instance identifier, source entity, relation predicate, and destination entity. The endpoints support inference of the target's one-hop connections, while the predicates support recovery of relation semantics. Instance identifiers associate fields within each record to reduce cross-record mixing. We preserve relation direction and restrict predictions to target-incident relations. New predictions are identified against the accumulated triples; instance identifiers are excluded from scoring.
You are a knowledge graph extraction assistant. Extract entities and explicitly stated relations from the document, with one numbered sentence per line, and locate every relation occurrence.
- Entities
- Include only entities belonging to this inventory: PERSON, NORP, FAC, ORG, GPE, LOC, PRODUCT, EVENT, WORK_OF_ART, LAW, LANGUAGE.
- Assign one canonical name per entity; resolve clear pronouns, aliases, and abbreviations. Exclude dates, quantities, titles, professions, abstract concepts, and biological taxa.
- Return canonical names only, without type labels. Entity types are assigned separately from canonical names and the fixed inventory, without source sentences or extracted predicates.
- Relations
- Extract directed (subject, relation, object) triples only when both endpoints are listed entities.
- Use specific lower-case snake_case predicates, such as works_for or founded. Merge equivalent expressions and output each distinct triple once; retain different relations for the same entity pair.
- Do not infer relations from external knowledge, commonsense, negation, hypotheticals, or speculation.
- Occurrences
- For every occurrence, return the printed sentence number and the shortest exact substring expressing the relation, usually a verb phrase. Each numbered line contains exactly one sentence.
- Copy the substring character for character. Exclude entity names, dates, and unrelated modifiers; do not return a bare preposition or copula. Skip occurrences without an explicit relation-bearing span.
- Report all occurrences of each triple. Do not report character offsets.
Return only JSON. Triple endpoints must match canonical entity names. {"entities": ["<entity_name>"], "triples": ["<subject": "<subject_entity>, "relation": "<canonical_relation>," "object": "<object_entity>, "occurrences": ["<sentence": "<sentence_number>, "predicate": "<exact substring>"]]} Document: {ruled}
Figure 4: Prompt for entity and relation extraction.
You are a semantic relation calibration assistant. Given only an ordered entity-type pair and a candidate count K, generate relations from the subject type to the object type. Use no documents, entity identities, or private relation values.
Each candidate must satisfy all three conditions:
- Type compatibility: The relation must be meaningful for both types in the specified direction. For (ORG, PERSON), employs is valid; works_for has the wrong direction.
- Non-containment: No candidate may imply another in the pool. For example, do not include both spouse_of and family_member_of; retain the more specific predicate. Check every candidate pair.
- Semantic diversity: Cover distinct kinds of relationships. Merge synonyms and expressions differing only in tense, voice, or wording. Prefer candidates that convey different information and, where appropriate, are mutually exclusive.
Use concise lower-case snake_case predicates. Avoid vague predicates such as related_to, associated_with, connected_to, involves, part_of, and is_a. Do not name specific entities. Return exactly {K} distinct candidates satisfying all three conditions.
Input: Subject Type: {subject_type} Object Type: {object_type} Candidate Count: {K} Return only JSON: {"relation_pool": ["<relation_1>","<relation_2>","..."]}
Figure 5: Prompt for type-conditioned candidate generation.
Targeted GraphSteal. Targeted GraphSteal [13] starts with a known target entity and uses entities and relations discovered in previous answers to guide subsequent queries, progressively
recovering the target's local relations. Its outputs include both neighboring entities and relation descriptions: the former support connectivity inference, while the latter support recovery of relation
Table 4: Privacy-utility trade-off of RelGuard with Gemini-2.5-Flash.
| Victim | Config | 2WikiMultiHopQA | HotpotQA | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| GRASP | GraphSteal | QA F1 ↑ | GRASP | GraphSteal | QA F1 ↑ | ||||||
| Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | Conn. F1 ↓ | Rel. F1 ↓ | ||||
| HippoRAG 2 | no-DP | 76.83 | 71.50 | 85.43 | 77.71 | 65.10 | 75.95 | 68.51 | 72.72 | 61.95 | 75.62 |
| ε = 10 | 76.61 | 18.52 | 75.89 | 19.73 | 57.53 | 70.71 | 23.47 | 71.23 | 28.11 | 70.03 | |
| ε = 5 | 74.59 | 13.21 | 73.80 | 16.74 | 55.31 | 66.13 | 16.95 | 63.19 | 19.68 | 64.06 | |
| ε = 1 | 55.43 | 11.53 | 56.50 | 14.98 | 53.62 | 61.34 | 16.71 | 61.54 | 18.87 | 66.63 | |
| ε = 0.1 | 55.14 | 10.14 | 55.66 | 14.31 | 53.01 | 56.40 | 13.69 | 60.69 | 17.18 | 66.27 | |
| LightRAG | no-DP | 66.18 | 59.19 | 79.13 | 74.23 | 62.48 | 75.19 | 69.55 | 80.11 | 66.81 | 70.19 |
| ε = 10 | 61.49 | 17.67 | 76.11 | 33.04 | 61.43 | 64.00 | 26.22 | 77.53 | 44.50 | 68.83 | |
| ε = 5 | 57.11 | 13.55 | 74.99 | 28.83 | 58.89 | 62.77 | 26.05 | 77.37 | 41.47 | 65.60 | |
| ε = 1 | 47.19 | 12.19 | 70.12 | 22.35 | 58.22 | 61.92 | 22.27 | 75.99 | 35.74 | 65.48 | |
| ε = 0.1 | 41.18 | 10.09 | 63.55 | 20.44 | 58.11 | 60.56 | 21.04 | 74.16 | 30.74 | 64.96 | |
| PathRAG | no-DP | 73.50 | 67.44 | 71.41 | 58.77 | 67.03 | 74.50 | 64.48 | 69.97 | 54.59 | 68.87 |
| ε = 10 | 72.89 | 19.16 | 71.93 | 36.91 | 64.34 | 72.01 | 28.25 | 68.64 | 36.47 | 66.92 | |
| ε = 5 | 68.79 | 12.80 | 63.97 | 32.53 | 61.57 | 67.48 | 26.46 | 65.46 | 36.12 | 66.01 | |
| ε = 1 | 52.51 | 12.14 | 54.81 | 28.03 | 54.23 | 61.99 | 20.66 | 57.39 | 32.76 | 65.36 | |
| ε = 0.1 | 52.17 | 7.10 | 50.84 | 22.30 | 51.30 | 54.12 | 20.06 | 50.63 | 32.08 | 65.27 | |
semantics. We parse answers into directed subject-predicate-object triples, retain target-incident predictions, and merge repeated results across turns before computing Conn. and Rel. scores.
E Privacy Metric Details
Connection Recovery (Conn.) checks whether the attacker identifies the correct directed entity pair, regardless of the predicted predicate. Entity aliases are mapped to canonical names before comparison. Relation Recovery (Rel.) additionally checks whether the predicted predicate captures the true relation's meaning. GPT-4o-mini accepts semantically matching predicates or broader predictions entailed by the true relation. For example, if Alice is Bob's spouse, predicting that Alice is Bob's family member counts as relation recovery; predicting a spouse relation from a true family-member relation does not. Predictions without predicates are evaluated only for connection recovery.
Precision measures the fraction of predictions that are correct; recall measures the fraction of true items recovered. For target , let and denote the true and predicted triple sets. For relation recovery, we use these triples directly: . For connection recovery, we discard predicates and keep distinct directed pairs: . Predictions are transformed in the same way. For , let be the number of correct matches under the corresponding rule. We compute
All evaluated targets have nonempty true sets. Empty predictions receive zero precision and recall.
We average target-level precision and recall over the target set . For connection recovery,
For relation recovery,
Conn. F1 and Rel. F1 are the harmonic means of their respective averaged precision and recall, computed as for .
F Defense Baseline Details
Abstractive. Abstractive [21] instructs the generator to select query-relevant evidence and express it concisely in its own words. We use the system-prompt implementation evaluated by Song et al. [26]. The instruction supplements the base prompt and returns NO_RELEVANT_CONTENT when the context is irrelevant.
ID Alignment. ID Alignment [26] assigns the same displayed identifier (e.g., 1) to every retrieved relation record before passing the context to the generator. Endpoints, relation descriptions, and row order are preserved. Collapsing identifiers removes the record-level distinction used by structured extraction and can induce cross-record mixing. The transformation applies during context serialization, leaving the stored graph unchanged.
Decoy. Decoy [26] adds misleading src_entity and dst_entity columns to retrieved relation records while retaining the true src and dst fields. The added values differ from the true endpoints. A system instruction identifies the added fields as internal metadata to ignore in answers. This presentation can steer extraction toward incorrect endpoint assignments while preserving the true evidence for QA. Decoy is evaluated separately from ID Alignment.
Protective Prompt. Protective Prompt implements the Protective System Prompt mitigation in GraphSteal [13]. It prepends a protective instruction to the generator's system prompt, directing the LLM not to disclose content retrieved from the knowledge base. The source corpus, stored graph, and retrieved evidence remain unchanged. The instruction applies when answering both benign and attack queries; attack predictions are extracted from the resulting answers.