This is a Preprint and has not been peer reviewed. This is version 1 of this Preprint.
Protecting confidential data when using AI coding assistants: A practical guide
Downloads
Authors
Abstract
Generative artificial intelligence (AI) coding assistants can substantially accelerate research workflows in ecology, fisheries science, and related quantitative disciplines, but they also create new pathways for accidental or adversarial disclosure of confidential information. Researchers in these fields routinely work with legally protected and commercially sensitive records (e.g., individual-level records, accurate geographic locations, pre-release data), and even small snippets of code context, console output, comments, or file paths can be disclosive when transmitted to cloud-hosted large language model (LLM) services.
This paper provides a practical guide for researchers and institutions to use LLM-based coding assistants while maintaining confidentiality. We (i) catalogue common AI integration points in widely used development environments and R tooling, highlighting features that may activate or transmit context without obvious user intent; (ii) summarise key data exposure pathways – intentional sharing, accidental transmission, and adversarial exploitation such as prompt injection; (iii) propose a four-scenario framework spanning browser chat, editor autocomplete, agentic assistants, and local models, with increasing capability and risk; and (iv) offer actionable mitigations centered on a “develop on simulated data, run on real data” workflow and a complementary two-computer separation strategy.
We also introduce the confideR R package, which supports session auditing, risk reminders, script scanning for sensitive text, and generation of prompt-ready data fingerprints and simulated datasets.
Commercial tools for running LLMs safely are likely to rapidly improve in usability and capability, but so is the sophistication of malicious attacks. Our recommended approach is robust to future changes, because it uses simulated data and the physical separation of confidential data and LLM tools. Together, these recommendations aim to enable responsible uptake of AI coding assistants in the environmental sciences without compromising data confidentiality.
DOI
https://doi.org/10.32942/X2FM30
Subjects
Life Sciences
Keywords
artificial intelligence, data governance, information security, agentic AI, environmental science, fisheries science
Dates
Published: 2026-08-18 10:39
Last Updated: 2026-08-18 10:39
License
CC BY Attribution 4.0 International
Additional Metadata
Conflict of interest statement:
None
Data and Code Availability Statement:
The confideR R package is available at https://github.com/smithja16/confideR
Language:
English
Metrics
Views: 5
Downloads: 0
There are no comments or no comments have been made public for this article.