acceptodds
Under review as a conference paper at ICLR 2027

TASK: Task‑Aware, Security‑Iterative Prompt Sanitization Framework

Abstract

Cloud-based large language models enable users to complete complex document-processing tasks without local deployment. However, prompts must leave the local environment during transmission to the cloud, creating substantial privacy risks. Existing prompt-sanitization methods commonly address this problem through substitution, obfuscation, or LLM-based rewriting. Such methods may excessively replace sensitive content or rely on rewriting criteria that do not align with the requirements of the current task, resulting in the loss of task-required information and substantially degrading model output quality. To address this problem, we make two key observations: spans of the same sensitive type can play different semantic roles across tasks, and residual risk after initial sanitization is typically concentrated in a small number of retained or weakly transformed spans and their associated evidence. Building on these observations, we propose TASK, a task-aware iterative prompt sanitization framework for cloud-based LLM inference. TASK jointly analyzes the semantic relevance of sensitive spans to the task and their local context to identify information that genuinely supports task completion. It then selects multi-level transformations, including retention, abstraction, generalization, and masking. To further reduce residual risk, TASK evaluates initially sanitized prompts using sensitive-value recovery and attribute-inference attacks, and iteratively adjusts high-risk decisions until the result satisfies the required privacy level. We evaluate TASK on document summarization, narrative question answering, and long-context question answering. The results show that TASK improves task quality and privacy scores by 23.72% and 8.64% on average, respectively.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
Large Language Models, Prompt Privacy, Task Awareness

Reviews

Among:
Shape:
1234this paper, Bottom 10%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.67 over 3 reviews, above 10% of the others.
Reviewer_RdKpOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper proposes TASK, a prompt-sanitization framework for cloud LLM inference. It detects sensitive spans with lexicons and patterns. It scores each span’s task relevance using BGE embeddings, with a local LLM adjudicating borderline cases. Each span is then assigned a sanitization level from L0 (keep) to L4 (delete). An iterative refinement loop runs recovery and attribute-inference attacks and tightens the spans with the best risk-reduction-to-utility-loss ratio until a privacy threshold τ=0.90 is met. Experiments on NarrativeQA, InfiniteBench, and CNN/DailyMail report average gains of 23.72% in quality and 8.64% in privacy over three baselines.

Critical strengths

The paper observes that spans of the same sensitive type can play different roles depending on the task. It turns this into a concrete procedure: task-conditioned level assignment, followed by attack-guided tightening that selects actions by risk reduction per unit of task loss. This is a practical and interpretable design. Explicitly separating utility preservation from residual-risk mitigation is a reasonable way to organize the privacy–utility trade-off.

Critical weaknesses
  1. Table 4 is described as a disjoint development set, yet its τ=0.90 row is identical to the main test results in Table 5 for all eight Q/S values. Table 2’s GLM-4-9B results, which use the default model, report Q=0.8916, while Tables 1 and 5 report 0.9457 for the same setting. The per-domain Q values differ by 0.03–0.07, but the S values match exactly. The ablation reports yet another TASK result (Q=0.9080, S=0.9244). The release threshold and the evaluation metric also share the same formula. In addition, the paper does not say whether prompts routed to human review are excluded from the reported results. Together, these issues undermine trust in the headline numbers.

  2. Text Redaction is a 2023 Azure NER service. Prompt Obfuscation targets system-prompt protection so it is a mismatched baseline. Only IntentAnony is recent and relevant. Closely related methods that the paper cites, including PAPILLON, IncogniText, Yang et al. (2025), and Hou et al. (2025), are not compared.

Questions for authors

Why does GLM-4-9B quality in Table 2 (0.8916) differ from Table 1 (0.9457) when it is the same configuration? Why are the τ=0.90 results on the “disjoint” development set (Table 4) identical to the test results (Table 5)?

4 comments

Response to the Reviewer

Thank you for the reviewer’s questions. Our response is as follows:

1. Correction of Results

The relevant results in the paper have been corrected. The final result should be 0.9457.

