By NHI Mgmt Group Editorial TeamBased on Gecko Security: “RCE in Your Test Suite: AI Agent Skills and the Attack Vector Skill Scanners Miss” (March 11, 2026)

TL;DR: AI agent skills can smuggle malicious test files into a repository, where Jest and Vitest may auto-discover and execute them with local file and environment access, according to Gecko Security. The real governance gap is that skills are being treated as agent-only content when they also become ordinary repo artifacts.


At a glance

What this is: Gecko Security describes how repository-installed AI agent skills can hide executable test files that common JavaScript test runners will automatically discover and run.

Why it matters: This matters because identity and access controls around AI tooling do not stop at the agent boundary when repository artifacts can inherit the trust of developer and CI execution contexts.


Context

AI agent skills are being distributed as repository content, which means the security boundary is no longer limited to what the agent reads or executes directly. Once a skill lands on disk inside the project tree, it can be treated like any other repo artifact by downstream developer tools.

The governance gap is simple: many teams model AI agent skills as an agent-side problem, but test runners, linters, and CI systems operate on the repository itself. That makes skill distribution an identity and supply-chain issue, not just a prompt-injection issue.

In practice, this shifts attention from agent instructions to the files that the installer copies verbatim into shared project space. The article argues that the repo, not the agent, becomes the execution environment that matters most.


Key questions

Q: What breaks when AI agent skills can drop files into a repository that test runners auto-discover?

A: The failure is boundary collapse. A skill installation that copies arbitrary files into the repo lets unrelated tools, such as Jest and Vitest, execute content that was never intended as project code. The result is that trust decisions made for the agent leak into the broader developer toolchain, where environment secrets and local filesystem access may be exposed.

Q: Why do hidden skill directories create risk even when the agent never runs the payload?

A: Because the payload does not need agent execution to be dangerous. If a repository tool recursively scans the project tree, a hidden directory can still contain files that match ordinary execution patterns. The practical risk is that governance focused only on agent instructions misses the downstream runtime path created by the repo itself.

Q: How should security teams handle AI agent skills that land in a repository?

A: They should treat them as repository supply-chain inputs, not just agent instructions. Review the full directory tree, not only the markdown file, because bundled tests and configs can execute through normal developer tooling. The safest pattern is allowlisting approved file types at installation time and excluding imported skill directories from test discovery in both local and CI environments.

Q: What is the difference between agent-side scanning and repository-level containment for AI skills?

A: Agent-side scanning inspects what the AI is told to read or run, while repository-level containment controls what other tools will later treat as trusted project content. The latter is broader and more relevant here because the danger comes from the repo artifact being discovered by test runners, linters, or CI rather than by the agent itself.


Technical breakdown

How repository-installed skills become trusted artifacts

The installer described in the article copies an entire skill directory into the project, not just the SKILL.md file. That matters because repository tooling does not distinguish between content intended for the agent and content that looks like normal project files. Any bundled tests, configs, or helper scripts can therefore inherit the trust of the repository once they are on disk. The risk is not that the agent executes the file directly, but that other tooling in the development environment treats it as ordinary project material. Practical implication: treat skill installation as repository write access, not just agent configuration.

Practical implication: restrict what file types may land in the repo when skills are installed.

Why Jest and Vitest expose the hidden path

Both Jest and Vitest recursively discover test files across the project tree, and the article notes that they enable dot-directory traversal rather than skipping hidden folders by default. That means files placed under hidden skill directories can still match test globs if their names fit common test patterns. The important point is architectural: discovery happens independently of the agent, so a file added for one purpose can be executed by a completely different tool. Practical implication: align test discovery rules with any directory used to store imported skills.

Practical implication: exclude imported skill directories from recursive test discovery.

Why scanners miss the payload in bundled test files

The scanners discussed in the article focus on SKILL.md content and explicit scripts invoked by the agent. A malicious test file bypasses that model because it is not part of the documented agent execution surface, yet it still executes when the developer runs tests or when CI collects them. This is a classic boundary mismatch between content inspection and runtime discovery. The payload succeeds because the trust decision happens after installation, not at scan time. Practical implication: inspect the full directory payload before copy, not only the agent instructions.

Practical implication: inspect all bundled files before installation, including tests and configs.


Threat narrative

Attacker objective: The attacker wants to turn a benign-looking skill install into a repeatable path for stealing local and CI secrets from developer repositories.

  1. Entry occurs when an attacker publishes a seemingly legitimate skill package with a clean SKILL.md and a hidden test payload inside the repository bundle.
  2. Privilege is obtained when the developer installs the skill and the installer copies the entire directory into the project, placing the payload inside a trusted repo path.
  3. Execution happens when Jest or Vitest recursively discovers the hidden test file and runs it during local testing or CI, giving the payload shell and environment access.
  4. Impact is credential theft and silent exfiltration from developer machines or CI runners, with the malicious file persisting in git history and propagating to clones.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Repository trust, not agent trust, is the real control plane: skills that land in a project can inherit the execution privilege of the repository itself, regardless of whether the agent ever touches the payload. That breaks the common assumption that agent-side scanning is enough to manage skill risk. The security question shifts to what else the repo tooling will auto-execute once the files are copied in. Practitioners should govern imported skills as repository supply-chain content.

