Skip to main content
Back

Claude Code's Silent Dependency Choices Put Security Teams on Alert

A new pre-registered study protocol examines whether configuring Claude Code and OpenAI Codex can actually control which libraries they silently pull into your codebase.

Pro

Paper, Full Access
  • Core finding: A pre-registered study protocol is the first controlled experiment designed to test whether configuring Claude Code and OpenAI Codex can govern their silent library import decisions.
  • The problem: Agentic coding tools routinely add external dependencies without announcing them in natural language, creating hidden security and licensing risks.
  • What's being tested: Six configuration levels are compared, from no config to context files, Skills (SKILL.md), MCP-connected package registries, and permission controls.
  • Three outcomes measured: Which library the tool picks, whether it discloses the new dependency, and whether that disclosure is accurate and complete.
  • Prior evidence: Research found LLMs unnecessarily overuse popular libraries like NumPy in ~45% of cases, suggesting systematic bias that configuration may or may not override.
  • Artifact release: The benchmark dataset, config artifacts, and analysis pipeline will be released as a reusable tool for evaluating future agentic coding tools.

Every time you hand a task to an agentic coding tool, it makes a quiet judgment call: should it write this functionality from scratch, or just import something? That decision, which researchers call the build-versus-buy choice, is happening thousands of times a day across codebases worldwide. And until now, nobody has run a controlled experiment to figure out whether developers can actually influence it.

A new pre-registered study protocol from researchers at the University of Canterbury and King's College London aims to change that. The paper lays out a rigorous experimental design to test how different configuration mechanisms in Claude Code and OpenAI Codex shape the dependency decisions those tools make, and whether the tools honestly disclose the libraries they introduce.

The Silent Dependency Problem

Agentic AI coding tools accept high-level task descriptions and plan, write, and execute code with minimal per-step human direction, introducing external dependencies without explicit instruction. For example, when a developer asks such a tool to implement authentication, it may write import bcrypt or issue a pip3 install passlib command without stating so in its natural-language reply. The dependency enters the codebase unannounced.

If the developer does not review code changes systematically, it may not be noticed until a security audit or license scan surfaces it. That is not a hypothetical edge case. As adoption of these tools grows, observational data confirms that systematic library preferences are already visible in deployed releases. The scale of the problem compounds quickly: prior research found that eight LLMs systematically overuse popular libraries like NumPy unnecessarily in roughly 45% of cases, and defaulted to Python even for performance-critical tasks where it is suboptimal.

The agentic AI setting inherits traditional build-vs-buy tensions and adds two of its own: the decider is the tool rather than a human engineer, and the decision is often unannounced in the natural-language interface, so the human oversight that earlier software engineering literature relied on is harder to apply.

Why Configuration Is the Lever

Both Claude Code and OpenAI Codex expose a layered set of mechanisms that developers can use to shape tool behavior. Understanding these layers is key to understanding what the study is actually testing:

  • Context files (CLAUDE.md / AGENTS.md): Markdown files you add to your project root that the tool reads at the start of every session, used to set coding standards, architecture decisions, and preferred libraries.
  • Skills (SKILL.md): Introduced by Anthropic in late 2025 and subsequently adopted by OpenAI for Codex, Skills are a portable, model-invoked way to teach any coding agent how your team actually works. They activate on demand rather than loading all at once.
  • MCP servers: The Model Context Protocol is an open standard for connecting AI tools to external data sources, allowing tools like Claude Code to read design docs, update tickets, or use custom tooling. In this study, MCP is used to give the agent access to a library discovery service.
  • Permission controls: Explicit allow/deny lists that restrict which packages the agent can install or call.

Configuration mechanisms are one of the primary means by which practitioners can influence build-versus-buy decisions. However, it is unclear which configuration mechanisms influence these decisions most effectively. That gap is exactly what this protocol is designed to close.

The Experimental Design

