Risks: research integrity, confidentiality, and security

Questions

  • Can I trust a research result when part of the code was written or modified by an AI tool?

  • What information am I exposing when I use an AI coding tool, and to whom?

  • What can the tool access, install, modify, execute, or destroy?

Objectives

  • Risks when using AI in research work: research integrity, confidentiality, and cybersecurity

  • Translate the ALLEA principles (reliability, honesty, respect, accountability) into AI-assisted coding practice

  • Recognise which information an AI tool can see in the chat, IDE, and agent scenarios

  • Recognise the main ways AI coding tools create cybersecurity risk, and how to reduce the “blast radius”

  • Know when a question needs your institution’s experts rather than your own judgement

AI changes what you delegate, not who is responsible

If a figure in your paper is wrong, if participant data ends up where it should not, or if your laptop gets wiped, “the AI did it” does not help the people affected.

So a useful starting question for this episode is:

If part of my analysis code was written or modified by an AI system, what can go wrong?

Doing research comes with responsibilities, and the question has more than one kind of answer. The Responsible Computational Research material asks: Are my results true and do they reflect real phenomena? Will others be able to validate or replicate my findings? Will I be able to re-run the same code and data and obtain the same results? Those are questions about research integrity. With AI tools in the loop, two more families of questions appear next to them: what you expose to the tool, and what the tool can do.

This is not a cybersecurity course, a GDPR course, or a research-ethics course. The goal is a mental model and a few habits that let you recognise risk and know when to ask someone who specialises in it.

Three overlapping domains

When you use AI to help write research software, ask three different questions:

Question

Domain

Can I trust the research produced with this code?

Research integrity

What information am I exposing, and to whom?

Confidentiality

What can this tool access, install, modify, execute, or destroy?

Cybersecurity

A venn diagram with the 3 domains.

Three types of risks capture what could possibly go wrong when AI coding assistants are used in research.

Part 1 — Research integrity: you own the result

The European Code of Conduct for Research Integrity (ALLEA, revised 2023) rests on four principles. It counts code and software among research outputs, and the 2023 revision mentions AI explicitly: researchers report their methods “including the use of external services or AI and automated tools” (section 2.3), disclose AI use in reviewing and assessment (2.8), and “hiding the use of AI or automated tools in the creation of content or drafting of publications” is listed among unacceptable practices (3.1). The EU’s ERA living guidelines on the responsible use of generative AI in research (updated May 2026) build on the same principles.

ALLEA principle

The AI-assisted coding question

Reliability

Does the code actually produce scientifically valid results?

Honesty

Have I transparently described how the code and result were produced?

Respect

Am I respecting participants, collaborators, licences, and other people’s work and time?

Accountability

Can I take responsibility for the code and the claims based on it?

1.1 Reliability: “plausibly wrong” is the real risk

The code may have been written by an AI system, but you still need evidence that it does what your research claims it does. The dangerous failure is not code that crashes. It is code that runs, looks reasonable, but is wrong. This can be because of wrong defaults, missing values, invented functions or APIs.

1.2. Honesty: say what the AI did

Be transparent enough that another researcher can understand how the code and the result were produced, and disclose the role of AI. There is no universal disclosure format and no universal threshold. Autocompleting a variable name is not the same as having an agent draft your data-cleaning pipeline; follow the policies that apply to you (journal, funder, institution), and when in doubt, disclose what was substantive for the result.

1.3 Respect: other people’s work, data, and time

  • Licences and attribution. Generated code can closely resemble existing code, and you usually cannot tell where it came from. Treat it like a snippet from a web forum: if it looks like a recognisable piece of someone else’s project, find the source, and respect its licence. The CodeRefinery software licensing episode covers the basics.

  • Project policies. Open-source projects increasingly have explicit rules on AI-assisted contributions: some require disclosure, some restrict or forbid it. Read CONTRIBUTING.md (and any AGENTS.md) before sending a pull request.

  • Collaborators’ unpublished work. Their manuscript, data, or code is not yours to send to a third-party service. This overlaps with Part 2 — Confidentiality: what leaves your computer?.

  • Reviewers’ time. A large, poorly understood AI-generated pull request moves the work of understanding it onto the reviewer. Submit what you can explain.

1.4 Accountability: the tool cannot take responsibility

The AI system cannot take responsibility for your research result. You, or your research team, must be able to stand behind the analysis, the code, the methods, the data transformations, the interpretation, and the resulting claims. The Linux kernel policy puts it in legal terms: an AI agent must not certify the contribution, and the human submitter takes full responsibility for it. The same logic holds for a paper.

Part 2 — Confidentiality: what leaves your computer?

Researchers routinely handle information that is valuable or sensitive even when it is not personal data:

  • unpublished ideas, hypotheses, results, manuscripts, grant proposals;

  • collaborator material, embargoed information, material under review;

  • source code, proprietary algorithms, trade secrets;

  • credentials, tokens, infrastructure details (server names, internal URLs);

  • research-participant data, personal data, and special categories of personal data (e.g. health).

The core practical question is:

What information can this AI system see, and where does that information go?

The answer changes dramatically across the three scenarios:

Scenario

What the tool can see

Who decides

Chat

What you paste or upload

You, one message at a time

IDE assistant

Open files, neighbouring files, project context, sometimes terminal output

Mostly the tool’s context-collection rules

Agent

Potentially the whole repository, shell environment, logs, any file it can read, network resources

The agent, within whatever permissions it has

Remote services: know which one you are using