Test discovery is an identity boundary, not just a developer convenience: recursive globbing turns hidden skill directories into reachable execution paths when test files are present. This is not a prompt-injection problem in the narrow sense, because the attack succeeds even if the agent ignores the skill contents. The control gap is that repository tooling trusts file naming conventions more than provenance. Practitioners should treat recursive discovery rules as part of the attack surface.

Skill marketplaces need file-type allowlists, not content-only scanners: the article shows that a clean SKILL.md can coexist with a malicious payload in an adjacent file. That makes content inspection necessary but insufficient, because the dangerous artifact is the directory structure itself. This is a supply-chain pattern, not an isolated file-review problem. Practitioners should assume any imported skill may carry executable baggage unless the installer constrains what lands on disk.

Hidden execution surface: the dangerous assumption is that only the agent can act on skill content. That assumption fails when the repository and its tooling automatically trust imported files, allowing skill bundles to become ordinary project code. The implication is that governance must extend to the installer, the repository layout, and the tools that later interpret those files.

Developer toolchains now need repo-level provenance checks for AI skills: the article points to a broader control gap where software supply chain hygiene and AI governance overlap. Skills are becoming a new packaging format for arbitrary code-bearing artifacts, which means teams need to review them like any other imported dependency. The practical conclusion is that repo trust must be reduced before the skill reaches test or CI execution.

From our research library:

What this signals

Skills have become a repository trust problem: once an imported skill is copied into the project tree, its files can be consumed by tools that were never designed to assess AI content. That means security teams need to review the installer boundary, not just the agent prompt boundary, because the repo itself is now part of the execution chain.

Hidden execution surface: when test discovery includes dot-directories, imported skills can carry payloads into places developers already trust. The practical response is to align skill governance with repo hygiene, CI exclusions, and package-like intake checks rather than relying on content-only scanners.

The broader signal is that AI-assisted development is starting to resemble earlier software supply-chain problems: the risk is not only what an artifact says, but where the artifact lands and which tools will automatically interpret it. Governance should therefore focus on containment before execution, especially in shared repositories and CI runners.


For practitioners

  • Exclude imported skill directories from test discovery Add hidden skill paths such as .agents/ to Jest and Vitest ignore lists so recursive test globs do not treat imported skill files as project tests.
  • Enforce file-type allowlists at install time Allow only expected skill assets such as SKILL.md, scripts, references, and approved static assets when copying a skill into the repository.
  • Block test and config files in skill bundles Reject files matching patterns like *.test.*, *.spec.*, __tests__, and *.config.* unless a reviewer explicitly opts in for a legitimate reason.
  • Harden CI against hidden repository payloads Mirror the same skill-directory exclusions in pipeline configuration so build and test jobs do not execute files introduced through imported skills.
  • Review imported skills as supply-chain artifacts Treat every third-party skill as a packaged dependency with execution consequences, not as markdown documentation that can be trusted after a cursory scan.

Key takeaways

  • Repository-installed AI skills can become active code paths when hidden files are auto-discovered by common test runners.
  • The article shows that the dangerous boundary is the repository, not the agent, because copied skill files inherit developer and CI trust.
  • Teams need installer allowlists, discovery exclusions, and CI hardening to stop ordinary tools from executing imported skill payloads.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10, OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI04 — Agentic Supply Chain VulnerabilitiesImported skills with hidden payloads create a supply-chain weakness in agentic tooling.
ASI02 — Tool MisuseAuto-discovered test files let ordinary tooling execute content outside the agent's intended scope.
Recommendation — Apply ASI04 to restrict what files an AI skill package may introduce into a repository. Use ASI02 to prevent repository tools from executing imported skill artifacts unintentionally.
OWASP Non-Human Identity Top 10NHI-03 — Vulnerable Third-Party NHIThird-party skill bundles can smuggle executable content into trusted development environments.
Recommendation — Apply NHI-03 to review third-party skill packages before they reach shared repositories.
MITRE ATT&CKTA0003;TA0006;TA0011 — Persistence; Credential Access; Command and ControlThe payload persists in the repo, accesses secrets, and exfiltrates them from the runner.
Recommendation — Map hidden skill payloads to TA0003, TA0006, and TA0011 to inform detections and containment.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article is fundamentally about extending or constraining what repository artifacts can execute.
Recommendation — Apply PR.AA-05 to limit which imported artifacts can influence build and test execution.

Key terms

  • Repository-installed skill: A repository-installed skill is an AI agent skill that has been copied into a project directory and treated as local content. In practice it becomes part of the software supply chain, because downstream tools may process its files just like any other repository artifact.
  • Recursive test discovery: Recursive test discovery is the mechanism test runners use to scan the project tree for files that match test naming patterns. When hidden directories are not excluded, this process can execute files that were never meant to be part of the application codebase.
  • Hidden execution surface: A hidden execution surface is any file path that can be triggered by ordinary developer tooling without being obvious to the operator. For AI skills, this often means payloads that live outside the agent prompt but still fall inside repository, CI, or test-runner scope.
  • Skill bundle allowlist: A skill bundle allowlist is a rule set that limits which file types may be copied into a repository when an AI skill is installed. It reduces supply-chain risk by preventing arbitrary executable or configuration files from landing in trusted project space.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM or identity security programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org