2. Additional Baselines and Evaluation Metrics

We have further added two relevant baseline methods:

  • Truthful Text Sanitization Guided by Inference Attacks;
  • Adaptive Text Anonymization: Learning Privacy–Utility Trade-offs via Prompt Optimization.

At the same time, we added Recall and F1 as two additional evaluation metrics. The overall experimental results show that TASK improves Recall by 19.04% and F1 by 26.68%.

Specifically:

  • Compared with the method of Pilán et al., TASK improves the quality score by 6.25%, the security score by 13.17%, Recall by 9.73%, and F1 by 16.80%;

  • Compared with the method of Loiseau et al., TASK improves the quality score by 0.67%, the security score by 11.08%, Recall by 2.77%, and F1 by 5.63%.

These results show that, after introducing more representative privacy–utility trade-off baselines, TASK still achieves stable advantages in task quality, security, and answer information preservation.

Thank you for the response. Three key concerns remain unaddressed:

Dev/test overlap. The τ=0.90 results on the “disjoint” development set (Table 4) are identical to the test results (Table 5) for all eight values. Do the two splits overlap, and on which split was τ selected?

Source of inconsistent results. Where does 0.8916 in Table 2 come from, and why does per-domain Q differ while S is identical? Also, which configuration gives the ablation result? Please state which run the reported numbers come from.

Threshold–metric circularity. The release threshold and the evaluation metric share the same formula. How do you rule out that TASK simply optimizes the metric it is evaluated on? Results on an independent privacy measure would help.

Thank you for the reviewer’s questions. TASK uses the same definition for its release criterion and its reported privacy score so that release decisions reflect the privacy risks being evaluated. Specifically, TASK applies sensitive information recovery and attribute inference attacks to the sanitized text and computes the privacy score SS from the attack outcomes. The threshold τ\tau determines whether an individual sample meets the release criterion, while the mean SS reported in the table compares the overall performance of the methods under the same attack protocol. We therefore frame the reported privacy improvement as follows. Under the attack settings evaluated in this work, TASK reduces residual leakage risk relative to the relevant baselines. The accompanying QQ, Recaall, and F1 scores show the downstream task utility associated with these privacy gains.

Thank you for the response. The dev/test split question remains unaddressed, and it is central to interpreting the main results. I will keep my score.

Reviewer_TESqOpenReview ↗
Rating
1
Confidence
3
Informativeness
2
Presentation
3
Soundness
1
Read review
Paper summary

This paper presents a prompt sanitization framework for cloud-based LLM inference. The major idea is to evaluate the semantic relevance and privacy risk of candidate sensitive spans. An iterative process of empirical security assessment is applied to further mitigate residual disclosure in the sanitized prompts. The method is evaluated on the NarrativeQA, InfiniteBench, and CNN/DailyMail datasets.

Critical strengths
  1. Preserving privacy in prompts during untrusted inference is an important problem.

  2. The method is evaluated on datasets spanning narrative question answering, long-context question answering, and document summarization.

Critical weaknesses
  1. The metrics lack justification. The paper does not compare the proposed method with baselines using widely adopted metrics. Instead, two hand-crafted metrics are adopted. However, it is unclear why the privacy score can reliably distinguish successful secret recovery from semantically similar but incorrect guesses. In addition, since privacy is measured using an attack-based formulation, the lack of a formal threat model also weakens the validity of the measurement. The paper claims average improvements of 23.73% in task quality and 8.64% in security, but without proper justification of the metrics, we do not know what these numbers mean.

  2. An evaluation of the cost is missing. Intuitively, such an iterative process for sanitization could be very costly.

  3. The experimental analysis is superficial. Only a description of the results is provided, with no in-depth analysis.

Questions for authors

Please see the weaknesses.

2 comments

Response to the Reviewer

Thank you for the reviewer’s questions. Our response is as follows:

1. Metrics

In TASK, Q and S are comprehensive metrics used to uniformly measure task quality and residual privacy risk.