“Cloud” is just somebody else’s computer: A remote model runs on somebody else’s infrastructure. Sending information to it changes who may technically or contractually have access to that information. That is not the same as saying every provider trains on or leaks everything; it means you need to know:

  • which service and account you are using: a personal account, an API key, and an institutional agreement for the same model can have different terms;

  • what is transmitted, including context the client collects on its own;

  • retention: how long prompts and outputs are kept, and whether humans may review them;

  • training: whether your data may be used to improve models, and whether that is on or off by default;

  • where data are processed, if that matters for your data or funder;

  • whether your institution requires a specific approved service, or a local or institutional model (Appendix II: Running Local LLMs for Coding).

Practical minimisation: use synthetic or sample data in prompts, share the schema rather than the data, keep secrets out of the project directory, and use an institutional or local model for anything you cannot classify as public.

Part 3 — Cybersecurity: what can the tool do?

AI coding tools create risk not only because generated text can be wrong, but because increasingly agentic tools can read, install, execute, modify, communicate, and authenticate. The more of these verbs a tool has, the more an error or an attack can do.

Sorting risks by where they enter ages better than a list of named attacks. Data going out is covered in Part 2 — Confidentiality: what leaves your computer?; the other entry points are:

Entry point

Looks like

OWASP reference

Untrusted content coming in

Instructions hidden in a README, issue, rules file, web page, or tool description

LLM01 Prompt Injection; ASI01 Agent Goal Hijack

Wrong things installed

Hallucinated or typosquatted packages, malicious extensions or MCP servers

LLM04 Supply Chain; ASI04 Agentic Supply Chain

Insecure code written

Injection, path traversal, unsafe deserialisation, hard-coded secrets

LLM10 Improper Output Handling

Agents acting on systems

Destructive commands, misuse of credentials, network calls

LLM03 Excessive Agency; ASI02, ASI03, ASI05

Over-trust

Accepting output because it sounds confident

ASI09 Human-Agent Trust Exploitation

IDs refer to the OWASP Top 10 for LLM Applications 2026 (LLMxx) and the OWASP Top 10 for Agentic Applications 2026 (ASIxx). OWASP renumbers between editions, so always cite the year with the ID.

Risk grows with access and autonomy

None of the three scenarios is automatically safe or unsafe. A chat can leak a manuscript; an agent in a well-built sandbox can be quite contained. As access and autonomy increase, the possible consequences of an error or an attack increase, so verification and containment should normally increase too.

Chat

IDE assistant

Agent

Sees

What you paste

Open files and project context, chosen by the tool

Whatever it can read

Can do

Nothing; you copy the output

Suggest and sometimes edit files

Read, write, execute, install, connect, for many steps

Integrity

Read and test each snippet

Review each accepted suggestion

Tests, diffs, and known-answer checks before trusting a result

Confidentiality

Decide what to paste

Configure exclusions, close sensitive files, check what is sent

Keep sensitive data and secrets out of reach

Cybersecurity

Verify packages before installing

Watch multi-file edits

Least privilege, sandbox, restricted network, version control

Summary: three questions

Domain

Main question

Examples

Main mitigations

Research integrity

Can I stand behind the result?

Plausibly wrong analysis, silent data loss, poor attribution, undisclosed AI use

Validation and known-answer tests, review, documentation, disclosure, reproducibility

Confidentiality

What information leaves my boundary, and who can see it?

Unpublished ideas and manuscripts, participant data, collaborator material, credentials

Classification, approved services, minimal context, synthetic data, local or institutional models

Cybersecurity

What can the tool access or do?

Prompt injection, malicious packages, insecure code, destructive agent actions

Least privilege, dependency verification, review, sandboxing, network and filesystem restrictions, version control

Short checklist

Before relying on AI-assisted code:

  • [ ] I can explain what the relevant code does.

  • [ ] It recovers known answers on synthetic or reference data, and I checked N at each transformation.

  • [ ] Dependencies are legitimate packages I verified.

  • [ ] I can reproduce the environment and workflow (versions, parameters, seeds).

  • [ ] Substantive AI use is disclosed where required.

Before giving an AI tool access:

  • [ ] I know what information it can see and where that information is processed.

  • [ ] That information is appropriate for this tool, account, and service.

  • [ ] Credentials and sensitive data are outside its reach.

  • [ ] It has only the filesystem, network, and execution privileges it needs.

  • [ ] Potentially destructive work is version-controlled, backed up, or sandboxed.

Validate. Minimize. Contain.

If you remember three questions from this page:

Can I trust the result? What information am I exposing? What can the tool do?

remember the three responses too:

  • Validate: protect research integrity by testing, reviewing, documenting, and disclosing.

  • Minimize: protect confidentiality by limiting what information the AI can access or receive.

  • Contain: protect your systems by limiting privileges and the blast radius.

None of this means “never use AI”. It means using it the way we use any powerful research instrument: with calibration, controls, and a record of what we did.

See also

Research integrity and policy

Confidentiality

Cybersecurity

Keypoints

  • Ask three questions: Can I trust the result? What information am I exposing? What can the tool do?

  • The three domains (research integrity, confidentiality, cybersecurity) overlap; one incident can touch all three

  • You remain accountable for AI-assisted code: match the tool’s autonomy to your ability to verify its work

  • “Plausibly wrong” code is the main integrity risk; an honest error is not misconduct, but validation keeps it out of the record

  • Know what the tool can see and where it goes; confidentiality includes unpublished ideas, not only personal data

  • Verify packages before installing, and give agents only the access they need

  • Validate. Minimize. Contain.