When safety checks become a privacy risk: a privacy-preserving paradigm for LLM agent safety auditingWhen Safety Checks Become Privacy Risks: A Privacy-Preserving Paradigm for LLM Agent Safety Auditing
The authors propose a privacy-preserving safety audit paradigm and instantiate it as SealCall: using CKKS homomorphic encryption to outsource the audit computation of LLM agent tool calls to a semi-honest auditor, with an average F1 of 0.840 on 1,252 public candidates.
The audit service provider is semi-honest: it follows the protocol but attempts to infer private content from observations, holds the public key and evaluation keys, and does not hold the decryption key or the tool release authority; there is also a passive observer attempting to recover the audit rules from the encrypted reference database. The main goal is input confidentiality: protecting the user task, call parameters, history and their numeric representations while allowing external audit computation.
- Tool calls by LLM agents require a pre-execution safety audit, but sending the task description, call parameters and interaction history to an external audit service exposes user privacy, which the authors call privacy exposure introduced by auditing.
- The authors propose a three-domain audit model: a trusted controller compresses context locally, constructs and encrypts the audit representation; the audit service computes similarity to unsafe reference samples using CKKS homomorphic encryption; the controller decrypts, takes the maximum, decides by threshold, and binds the release. Instantiated as the SealCall framework.
- On ToolSafe's 1,252 binary candidates, SealCall achieves an average F1 of 0.840 (B_F1 strategy), lower than LR with the same input at 0.913; on 760 records encrypted and plaintext decisions are all consistent; the representative configuration takes 0.176 s per encrypted scoring; in the authorization-change construction diagnostic all methods fail entirely.
- The authors state that the current representation and scorer cannot reliably distinguish changes in authorization relationships; future work will develop representations sensitive to authorization changes, optimize encrypted computation, and extend integration with agent runtimes such as Codex and OpenCode. Detection evaluation is based on public fixed candidates; task completion rate and real-time attack success rate require interactive evaluation.
- Evaluated models
- SealCall
- Benchmarks
- ToolSafe step annotations(源自 AgentHarm 与 AgentDojo 轨迹)
- Metrics
- F1RecallFPRAUROC加密评分耗时响应大小
Researchers proposed a privacy-preserving paradigm for LLM agent safety auditing, separating delegated audit computation from plaintext access and execution permissions, and implemented it as the SealCall framework. The paradigm uses CKKS-based encrypted similarity computation to protect audit inputs so that they are not obtained by a semi-honest auditor. On 1,252 public binary classification candidates, SealCall achieved an average F1 of 0.840 in grouped nested evaluation, and a representative configuration took 0.176 seconds for a single encrypted scoring.
Paper analysis
What problem does this paper attempt to solve?
When outsourcing pre-execution safety auditing of LLM agent tool calls to a professional service, how can the audit interface avoid leaking user privacy?
Core problem: pre-execution safety auditing of LLM agents requires the user task, call parameters, and interaction history; sending these in plaintext to an external audit service causes what the authors call "audit-induced privacy exposure."
- Scenario and motivation: LLM agents access email, calendars, files, and online services through tool calls; planning errors or prompt injection in external content may cause them to act beyond their authority, so auditing before execution is needed. Professional audit services can continuously maintain detection capability, but auditing requires inspecting private context.
- Shortcomings of existing methods: The authors state that tool names or isolated parameters are insufficient to judge risk; context compression and text embeddings can construct numeric representations, but embeddings may still leak the original content (citing embedding inversion work), and encryption cannot recover risk information already lost in the representation, so representation construction and encrypted computation must be designed jointly.
- Core observation: The authors' central design principle is to separate the delegation of audit computation from plaintext access and execution authority: the trusted controller holds the plaintext and keys, and the audit service computes only on ciphertext.
- What the paper proposes: A privacy-preserving safety audit paradigm (three-domain audit model + three processing layers), instantiated as the SealCall framework, combining a learned audit representation, CKKS-based encrypted similarity computation, and execution control bound to the audited call.
- Threat model (Section 2.1):
- Attacker goals: the audit service provider attempts to infer private content from observations; a separate passive observer attempts to recover audit rules from the encrypted reference database.
- Knowledge and capabilities: the auditor is semi-honest, follows the protocol but is curious, holds the public key and evaluation keys, and can compute on encrypted inputs and return encrypted results.
- Victim system: users/deployers running LLM agents and using an external audit service.
- Protection goals: mainly input confidentiality (user task, call parameters, history, and their numeric representations); reference-library confidentiality is against passive observers without keys.
What related research exists?
Related work covers four categories: managed security services, agent security and runtime execution, private inference and encrypted computation, and context compression and embeddings.
Dedicated security services
- Nelson et al. (2025, NIST SP 800-61)—managed security services aggregate expertise and threat intelligence but introduce sensitive data access across organizational boundaries. The authors state that this paper's paradigm combines remote audit computation with that boundary, keeping plaintext input and execution control in the user control domain.
Agent security and runtime execution
- AgentDojo (2024), AgentHarm (2025), InjecAgent (2024)—expose the risks from tool use, malicious requests, and untrusted external content.
- ToolSafe (2026)—step-level guardrails that judge based on the task, candidate action, and interaction history and provide feedback before execution; this paper's data comes from its public step annotations. StepGuard (2026)—studies step-level checking and the safety–utility trade-off. The authors state that these works establish the need for context auditing, and this paper addresses the delegation of auditing.
- AgentSpec (2026)—expresses runtime constraints with triggers, predicates, and enforcement mechanisms; CaMeL (2025)—separates a privileged model from a quarantined model and enforces capability-based information-flow policies. The authors state that these works regulate source authority and data flow, and this paper additionally treats the audit provider as an observer of private input.
Private inference and similarity computation
- CryptoNets (2016)—performs neural network prediction on encrypted inputs without giving the cloud the decryption key. GAZELLE (2018)—combines HE with two-party computation for private neural inference while also protecting model parameters. SANNS (2020)—secure approximate nearest-neighbor search, including semi-honest secure protocols. The authors state that this paper's design problem is how to turn private task context into useful numeric audit input and connect confidential results to execution.
Compression and numeric representations
- Selective Context (2023), LLMLingua (2023)—compress language model input; Sentence-BERT (2019), C-Pack/bge (2024)—provide sentence vectors suitable for similarity comparison. The embedding inversion results of Morris et al. (2023) are used by the authors as motivation for encrypting vectors at the audit boundary.
Baselines and benchmarks: Detection comparison baselines are LR on the same input, RBF-SVM, same-space centroid, and direct cosine (Table 3); external guardrail references are StepGuard-4B and Qwen3Guard-Gen-0.6B (416 shared candidates). The data are ToolSafe public step annotations (derived from AgentHarm and AgentDojo trajectories). The authors position this paper's distinction as: treating representation, delegated arithmetic, and the output interface as explicit design choices, connecting confidential auditing with execution control.
How does the paper address this problem?
Under the three-domain model it is divided into three layers: trusted representation construction, CKKS encrypted audit computation, and trusted decision and execution binding, instantiated as SealCall.
The overall idea is to separate the delegation of audit computation from plaintext access and execution authority, forming a privacy-preserving safety audit paradigm, instantiated as the SealCall framework (Table 1 lists the three layers and their interfaces).
Problem setting and three-domain audit model
- Audit context At = (u, at, h<t):u 为用户任务指令(授权判断依据),a_t 为待执行的工具调用,h_<t 为之前的工具调用及返回内容;来源角色区分用户指令与工具返回的外部信息。
- 三个域:智能体执行域(运行智能体,提供最终候选和上下文)、用户控制域(可信控制器 C,读取 A_t、构造并加密表示、持有解密密钥、决定放行)、审计服务域(服务器 S,收加密表示、执行约定计算、返回加密结果,不持密钥和放行权)。
- 接口组合:qt = κ(At), zt = ϕ(qt) 为上下文压缩与向量化;ct = EvalF(Enc(zt), Enc(Θ)) 为加密计算;bt = δ(Dec(ct); τ) 为解密后按校准参数决策。部署需联合选择 κ、φ、Θ、F、δ。
可信上下文处理与审计表示
- 上下文压缩以候选调用为中心,选择与授权和风险相关的任务约束和历史证据,保留来源角色、时间顺序和缺失证据指示;用户任务和最终候选始终保留。
- SealCall 的表示:保留用户任务和最终候选的规范化 JSON,按标量参数出现位置(带来源角色和偏移)选择历史片段;结合冻结的 bge-small-en-v1.5 嵌入与工具身份、参数路径和类型、历史存在性、参数来源等结构化特征,经学习的仿射投影产生单位向量(式 6)。
- 监督拟合训练"与不安全参考的最大相似度"目标,同根查询–参考对被屏蔽;嵌套选择决定映射和参考数量,独立校准集定阈值。
通过 HE 委托审计计算
- 控制器 C 生成密钥并保留私钥;审计数据 Θ(SealCall 取参考集 B)经可信准备加密;每次查询用新鲜随机性加密;服务器 S 评估约定电路并返回密文。
- SealCall 用 CKKS 计算加密查询与 K 个加密不安全参考的点积(式 7),TenSEAL 打包响应;控制器解密全部 K 个相似度,取最大值并按阈值 τ 判定(式 8),ŷ=1 表示不安全。
- 命题 1(决策保持):若每个参考的解密近似误差不超过 ε 且 |s_t − τ| > ε, then it approximately agrees with the plaintext decision; the authors use this to motivate measuring score error and decision consistency.
Trusted decision and execution control
- The controller binds the decision to the specific operation to be executed: before delegation it records the final call and expected state; at release it checks that the result belongs to this request, that the call and state still match, and that the decision permits execution; any change triggers re-auditing, and when results are unavailable it stays blocked (fail closed).
- The adapter stores a normalized parameter snapshot and hashes the tool name, call identifier, per-gate nonce, and expected state version; replayed, duplicate, malformed, mismatched, or timed-out results all fail closed; tool channels are serialized, and state is committed only after execution succeeds.
Confidentiality conditions
- The authors state that under the assumptions of a fixed public circuit, parameters, layout, and request scheduling, HE semantic security, fresh encryption randomness, and correct key management, the audit server's message view (Equation 1) is computationally indistinguishable for different inputs of the same shape; the public layout and request timing remain observable, and subsequent tool activity constitutes a separate feedback channel.
What experiments did the paper conduct?
Grouped nested evaluation on 1,252 public binary candidates: SealCall averages F1 0.840, lower than LR on the same input; on 760 records the encrypted decisions are all consistent with the plaintext.
Experimental Setup
- Data: ToolSafe's public step annotations (derived from AgentHarm and AgentDojo trajectories); of 1,951 source records, 29 were excluded by format validation and 397 were merged by exact input deduplication, leaving 1,525; of these, 1,252 binary candidates entered training and evaluation (Harm 399, Dojo 853; safe 717, unsafe 535), and 273 intermediate-label candidates were kept separately (Table 2).
- Protocol: nested evaluation with 5 external grouped folds + 3 internal folds, with root as the unit of partitioning; 5 seeds; each binary candidate gets one external test prediction per seed.
- Calibration strategies: B_10 takes the lowest threshold satisfying a 10% calibration FPR budget; B_F1 maximizes calibration F1; one global threshold is used for both sources.
- Metrics: unsafe is the positive class; F1, Recall, FPR, and AUROC are reported; confidence intervals are 5,000 source-stratified root bootstraps (conditional on the fitted model).
- Baselines: same-space center, same-input LR, same-input RBF-SVM, direct cosine (Table 3); external guardrail references StepGuard-4B, Qwen3Guard-Gen-0.6B (Q4_K_M weights, 416 shared candidates).
- Encrypted evaluation environment: Intel Core Ultra 5 225H, 32 GB RAM, single-threaded, TenSEAL 0.3.18; CKKS polynomial modulus degree 8192, coefficient modulus bit widths [60, 40, 40, 60], scale 2^40; reference set/center/LR timed over 50 queries (3 warm-ups), RBF over 20.
Main Results
According to Table 3 (same 1,252 candidates, B_F1 strategy column; B_10 column omitted):
Swipe horizontally to read the table
Scorer B_10 F1 B_10 FPR B_F1 F1 B_F1 FPR AUROC SealCall reference set 0.812 0.153 0.840 0.112 0.921 Same-space center 0.805 0.145 0.818 0.120 0.917 Same-input LR 0.899 0.110 0.913 0.089 0.967 Same-input RBF-SVM 0.889 0.137 0.905 0.052 0.970 Direct cosine 0.627 0.137 0.666 0.449 0.736 - The authors state that learned representations outperform direct cosine; LR and RBF-SVM are more discriminative on these data, and the B_F1 F1 difference between the reference scorer and LR is −0.072 (within-family paired interval [−0.112, −0.035]).
- Under B_F1, source-decomposed F1 is Harm 0.745 and Dojo 0.888 (equal-source F1 0.816); the authors state that the larger Dojo source contributes disproportionately to the combined F1 (Table 6).
- The authors state that SealCall's B_10 test FPR is 15.26%, indicating a gap between the calibration budget and future behavior.
External Guardrail Reference
- On 416 shared candidates, StepGuard-4B and Qwen3Guard-Gen-0.6B have F1 of 0.882 and 0.411 respectively, and SealCall's corresponding external prediction is 0.837 (B_F1); this subset has no invalid responses.
- The authors note that these are same-case reference results, that training overlap is unknown, weights are quantized, and tool metadata is incomplete, and that the 416-case scores are not directly comparable with Table 3.
Representation Information Retention: Ablations and Diagnostics
- Matched ablation (Table 4, B_10 combined F1): full representation 0.812; without text embeddings 0.769; without structured features 0.718. The authors report that removing text embeddings lowers B_10 F1 by 0.043, with a within-family interval [−0.003, 0.090] that includes zero.
- LR readout comparison (lower panel of Table 4): BGE+features/LR 0.879, TF-IDF+features/LR 0.878, features-only/LR 0.870, tool-name probe/LR 0.846; the authors state that lexical and structured cues contribute most of the discriminative power on this benchmark, and that differences across sources are large.
- Task restatement diagnostic: 100 anchors each with two restatements; under B_10 the original text F1 is 0.785, the two restatements are 0.791 and 0.787 respectively, and the proportion with all three correct is 0.776; restatements were generated by one AI model and reviewed by another, with no human adjudication.
- Authorization change diagnostic: 80 constructed policy worlds (320 cases), varying recipient binding, purpose, source authority, or preconditions; at no operation point did any world get all four decisions correct, and the parser of the constructed grammar scores 1.000 on this metric. The authors state that the current representation and scorer cannot reliably distinguish these policy changes.
Encryption Fidelity and Cost
- Decision consistency: on 760 model–layout numeric records, encrypted decisions under both frozen operation policies all match plaintext; the maximum final score error for the packed reference scorer is 1.52×10⁻⁶, and about 1.19×10⁻⁵ across all layouts and scorers.
- Representative configuration cost (Table 5, fold 0, seed 20261016, d=256, K=16, this model's 251-case external test fold): SealCall F1 0.895, 0.176 s per encrypted scoring, packed response 0.131 MB (original 3.761 MB); center 0.845/0.016 s; LR 0.909/0.043 s; RBF-SVM 0.915/15.267 s, original 93.794 MB.
- Other costs: packing reduces the reference response by 96.5%; query 0.331 MB, encrypted reference set 5.302 MB; trusted extraction, uncached BGE encoding, and projection average 1.47, 484.95, and 0.55 ms; trusted preparation plus private scoring averages 0.663 s (empirical 95th percentile 1.158 s); local plaintext scoring after preparation is about 19 μs. The authors state that LR is both more accurate and faster than the reference scorer on this representative configuration, while SealCall's packed response is smaller.
Execution Binding and Evaluation Scope
- Input reconstruction validated 3,066 selected source fragments and all 1,525 compact contexts, with selected text accounting for 21.6% of reference characters; all 36 adapter tests pass, covering replay, candidate changes, stale state, and fail-closed.
- The authors note that the historical OpenClaw controlled probes used an earlier scorer, and that detection results for the current pipeline come from the offline evaluation above; candidates come from existing trajectories, detection metrics target fixed calls, and task completion rate after refusal and real-time attack success rate require interactive evaluation.
Other Ablations and Analyses
- Action stratification (Table 7, B_10): SealCall recall is 0.896 for unsafe send, 0.929 for write, 0.715 for publish, and 0.622 for other; the execute agent has only 5 roots, with recall 0.178.
- External fold selection (Table 8): the selected configuration differs across folds (bank256, hard128, bank128), with K values from 1–16.
- Policy diagnostics by relation family (Table 10): SealCall has F1 0.607 on source_authority and 0.171 on purpose_scope, and All-4 is 0.000 for all methods on all families.
- Semantic diagnostic summary (Table 9): the lexical readout stays at 0.850 or above for all three correct, dropping to 0.706 without text embeddings; on constructed worlds, the pairwise accuracy of all tested methods does not exceed 0.025.
- Figure 2 shows held-out ROC curves by source (AgentHarm n=399, AgentDojo n=853), with Normal rejection (FRR) on the horizontal axis and Dangerous recall on the vertical axis; scores from different fitted models are never combined.
What are some points that can be further explored?
The authors state that sensitivity to authorization changes, optimization of encrypted computation, and runtime integration are future directions; the evaluation is based on public fixed candidates and single-machine measurements.
Limitations and future directions noted by the authors
- The authorization-change diagnostic shows that the current representation and scorer cannot reliably distinguish policy changes such as recipient binding, purpose and source permissions; the authors state that capturing these changes is a representation goal distinct from paraphrase stability (Section 4.3).
- Future work will develop representations sensitive to authorization changes, optimize encrypted computation, and extend integration with agent runtimes such as Codex and OpenCode (Section 6).
- Candidates come from existing trajectories, and the detection metrics target fixed calls; the authors state that task completion after refusal and real-time attack success rate require interactive evaluation (start of Section 4).
- The detection data had already been examined during method development, and the protocol measures performance on an already-exposed benchmark with grouped separation and nested configuration selection (Section 4.1).
- A malicious server may return a legitimate ciphertext encoding an incorrect score; the authors state that extending to such servers requires computational integrity mechanisms such as verifiable evaluation (Section 3.5).
- Protecting the provider's reference assets from recovery by the controller is a separate goal requiring protocols that restrict output; the authors state this is a route to extending input confidentiality to two-party data protection (Section 3.3).
Scope of experiments
- The evaluated objects are the scorer and representation variants (SealCall reference set, centroid, LR, RBF-SVM, direct cosine and ablations), with external guardrail references being the two models StepGuard-4B and Qwen3Guard-Gen-0.6B (416 cases).
- The data are 1,252 binary candidates from ToolSafe's public step annotations, from two sources, AgentHarm (399) and AgentDojo (853); 273 intermediate-label candidates were excluded from binary fitting and evaluation.
- Encryption cost is measured on a single machine (Intel Core Ultra 5 225H, single-threaded, TenSEAL 0.3.18), excluding network transmission, scheduling, process isolation, concurrent users and key lifecycle operations (Appendix C).
- The paraphrase diagnostic has no human adjudication; it is generated by an AI model and reviewed by another model; the policy-world labels are derived by a parser from constructed facts, and the authors note this does not constitute human-adjudicated deployment samples (Appendix B).
- The paper does not report the degree of training overlap between the external guardrail models and the SealCall training data (the authors note it is unknown), nor the versions of the paraphrase generation and review models (Appendix B notes they are not fixed).
Summarize the main content of the paper
The authors propose a three-domain privacy-preserving audit paradigm and instantiate SealCall: CKKS encrypted similarity auditing averages F1 0.840, and the encrypted decisions are all consistent with the plaintext.
A systems paper on the privacy problem of pre-execution safety auditing for LLM agents: sending the task, call parameters, and interaction history to an external audit service causes what the authors call "audit-induced privacy exposure."
- Problem: Context auditing of agent tool calls requires private information; outsourcing to a professional audit service exposes user tasks, customer identities, and business communications; the authors establish a three-domain audit model (agent execution domain, user control domain, audit service domain) and protect input confidentiality against a semi-honest auditor.
- Method: The paradigm has three layers—trusted representation construction (context compression + bge-small-en-v1.5 embeddings and structured features + learned projection), encrypted audit computation (CKKS computes dot products with K encrypted unsafe references and packs the result for return), and trusted decision and execution (decrypt and take the maximum, decide by a calibrated threshold, bind call and state, fail closed). Instantiated as SealCall.
- Detection quality: On ToolSafe's 1,252 public binary candidates, under grouped nested evaluation SealCall averages F1 0.812 (B_10) / 0.840 (B_F1); LR and RBF-SVM on the same input are higher (0.913, 0.905); the authors state that the reference scorer returns an inspectable single-sample similarity, whereas LR/RBF-SVM have stronger discriminative power.
- Encryption fidelity and cost: On 760 model–layout records, the encrypted decisions are all consistent with the frozen plaintext decisions, with a maximum score error of about 1.19×10⁻⁵; the representative configuration (d=256, K=16) takes 0.176 s per encrypted scoring, and packing reduces the reference response from 3.761 MB to 0.131 MB.
- Negative result: In the 80 authorization-change constructed worlds, none of the tested methods had all four decisions correct in any world (Table 9/10); the authors state that the current representation cannot reliably distinguish policy changes.
- Authors' conclusion: Under the conditions of trusted preparation, isolated keys, and a reliable intermediary, external auditing can protect agents before execution without plaintext user context; future work includes authorization-sensitive representations, optimization of encrypted computation, and integration with runtimes such as Codex and OpenCode.