Auditing Tool Traces in Agentic LLMs: Source Localization and Counterfactual Dependence Testing
Organizations: University of California, Irvine · NEC Labs America
Abstract
Agentic LLMs increasingly support scientific prediction by grounding decisions in external evidence. In biology, they promise accurate, interpretable predictions for important problems by integrating complex experimental and computational evidence. However, serialized tool results can contain hidden label shortcuts, such as dataset identifiers or template artifacts, that create apparent success without biological reasoning. To address this risk, we introduce a two-stage audit. Stage 1, Per-Tool TF-IDF Decomposition (PT2D), localizes label-predictive patterns to individual tool results while avoiding signal dilution in the concatenated tool trace. Stage 2, Token-Class Redaction, counterfactually tests whether the frozen LLM depends on the localized shortcut. We apply this audit to TCR-pMHC binding, where tool augmentation substantially outperforms a no-evidence baseline. At face value, this suggests that the LLM has learned to use scientific evidence. The audit overturns this interpretation: PT2D localizes the strongest signal to identifiers in one tool result, and redacting them reduces performance to chance. These findings show how hidden label shortcuts can masquerade as scientific reasoning or discovery, motivating source-level audits before benchmark gains are trusted.
Figures & tables
| Variant | AUROC | |
|---|---|---|
| Original | 0.8136 | — |
| PDB-ID redacted | 0.4972 | |
| Peptide redacted | 0.8152 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Split | Total | Positive | Negative |
|---|---|---|---|
| Train (C0) | 12,940 | 3,483 | 9,457 |
| Validation (C0) | 1,438 | 397 | 1,041 |
| Test C1 | 1,004 | 45 | 959 |
| Test C2 | 994 | 38 | 956 |
| Test C3 | 968 | 30 | 938 |
| Test C4 | 968 | 109 | 859 |
| Step | Tool | Tool-result content |
|---|---|---|
| 1 | CDR3 biophysical analysis | Length, residue composition, charge, flexibility, and contact-potential descriptors. |
| 2 | McPAS-TCR retrieval | Database matches, sequence similarity, and associated epitope annotations. |
| 3 | ThermoMPNN | Mutation-level stability predictions and the serialized inference filename. |
| 4 | Stability summary | Positional stability and hotspot summaries derived from Tool 3. |
| 5 | TCR–pMHC interface analysis | Buried surface area, contact distances, hydrogen bonds, salt bridges, and a serialized complex identifier. |
| Scope | Word 1–2 | Char 2–5 | Char 3–5 |
|---|---|---|---|
| Full trace | 0.4818 | 0.4677 | 0.4876 |
| Tool 1 | 0.4569 | 0.4797 | 0.4733 |
| Tool 2 | 0.4681 | 0.4839 | 0.4985 |
| Tool 3 | 0.4946 | 0.6288 | 0.6365 |
| Tool 4 | 0.4947 | 0.5050 | 0.5015 |
| Tool 5 | 0.4833 | 0.5259 | 0.5310 |
| Scope | All | C1 | C2 | C3 | C4 | C5 |
|---|---|---|---|---|---|---|
| Full trace | 0.4876 | 0.4888 | 0.5413 | 0.6359 | 0.4565 | 0.4216 |
| Tool 1 | 0.4733 | 0.3769 | 0.4687 | 0.5548 | 0.4881 | 0.4403 |
| Tool 2 | 0.4985 | 0.4997 | 0.5957 | 0.5708 | 0.4706 | 0.4160 |
| Tool 3 | 0.6365 | 0.5566 | 0.6392 | 0.6109 | 0.6999 | 0.4874 |
| Tool 4 | 0.5015 | 0.4510 | 0.5369 | 0.5727 | 0.4878 | 0.5037 |
| Tool 5 | 0.5310 | 0.4982 | 0.5018 | 0.5445 | 0.5702 | 0.4717 |
| Prefix | All | C1 | C2 | C3 | C4 | C5 |
|---|---|---|---|---|---|---|
| 1 digit | 0.6725 | 0.5776 | 0.5686 | 0.6542 | 0.7470 | 0.5202 |
| 2 digits | 0.6967 | 0.5794 | 0.7416 | 0.5946 | 0.7716 | 0.4967 |
| 3 digits | 0.6793 | 0.4820 | 0.6522 | 0.5614 | 0.8442 | 0.5817 |
| Variant | Replacements | Placeholder |
|---|---|---|
| PDB ID | 50,778 | <PDB_ID> |
| Peptide | 63,674 | <PEPTIDE> |
| Format | 3,582,603 | <FORMAT> |
| Variant | All | C1 | C2 | C3 | C4 | C5 | |
|---|---|---|---|---|---|---|---|
| Original | 0.8136 | — | 0.5746 | 0.8298 | 0.8324 | 0.8686 | 0.8322 |
| PDB-ID redacted | 0.4972 | 0.5126 | 0.5241 | 0.4818 | 0.4963 | 0.4858 | |
| Peptide redacted | 0.8152 | 0.5763 | 0.8535 | 0.8437 | 0.8646 | 0.8295 | |
| Format redacted | 0.5189 | 0.4787 | 0.4829 | 0.4343 | 0.5747 | 0.5184 |
| Tools | AUROC | 95% CI | |
|---|---|---|---|
| {3} | 1 | 0.6365 | [0.6008, 0.6704] |
| {3,1} | 2 | 0.6049 | [0.5679, 0.6415] |
| {3,1,2} | 3 | 0.5284 | [0.4941, 0.5622] |
| {3,1,2,4} | 4 | 0.4956 | [0.4605, 0.5291] |
| {3,1,2,4,5} | 5 | 0.4876 | [0.4553, 0.5221] |
| Mean | SD | Min | Max | |
|---|---|---|---|---|
| 0 | 0.6365 | 0.0000 | 0.6365 | 0.6365 |
| 1 | 0.5701 | 0.0121 | 0.5590 | 0.5891 |
| 2 | 0.5429 | 0.0218 | 0.5256 | 0.5809 |
| 5 | 0.5064 | 0.0259 | 0.4821 | 0.5489 |
| 10 | 0.4749 | 0.0302 | 0.4464 | 0.5249 |
| 20 | 0.4900 | 0.0209 | 0.4669 | 0.5167 |
LLM Auditing
Large language model auditing tests models and deployed systems for bias, safety, privacy, reliability, and provenance using behavioral and internal evidence.
See all 621 papers