The privacy score S does not determine whether an attack is successful solely based on semantic similarity. Instead, it jointly considers normalized matching of sensitive values, token and character overlap, similarity, and other factors. The quality score Q jointly considers token overlap and the degree of task-semantic completion.

To address the reviewer’s concerns, we additionally introduced Recall and F1. Recall improved by 19.04%, and F1 improved by 26.68%.

2. Computational Cost

Regarding computational cost, we further conducted an end-to-end latency evaluation. Under the same hardware, model, and experimental settings, TASK has an average runtime of approximately 45 seconds, which is overall 30%–80% faster than the other baseline methods. This result shows that although TASK introduces task-semantic analysis and security refinement, it effectively controls the additional computational overhead through local sensitive-span processing, risk-priority selection, and early stopping.

3. Additional Baselines

We have further added two relevant baselines: Truthful Text Sanitization Guided by Inference Attacks and Adaptive Text Anonymization: Learning Privacy–Utility Trade-offs via Prompt Optimization.

Specifically:

  • Compared with the method of Pilán et al., TASK improves the quality score by 6.25%, the security score by 13.17%, Recall by 9.73%, and F1 by 16.80%.

  • Compared with the method of Loiseau et al., TASK improves the quality score by 0.67%, the security score by 11.08%, Recall by 2.77%, and F1 by 5.63%.

These results show that TASK not only reduces residual privacy leakage in terms of security, but also better preserves task-relevant information, demonstrating a more stable quality–security trade-off.

Thank you for the additional experiments. The added baselines and latency results are useful, but my main concern remains unresolved: explaining the components of S does not establish that it reliably distinguishes successful secret recovery from semantically similar but incorrect guesses. The threat model also remains unclear. Therefore, the claimed security improvements remain insufficiently supported, and I maintain score.

Reviewer_8zU6OpenReview ↗
Rating
2
Confidence
4
Informativeness
1
Presentation
3
Soundness
1
Read review
Paper summary

This paper presents TASK, a task-aware iterative prompt sanitization framework that aims to protect sensitive information in prompts sent to cloud-based LLMs while preserving downstream task utility.

TASK first identifies candidate sensitive spans and evaluates their task relevance using three semantic signals: (1) the relevance of each sensitive span to the task description, (2) the relevance of the original context to the task, and (3) the change in task relevance after masking the span. Based on these signals, TASK selects one of five information-preservation levels for each span to construct an initial sanitized prompt. It then uses an iterative, attack-informed process to assess residual privacy risks and refine the sanitization accordingly.

The method is evaluated against three baselines: text redaction, IntentAnony, and prompt obfuscation. The evaluation uses privacy and task quality scores, with smaller open-weight models consistent with the on-device deployment scenario. TASK consistently improves task quality over all three baselines and achieves better privacy scores than text redaction and IntentAnony, but not prompt obfuscation.

Critical strengths
  • Joint consideration of privacy and task utility. TASK explicitly accounts for the relevance of sensitive information to downstream tasks, aiming to preserve useful information while reducing privacy leakage.
  • Iterative, attack-informed sanitization. Unlike conventional approaches that sanitize statically identified sensitive spans, TASK evaluates residual privacy risks and iteratively refines the sanitized prompt.
  • Evaluation of inference risks. The evaluation considers whether protected attributes can be inferred from sanitized prompts, rather than focusing solely on verbatim disclosure. This is a good evaluation practice.
Critical weaknesses
  • Limited methodological novelty. The proposed approach appears incremental in light of existing research on privacy-preserving prompt sanitization and data minimization. Several prior works have explored similar ideas, including task-relevance-aware sanitization, iterative attack-informed refinement, and evaluations of sensitive-attribute inference risks.
  • Incomplete coverage of related work. The paper overlooks several relevant studies that should be acknowledged and discussed, including the works listed below.
  • Unrepresentative baseline selection. None of the three selected baselines explicitly accounts for task relevance when optimizing sanitization. Existing methods that consider downstream utility and privacy-utility trade-offs are omitted. Consequently, the baseline comparisons do not adequately reflect the state of the art, making the reported improvements less informative about TASK's novel contributions.

