Skip to main content
Glama

scan_skill

Scans an untrusted AI agent-skill directory for known attack patterns before installing or running it. Returns findings and severity to flag risks.

Instructions

Scans a third-party AI agent-skill directory (a SKILL.md manifest plus its bundled hooks/scripts) for known attack patterns before that skill is installed or executed: remote-code-execution hooks (SG02), file-scope escalation (SG03), supply-chain-risky install hooks (SG04), obfuscated payloads (SG05), credential harvesting (SG06), frontmatter spoofing (SG07), prompt injection in the skill's own instructional text (SG08), and marketplace typosquatting (SG10). Call this before installing or running any agent skill you did not author yourself -- the same way you would not execute an unreviewed shell script from a stranger; it has nothing useful to do on skills you already trust.

This is a read-only, offline, side-effect-free operation: every rule pack ships inside the installed wheel, so no network call happens at scan time, and the target's own files are only ever read and pattern-matched, never eval()'d, exec()'d, or imported. Re-running it on an unchanged target is idempotent. Two suppression mechanisms exist in the underlying CLI (.skillguardignore and inline "# skillguard-ignore: SGxx" comments) but this tool never honors either, even if the target ships its own .skillguardignore -- every call runs at full strictness since the target is by definition untrusted. One coverage gap: SG09 (cross-skill privilege chaining across a set of skills) only runs through the separate scan_skill_set()/scan-set CLI path, not through this single-directory tool. An invalid path or unreadable target raises an error rather than returning a silently-clean result.

Parameters: path (string, required) is the filesystem path to the skill directory to scan, e.g. "/skills/pdf-tools" containing SKILL.md plus its hooks/. severity_threshold (string, optional, one of HIGH/MEDIUM/LOW, default HIGH) is the minimum finding severity that flips the result's exit code to non-zero -- lower it to MEDIUM or LOW for a stricter review. timeout_ms (integer, optional, default 10000) caps the per-file scan time in milliseconds; files that exceed it land in the result's timeouts list instead of failing the whole scan. Example calls: {"path": "/skills/pdf-tools"} for a default HIGH-severity scan; {"path": "/skills/pdf-tools", "severity_threshold": "LOW"} to surface every finding; {"path": "/skills/pdf-tools", "timeout_ms": 30000} for a larger skill that needs more per-file time.

Returns a JSON string with: target (the scanned path), filesScanned, severityThreshold, exitCode (0 = clean, 1 = a finding at/above threshold was found, 2 = target/config error), summary (finding counts by severity), findings (a list of {ruleId, category, severity, message, file, line, snippet?}), timeouts (files that hit the per-file limit), unscannedFiles (recognized-but-unsupported-language files), and warnings ({code, message} entries, e.g. for an invalid rule pack). A non-zero exitCode means the skill tripped a finding at or above the configured threshold and should not be trusted without human review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
timeout_msNo
severity_thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and delivers: it declares read-only, offline, side-effect-free behavior, explicitly states that files are never eval'd/exec'd/imported, is idempotent, ignores .skillguardignore, and raises errors on invalid paths. This is exemplary transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Although long, the description is organized into clear paragraphs: purpose/usage, safety behavior, parameters with examples, and return format. Every sentence adds critical information; no filler. The structure leads with purpose and flows logically.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete for a complex tool: it covers purpose, security context, parameter semantics, return value fields, exit code meanings, timeouts, and a known coverage gap. The output schema's existence is reinforced by the detailed return value description, so the description adds value beyond structured fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description compensates fully: path gets an example, severity_threshold gets values and default, timeout_ms gets default and behavioral consequence. Example calls demonstrate realistic usage with each parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb ('Scans') and a clear resource ('third-party AI agent-skill directory'), enumerating the exact attack patterns covered (SG02–SG08, SG10). It also distinguishes from the multi-skill scan_skill_set path for SG09, clarifying scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly instructs when to call the tool ('before installing or running any agent skill you did not author yourself') and when not ('nothing useful to do on skills you already trust'). It also names the alternative for SG09 coverage and warns that suppression mechanisms are ignored, setting clear expectations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RudrenduPaul/skillguard'

If you have feedback or need assistance with the MCP directory API, please join our Discord server