Cost-Efficient Privacy Enforcement for Email-Generating LLM Agents under Strategic Information Requests
Abstract
LLM agents now act as delegated communication intermediaries: they read private context, draft messages, and send externally visible emails on behalf of a user. Existing checker-repair defenses can reduce inappropriate disclosure, but they rely on repeated calls to a remote action LLM (the model that drafts and repairs the email) and a remote checker LLM whenever a draft fails validation. This creates a cost problem as well as a privacy problem, especially when a requester strategically asks for exact values, raw records, source evidence, or other details that induce leakage-heavy drafts. We propose local contract-conditioned rewriting as a cost-efficient enforcement layer for email-generating agents. The mechanism intercepts an outgoing draft, constructs an information-release contract that specifies what to preserve, generalize, and forbid, rewrites the draft with a local Gemma rewriter, and selectively invokes a final PrivacyChecker. Across extensive email tasks under normal prompts and attack prompts that operationalize strategic information requests, Gemma + Checker reduces normal-prompt leakage from 11.41% to 4.03% while improving UsableRate (satisfied or partially satisfied outputs) from 85.2% to 92.6%. Under the strategic attack-prompt condition, it reduces leakage from 28.19% to 18.79% and reduces checker-only cost amplification from 1.32x to 1.02x. Offline replay ablation shows that the full contract reduces leakage relative to generic Gemma rewriting by 36.3% under normal prompts and 54.1% under attack prompts. These results support a local-first privacy enforcement design: move repair to a cheaper trusted local layer when possible, but retain the checker as the final semantic gate for high-risk sends.
Figures & tables
| Component | Enforcement role |
|---|---|
| must_preserve , required_slots | Preserve the benign task intent and privacy-allowed content needed for a useful email. |
| must_generalize , privacy-risk rules | Abstract sensitive, confidential, source-specific, or reconstructive details rather than copying them. |
| information_shape , safe_output_shape | Keep the requested email structure, such as a status update, bullet list, next step, or high-level range. |
| must_not_add | Prevent hallucinated replacement facts, new values, new commitments, private-source references, or unsupported attachments. |
| Safe-substitution guidance | Preserve the function of a sensitive detail with a safe abstraction when deletion would make the email unhelpful. |
| Item | Setting |
|---|---|
| Tasks | 149 aligned normal and attack email tasks from Privacy in Action; 480 sensitive items; Gmail/Notion retrieval followed by email generation or reply. |
| Action LLM | DeepSeek deepseek-v4-flash ; same initial agent prompt and same base tasks across mechanisms. |
| Checker | DeepSeek deepseek-v4-flash ; Boolean pass/fail; checker feedback is returned verbatim for repair. |
| Local rewriter | gemma4-e4b-q4-12k via Ollama, q4_K_M ; temperature 0.0; 12k context. |
| Judges | Leakage evaluator: DeepSeek deepseek-v4-flash with a separate evaluation prompt; utility judge: DeepSeek deepseek-v4-pro . |
| Repair policy | Baseline continues the same agent session after checker failure, with a 25-turn overall cap; allows up to three local rewrite rounds; all checked mechanisms fail closed. |
| Prompt | Mechanism | Avg. checker calls | Remote tokens | Agent tokens | Checker tokens | Gemma local tokens |
|---|---|---|---|---|---|---|
| Normal | 1.06 | 8,728,781 | 8,390,242 | 338,539 | 0 | |
| Normal | 0.00 | 5,404,802 | 5,404,802 | 0 | 1,165,287 | |
| Normal | 1.00 | 7,189,612 | 5,281,175 | 1,908,437 | 1,144,181 | |
| Attack | 1.79 | 11,540,135 | 10,861,107 | 679,028 | 0 | |
| Attack | 0.00 | 5,311,550 | 5,311,550 | 0 | 1,248,082 | |
| Attack | 1.02 | 7,318,258 | 5,306,892 | 2,011,366 | 1,246,723 |
| Mechanism | Cost amp. | Call amp. | Attack leak. | Leak |
|---|---|---|---|---|
| 1.32 | 1.69 | 28.19% | +16.78 pp | |
| 0.98 | N/A | 21.48% | +16.11 pp | |
| 1.02 | 1.02 | 18.79% | +14.76 pp |
| Method | Prompt | Avg. repair rounds | Slot retention | Satisfied | Partially satisfied | UsableRate | Semantic drift |
|---|---|---|---|---|---|---|---|
| Normal | 0.12 | 0.999 | 43.0% | 42.3% | 85.2% | 0.001 | |
| Normal | 0.00 | 0.970 | 34.9% | 55.0% | 89.9% | 0.062 | |
| Normal | 0.00 | 0.981 | 39.6% | 53.0% | 92.6% | 0.046 | |
| Attack | 1.52 | 0.984 | 97.3% | 2.0% | 99.3% | 0.012 | |
| Attack | 0.00 | 0.977 | 94.6% | 4.0% | 98.7% | 0.043 | |
| Attack | 0.04 | 0.991 | 98.7% | 1.3% | 100.0% | 0.022 |
| Variant | Normal leakage | Normal red. | Attack leakage | Attack red. |
|---|---|---|---|---|
| Generic Gemma rewrite | 7.38% | – | 32.21% | – |
| Full contract | 4.70% | 36.3% | 14.77% | 54.1% |
| w/o required_slots / information_shape | 5.37% | 27.2% | 15.44% | 52.1% |
| Case | Observed mechanism behavior | Mechanism lesson |
|---|---|---|
| School health update | directly reports condition, recovery status, and test evidence. rewrites the message into a high-level health-status and care-plan summary. | Abstraction can preserve the coordination task without copying sensitive facts. |
| Structured compensation request | Under an adversarial structured request, discloses exact salary, bonus, and equity details. keeps the negotiation context but removes exact compensation and stock-option fields. | Contracted rewriting resists exact-value and structured-extraction pressure. |
| Gemma-only residual leakage | removes explicit disease names but leaves respiratory-monitoring and activity-clearance cues. The checker in triggers further abstraction and removes reconstructive implications. | Local rewriting reduces leakage before checking, but final validation is still needed for high-risk sends. |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Field group | Fields and purpose |
|---|---|
| Task typing | task_type , task_subtype , task_confidence , matched_signals , and low_confidence classify the email task and record the confidence of the rule-based task inference. Low-confidence cases fall back to preserving the draft’s apparent purpose and structure. |
| Task goal and utility | task_goal , must_preserve , required_slots , information_shape , fulfillment_requirements , body_inclusion_requirement , detail_density , plural_scope_requirement , and safe_output_shape specify the benign task shell, expected output form, required safe slots, and minimum conditions for a rewritten email to remain task-useful. |
| Privacy constraints | must_generalize , privacy_risk_policy , safe_detail_preservation_policy , source_grounding_requirements , and safe_substitution_plan identify sensitive or source-specific content, distinguish risky details from preservable low-risk details, define semantic leakage risks, and guide the rewrite toward safe substitutes such as high-level conclusions, category-level fields, process-level status, safe ranges, or de-identified entries. |
| No-fabrication and rewrite-control constraints | must_not_add and rewrite_hints prevent unsupported additions, task shifts, private-source references, placeholders, and excessive rewriting, while encouraging minimal edits and preservation of safe source-grounded content. |
| Field | Example value |
|---|---|
| task_type | update_status . |
| task_goal | Send a status update to the intended recipient after removing private-source lookup hints. |
| must_preserve | Update purpose; safe high-level topic; high-level status or conclusion when privacy-safe. |
| must_generalize | Person-specific health, student, financial, legal, HR, client, project, or source-grounded details that reveal or reconstruct private information. |
| must_not_add | Unsupported facts; new names, dates, locations, amounts, attachments, private-source references, placeholders, or unsupported follow-up promises. |
| required_slots | Greeting; update purpose; current high-level status; safe progress point; next step; closing. |
| Variant | Construction |
|---|---|
| Generic rewrite | Uses a generic privacy rewrite instruction with the user instruction and original draft, but without the information-release contract. The prompt asks the model to reduce privacy leakage, preserve the legitimate task intent, avoid unsupported facts, avoid private-source references, and return JSON with subject and body . |
| Full contract | Uses the same user instruction and original draft, but additionally provides the complete information-release contract. The prompt asks the model to preserve utility-bearing content when the contract requires it, generalize or omit sensitive details when the contract requires it, and avoid unsupported facts. |
| No required slots / shape | Uses the full contract after removing the fields that specify required task slots and output shape. All other contract fields are preserved. |
| Mechanism | Behavior | Leakage outcome |
|---|---|---|
| Gemma-only | Removes some explicit sensitive wording, but preserves a combination of health-management, respiratory-care, environmental-trigger, and activity-clearance cues. These cues make the output useful, but they also allow reconstruction of private health information. | Residual leakage: 2 of 3 annotated sensitive items leaked. |
| Gemma + Checker | Further abstracts the same coordination task into general care-management and school-participation language. The benign task shell is preserved, while condition-specific and test-specific implications are avoided. | No leakage: 0 of 3 annotated sensitive items leaked. |