[tooling] · · 5 min read
Preflight CLI scans Claude Code skills for security risks
A new local tool audits agent instructions and plugins for prompt injection, hidden secrets, and dangerous hooks before you install them.
By ByteBulletin Editor · Editor

AI-generated illustration · Z-Image-Turbo, self-hosted
The problem with agent configuration
Developers increasingly rely on skills, plugins, and hooks to extend the capabilities of AI coding agents like Claude Code. While these extensions improve workflow, they introduce a significant security surface area that is often overlooked. According to the project documentation on DeepWissen, these components are frequently sourced from disparate repositories or shared informally among teammates. Over time, this leads to a fragmented configuration where users lose track of which skills are active, which settings are overriding defaults, and whether any installed component contains malicious code or excessive permissions.
The core issue is that agents obey every instruction file they load. A skill is essentially a Markdown file that dictates behavior, while a plugin can register hooks that execute shell commands. A settings file might pre-approve dangerous commands or route model traffic through third-party servers. Unlike standard software dependencies, which are code you run, these agent extensions are instructions your AI follows and code your AI runs. This distinction makes the risk profile higher, as a compromised skill can manipulate the agent’s reasoning or execute arbitrary commands without explicit user consent for each action.
How Preflight works
Preflight is a local command-line interface designed to act as a security checklist for these agent configurations. It operates on three primary functions: inventory, scanning, and selective installation. First, it lists every item your agent carries, distinguishing between project-level configurations and personal settings in the ~/.claude directory. Crucially, it calculates the token cost each item adds to every prompt, helping developers understand the performance impact of their configuration.
Second, Preflight scans each item for specific threats. The detection engine looks for embedded secrets, prompt injection attempts, hidden Unicode characters, and over-broad tool access. It also analyzes bundled scripts for dangerous commands in both Bash and PowerShell, identifies auto-running hooks, and flags risky MCP servers or settings that redirect traffic or skip permission checks. This scanning happens locally on the user’s machine. The tool sends no telemetry and does not upload scanned content to external servers. The only network activity occurs when the user explicitly chooses to clone skills from a repository.
Third, Preflight facilitates safe installation. When pulling skills from a repository, the tool clones and scans them before they touch the user’s setup. It then presents a list of available skills, highlighting any that are risky and explaining why. This allows developers to install only the specific components they need while rejecting potentially harmful ones. For example, if a repository contains 20 skills but a developer only needs three, Preflight shows the cost and risk profile of each, enabling a targeted installation.
Context and limitations
Preflight is positioned as a security layer on top of native management tools, not a replacement for them. Claude Code’s built-in commands handle the question of "what do I have, and how do I manage it?" Preflight answers the distinct question: "is it safe to trust?" This distinction is important because native tools do not read configurations for malice; they simply manage state. Preflight fills this gap by applying security heuristics to the configuration files themselves.
The tool is part of a broader ecosystem that includes a sibling tool called vet, which scans code and configuration for secrets and risky settings, and an AI Preflight VS Code extension. All three tools share the same detection engine, ensuring that new security detections are propagated across the suite. This unified approach helps maintain consistency in how security risks are identified and reported.
However, the developers are explicit about the limitations of the tool. A clean scan is not a guarantee of safety. Preflight finds known-bad patterns and raises the floor of security, but it does not certify a skill as safe. Sophisticated attacks, such as payloads split across several files or obfuscation techniques that the scanner has not yet encountered, can still bypass detection. The tool prints a warning on every clean result to reinforce this point: a clean result means nothing was found, not that nothing is there. This honesty is designed to prevent users from developing a false sense of security.
What it means for developers
For developers using AI coding agents, Preflight offers a concrete way to audit their configuration before trusting it. The tool is particularly useful in team environments where configuration files are shared. Instead of blindly copying a settings.json file from a teammate, developers can run Preflight to verify that the file does not contain hidden hooks or excessive permissions. This is especially important given that a settings file that saves time might also carry a startup hook or a permission that was never intended to be enabled.
The tool is lightweight and requires minimal setup. It works on macOS, Linux, and Windows, and requires Node 18 or later. For adding skills from a repository, git is also required. The installation process is straightforward, and the tool can be used via npx or installed globally for frequent use. In CI/CD pipelines, Preflight can be used to gate pull requests, ensuring that no malicious or risky configuration changes are merged into the codebase.
Developers should be aware that the tool is a checklist, not a continuous monitoring system. It is designed to be run at specific moments, such as before installing new skills or after updating configuration files. It is not a tool to watch all day. This design choice keeps the tool simple and focused on its core purpose: providing a pre-flight check for the instructions your agent is about to follow.
What to watch
The effectiveness of Preflight depends on its ability to balance detection accuracy with low false positives. The developers note that the tool has blocked Anthropic’s official skills in three separate releases due to false positives, such as reading XSD schema file names as secrets or interpreting placeholder tokens as real credentials. These issues have been fixed and covered by tests, but they highlight the challenge of building a security scanner for a rapidly evolving ecosystem. Users should monitor the project’s release notes for updates to the detection engine and any new false positive fixes.
Additionally, the tool’s ability to detect novel attack vectors will be a key factor in its long-term utility. As AI agents become more prevalent, the methods used to exploit them will likely evolve. Preflight’s detection engine must stay ahead of these threats to remain useful. Users should be cautious about relying solely on the tool and should combine it with other security practices, such as code review and sandboxing.
Finally, the integration of Preflight into CI/CD pipelines is a significant development. By gating pull requests with security scans, teams can enforce a higher standard of security for their AI agent configurations. This could become a best practice in the industry, similar to how dependency scanning is now standard for traditional software projects. Developers should consider adding Preflight to their CI pipelines to catch issues early in the development process.
Get the signal, not the noise.
One short email when it matters. No recaps of recaps.
SHARE
RELATED

[tooling] ·
LM Warden publishes leanprompt audit findings for 20+ open-source repos

[tooling] ·
Fleetlayer launches as control plane for multi-machine AI agents

[tooling] ·
Apple introduces macOS 27.3 security controls for AI agents

[tooling] ·
Anthropic Claude extension backdoored on Cursor for 12 hours

[tooling] ·
PHP2Shell vulnerabilities expose 3.8 million sites to RCE

[tooling] ·