The researchers will execute controlled programming tasks drawn from a benchmark of five staged projects, each constructed around identifiable build-versus-buy decisions, measuring whether each tool builds from scratch or adopts an external library, which libraries it selects when adopting one, and how accurately and completely it discloses newly introduced dependencies to the user.

Each project is a realistic codebase with deliberate decision points baked in, for example, a point where the agent must choose between writing a custom JWT implementation or importing a library like python-jose. The configuration supplied to the tool is then systematically varied across conditions:

  1. No configuration: Baseline behavior with no instructions.
  2. Context file with soft preferences: A CLAUDE.md or AGENTS.md that expresses preferred libraries without forbidding alternatives.
  3. Context file with explicit prohibitions: Hard bans on specific packages or categories.
  4. Skills: Autonomously discoverable instruction files that encode library policies.
  5. MCP-enabled library discovery: A connected tool that lets the agent query an approved package registry.
  6. Permission controls: System-level allow/deny lists enforced outside the model's context.

Nine pre-registered hypotheses structure the protocol, examining how these configuration mechanisms shape build-versus-buy decisions in Claude Code and OpenAI Codex. Pre-registration is important here: it means the hypotheses and analysis plan are locked in before any data is collected, preventing the researchers from unconsciously cherry-picking favorable results after the fact.

What the Study Will Actually Measure

Three distinct outcomes are tracked for every task run:

  • Library selection: Which package did the tool choose, and does it match the configured preference or prohibition?
  • Disclosure: Did the tool mention the new dependency in its natural-language reply?
  • Disclosure accuracy: If it did disclose, was the information complete and correct?

The results will provide insights into whether context file instructions reliably change dependency selection, whether prohibitions outperform preferences, which configuration mechanisms exert the strongest influence, and how accurately agentic AI coding tools disclose the dependencies they introduce.

The disclosure question is arguably the most practically urgent. For tool builders, the disclosure findings will identify concrete gaps between what agentic AI coding tools are instructed to report and what they actually report, gaps with direct implications for security and compliance workflows. An agent that silently adds a GPL-licensed library to a commercial codebase, or pulls in a package with a known CVE, is a real supply-chain risk.

What This Is, and What It Is Not

It is worth being precise: this paper is a study protocol, not a results paper. The experiment has not been run yet. What the authors have published is the full experimental blueprint, pre-registered to ensure reproducibility and prevent bias. Think of it as the equivalent of a clinical trial registration, applied to empirical software engineering.

That means there are no findings to report yet on which configuration mechanism wins. The value right now is in the framework itself: the benchmark dataset, configuration artifacts, and analysis code will be released as a reusable instrument for tracking build-versus-buy behavior as agentic AI coding tools develop further.

Why This Matters Beyond the Paper

The broader industry context makes this work timely. An agentic coding tool without control creates significant risk: it may introduce vulnerabilities, adopt unvetted libraries, or bypass established secure coding practices. Security teams are already being advised to ensure agents can only install software from trusted and approved sources to prevent the introduction of malicious dependencies or typosquatting attacks. But that guidance is largely intuition-based right now.

The practical use-cases for this research are direct:

  • Security teams who need to know whether a CLAUDE.md prohibition actually stops an agent from pulling in a vulnerable package.
  • Platform engineers building internal developer tooling who need to enforce approved dependency lists across their organization.
  • Compliance teams in regulated industries who need audit trails of what libraries were introduced and whether they were disclosed.
  • Tool vendors who want to understand the gap between what their configuration systems promise and what they deliver.

The study also has real limitations worth noting. It tests only two tools at fixed model versions, so results may not generalize to Cursor, Gemini CLI, or future model releases. The benchmark covers five staged projects, which may not capture the full diversity of real-world codebases. And because the tools are non-deterministic, the same configuration may produce different choices across runs, a source of noise the protocol will need to account for.

This protocol will produce the first controlled experimental evidence of how configuration mechanisms affect build-versus-buy decisions made by agentic coding tools, filling a gap that has grown more urgent as these tools move from novelty to infrastructure. Whether your CLAUDE.md actually does what you think it does is a question worth having a rigorous answer to.