Relevant prior work:

  1. Staab, R., Vero, M., Balunović, M., & Vechev, M. (2025). Language Models are Advanced Anonymizers. ICLR.
  2. Pilán, I., Manzanares-Salor, B., Sánchez, D., & Lison, P. (2025). Truthful Text Sanitization Guided by Inference Attacks. Applied Soft Computing, 185(B), Article 114013.
  3. Ma, H., Lu, W., Liang, Y., Wang, T., Zhang, Q., Zhu, Y., & Si, J. (2025). ALSA: Context-Sensitive Prompt Privacy Preservation in Large Language Models. Proceedings of KDD, Vol. 2, 2042–2053.
  4. Zhou, J., Mireshghallah, N., & Li, T. (2026). Operationalizing Data Minimization for Privacy-Preserving LLM Prompting. ICLR.
  5. Loiseau, G., Sileo, D., Riquet, D., Meyer, M., & Tommasi, M. (2026). Adaptive Text Anonymization: Learning Privacy-Utility Trade-offs via Prompt Optimization. Findings of ACL 2026, 8207–8229.
Questions for authors
  1. How does TASK differ from the relevant prior work listed above, particularly regarding task-relevance-aware sanitization, iterative attack-informed refinement, and inference-risk evaluation?
  2. Can the authors expand the baseline comparisons to include existing methods that explicitly optimize privacy-utility trade-offs or account for downstream task relevance? This would help clarify TASK's contributions relative to the state of the art.
1 comment

Response to the Reviewer

Thank you for the reviewer’s questions. Our response is as follows.

1. Differences between TASK and Related Methods

Quality

Existing methods usually make decisions based on contextual importance or a global Prompt strategy. However, sensitive information of the same type may play different roles in different tasks. TASK explicitly estimates the semantic contribution of each sensitive span to the current task and the information loss caused by removing it, and accordingly selects among multiple decision options.

Security

Methods such as ALSA evaluate sanitization strategies through various scores. However, a low risk score does not necessarily mean that an attacker cannot recover the original sensitive information, especially when multiple spans jointly form cross-sentence inference cues. TASK effectively addresses this issue.

Staab et al. have shown that feedback from an attack model can improve anonymization, and Pilán et al. also use an attack model to select safer replacement candidates. The difference is that TASK uses attack results for span-level local refinement, complementing its quality-oriented processing.

Other Differences

Zhou et al. search globally for the least-disclosing Prompt that satisfies task-utility constraints. TASK is complementary to this approach: Zhou et al. focus on how to find an overall Prompt that has low disclosure while remaining usable, whereas TASK further analyzes which specific sensitive span plays what task-related role and whether it can be recovered by an attacker.

Loiseau et al. learn task-level anonymization strategies through prompt optimization, which requires additional evaluation budgets. TASK makes online decisions for sensitive spans and their contexts in the current instance and performs local adjustments.

2. Additional Baselines and Experimental Results

We have conducted additional experiments based on the publicly available code of the relevant methods. Under the same datasets, models, and evaluation settings, compared with Truthful Text Sanitization Guided by Inference Attacks, TASK improves the quality score by 6.25% and the security score by 13.17%. Compared with Adaptive Text Anonymization: Learning Privacy–Utility Trade-offs via Prompt Optimization, TASK improves the quality score by 0.67% and the security score by 11.08%.

In addition, we introduced Recall and F1 as two additional metrics to measure the preservation of information from the original task answer after prompt sanitization. Compared with Truthful Text Sanitization Guided by Inference Attacks, TASK improves Recall and F1 by 9.73% and 16.80%, respectively. Compared with Adaptive Text Anonymization: Learning Privacy–Utility Trade-offs via Prompt Optimization, TASK improves Recall and F1 by 2.77% and 5.63%, respectively.

These results show that TASK not only reduces residual privacy leakage in terms of security, but also preserves task-relevant information more effectively, demonstrating a more stable quality–security trade-off.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.