Skip to content
中文

How the security audit scores

An audit runs when you click Run Audit or run hk audit, and right after you install a skill from Marketplace, Git or a local folder. Install to Agent audits the new copy only if the source skill has a recorded source. Other installs and every update wait for the next full audit.

  1. Read the extension. A skill’s SKILL.md, an MCP server’s command, arguments, environment and headers, a hook’s command, or a plugin’s script files. For a CLI, its entry in a built-in list and its install method.
  2. Strip invisible characters. Zero-width characters then cannot break up a pattern.
  3. Run the 20 rules. Each finding has a severity.
  4. Deduct points. The first finding of a rule costs 25 points if Critical, 15 if High, 8 if Medium and 3 if Low. Each further finding of the same rule costs 1 point. The score stops at 0.
  5. Assign a tier. 80 or more is Safe, 60 to 79 is Low Risk, and below 60 is Needs Review.

A skill with one prompt-injection finding and no known source scores 100 − 25 − 3 = 72, which is Low Risk.

Names match the Security Audit page.

SeverityRules
CriticalPrompt Injection, Remote Code Execution, Plaintext Secrets, Safety Bypass
HighBroad Permissions, Permission Combination Risk, CLI Credential Storage, MCP Command Injection
MediumSkill Invocation Key Case, dsh !!js Env Without Fallback, Supply Chain Risk, CLI Network Access, CLI Permission Scope
LowUnknown Source
Two levelsCredential Theft (Critical or High), Dangerous Commands (High in hooks, else Medium), CLI Binary Source (High or Medium), CLI Aggregate Risk (High or Low), Plugin Source Trust (Medium or Low), Plugin Lifecycle Scripts (Medium or Low)

The text rules look for:

  • Prompt Injection checks skills and plugins for “ignore previous instructions”, “disregard previous”, “you are now a”, “new system prompt”, “override system prompt” and [SYSTEM].
  • Remote Code Execution looks for curl or wget piped into a shell, a curl download to /tmp/ that is then run, base64 -d piped onward, and eval(.
  • Credential Theft looks for ~/.ssh keys, known_hosts and config, .env, .netrc, .pgpass and cloud credential files. It is Critical when the text also sends data out.
  • Plaintext Secrets looks for words that start with sk-, ghp_, gho_, AKIA, xoxb- or xoxp-, in text and in MCP environment and header values.
  • Safety Bypass looks for --no-verify, --force, --yes, allowedTools: "*", and sentences about skipping or bypassing a confirmation.

HarnessKit infers five kinds of access during a scan. They are labels to review, not limits it enforces.

  • File System. Paths such as ~/… or /etc/… in a skill or hook, or absolute paths in MCP arguments. Every skill shows this kind.
  • Network. Domains from http:// and https:// URLs. An npx or uvx MCP server always gets any domain (*). A remote MCP server gets its host.
  • Shell. The first word of each line in a skill’s bash, sh, zsh or shell code blocks, or an MCP server’s or hook’s command.
  • Database. Mentions of PostgreSQL, MySQL, MariaDB, SQLite, MongoDB or Redis.
  • Environment. MCP servers only: the names of environment variables and headers, never the values.

For a plugin, HarnessKit reads the script and .json files at the top of its folder, not its subfolders, and every plugin shows Shell and File System. A CLI combines its binary’s known API domains and credential file with its child skills’ and MCP servers’ permissions.

  • crates/hk-core/src/auditor/rules.rs lists the 20 rules in run order.
  • crates/hk-core/src/auditor/rules/ holds each rule’s patterns.
  • crates/hk-core/src/auditor/mod.rs strips invisible characters and computes scores.
  • crates/hk-core/src/scanner.rs infers permissions during a scan.
  • crates/hk-core/src/service.rs decides what each extension’s audit reads.