gitwtfhub

wtf is malskanner?

octolabo/malskanner — explained in plain English

Analysis updated 2026-05-18

4TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TL;DR

malskanner scans a code repository for hidden prompt-injection instructions before an AI coding assistant trusts it, returning a refuse, warn, or ok verdict.

Mindmap

mindmap
  root((malskanner))
    What it does
      Scans repos for hidden instructions
      Detects invisible text tricks
      Returns refuse warn or ok
    Tech stack
      TypeScript
      Node.js
      MCP server
    Use cases
      Gate an AI agent before it trusts a repo
      Block risky pull requests in CI
      Check third-party repos before cloning
    Audience
      Developers using AI coding agents
      Security teams
      DevOps and CI maintainers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Scan an unfamiliar repo for hidden prompt-injection before letting Claude Code or Cursor work on it.

REASON 2

Add malskanner as a GitHub Action to block pull requests that hide malicious instructions in text files.

REASON 3

Register malskanner as an MCP tool so your AI agent checks a repo itself before starting.

REASON 4

Get a machine-readable JSON or SARIF report of hidden-instruction findings for security tooling.

What's in the stack?

TypeScriptNode.jsMCPGitHub Actions

How it stacks up

octolabo/malskanner0labs-in/vision-linkadarsh-me/image-sdk
Stars444
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires Node 20 or higher, the optional AI second-opinion mode needs an ANTHROPIC_API_KEY.

Use, modify, and distribute freely, including commercially, as long as you keep the copyright notice.

Wtf does this do

malskanner is a security tool that checks a code repository for hidden instructions before an AI coding assistant, like Claude Code or Cursor, is allowed to read and act on it. The problem it addresses is that when you point an AI agent at a repository, the agent reads everything in it, including the README and comments, and a malicious repository could hide instructions in that text meant to hijack the agent, for example telling it to read your SSH keys or run a harmful command. These hidden instructions can be made invisible to a human reading the same file, using tricks like invisible characters, text that displays in a different order than it is stored, or content encoded so it only reveals itself when decoded. Running malskanner against a repository returns one of three verdicts: refuse, warn, or ok, along with the specific findings behind that verdict, such as an invisible instruction found at a particular line and what it decodes to. All of its detection is done with plain, predictable code rather than another AI model, so the tool itself cannot be tricked by the same hidden instructions it is looking for, and scanning the same repository twice always gives the same result. There is an optional feature that adds a second opinion from an AI model, but that model is only shown the text as plain data and is not given any tools to act with. You can run it directly with no installation using npx, install it globally, use it as a GitHub Action to block a pull request that introduces a hidden payload, or add it as an MCP tool so your AI agent can call it itself and check a repository before starting work on it. The README reports it was tested across 5,620 documentation files from well-known projects with zero false positives, while still catching intentional injection samples. It also supports marking specific lines as intentional examples so they are not flagged. The tool is written in TypeScript, requires Node version 20 or higher, and is licensed under the MIT License.

Yoink these prompts

Prompt 1
Run npx malskanner on this GitHub repo and explain what each finding in the output means.
Prompt 2
Help me add malskanner as a GitHub Action that fails a pull request on a WARN or REFUSE verdict.
Prompt 3
Show me how to register malskanner as an MCP server so my agent scans a repo before trusting it.
Prompt 4
Explain how malskanner detects invisible Unicode-based prompt injection without using another AI model.

Frequently asked questions

wtf is malskanner?

malskanner scans a code repository for hidden prompt-injection instructions before an AI coding assistant trusts it, returning a refuse, warn, or ok verdict.

What language is malskanner written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, MCP.

What license does malskanner use?

Use, modify, and distribute freely, including commercially, as long as you keep the copyright notice.

How hard is malskanner to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is malskanner for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.