Skip to main content
Glama

inkog_skill_scan

Scan SKILL.md packages and agent tool definitions to detect security vulnerabilities like tool poisoning, command injection, and supply chain risks. Maps findings to OWASP security standards.

Instructions

Scan SKILL.md packages and agent tool definitions for security vulnerabilities. Detects tool poisoning, command injection, data exfiltration, prompt injection, excessive permissions, obfuscation, supply chain risks, and more. Maps findings to OWASP Agentic Top 10 and OWASP MCP Top 10. Set deep=true for AI-powered deep analysis (~10 min, catches novel threats). For MCP server scanning, use inkog_mcp_scan instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repository_urlNoGitHub repository URL of the skill package
pathNoLocal path to skill package directory
deepNoEnable AI deep analysis

Implementation Reference

  • The handler function `handleSkillScan` performs the actual scanning logic by interacting with the Inkog API and formatting the findings into a readable string.
    async function handleSkillScan(args: Record<string, unknown>): Promise<ToolResult> {
      const parsed = SkillScanArgsSchema.parse(args);
    
      try {
        const client = getClient();
        let response: SkillScanResponse;
    
        if (parsed.repository_url) {
          response = await client.scanSkill({
            repositoryUrl: parsed.repository_url,
          });
        } else if (parsed.path) {
          // For local paths, we'd need to read files and upload
          // For now, return an error suggesting CLI usage
          return {
            content: [
              {
                type: 'text',
                text: 'Local path scanning is best done via the CLI:\n\n```bash\ninkog skill-scan ' + parsed.path + '\n```\n\nFor repository scanning, use repository_url.',
              },
            ],
          };
        } else {
          return {
            content: [
              {
                type: 'text',
                text: 'Please provide either repository_url or path.',
              },
            ],
            isError: true,
          };
        }
    
        if (!response.success || !response.result) {
          return {
            content: [
              {
                type: 'text',
                text: `Skill scan failed: ${response.error ?? 'Unknown error'}`,
              },
            ],
            isError: true,
          };
        }
    
        // Format the results
        const result = response.result;
        const lines: string[] = [];
    
        lines.push(`# Skill Security Scan: ${result.name || 'Unknown'}`);
        lines.push('');
        lines.push(`**Overall Risk:** ${formatRiskBadge(result.overall_risk)}`);
        lines.push(`**Security Score:** ${result.security_score}/100`);
        lines.push(`**Files Scanned:** ${result.files_scanned} | **Lines:** ${result.lines_of_code}`);
        lines.push('');
    
        // Permissions
        if (result.permissions) {
          const p = result.permissions;
          lines.push('## Permissions');
          lines.push(formatPermission('File Access', p.file_access));
          lines.push(formatPermission('Network Access', p.network_access));
          lines.push(formatPermission('Code Execution', p.code_execution));
          lines.push(formatPermission('Database Access', p.database_access));
          lines.push(formatPermission('Environment Access', p.environment_access));
          lines.push(`**Scope:** ${p.scope}`);
    
          if (p.code_execution && p.network_access && (p.file_access || p.environment_access)) {
            lines.push('');
            lines.push('⚠️ **LETHAL TRIFECTA DETECTED:** Code Execution + Network + File/Env Access');
          }
          lines.push('');
        }
    
        // Tools
        if (result.tool_analyses?.length > 0) {
          lines.push(`## Tools (${result.tool_analyses.length})`);
          for (const tool of result.tool_analyses) {
            const riskIcon = tool.risk_level === 'dangerous' ? '🔴' :
                             tool.risk_level === 'moderate' ? '🟡' : '🟢';
            lines.push(`- ${riskIcon} **${tool.name}** [${tool.risk_level}]`);
            if (tool.attack_vectors?.length) {
              for (const v of tool.attack_vectors) {
                lines.push(`  - Attack vector: ${v}`);
              }
            }
          }
          lines.push('');
        }
    
        // Findings
        if (result.findings.length > 0) {
          lines.push(`## Findings (${result.findings.length})`);
          lines.push(`🔴 Critical: ${result.critical_count} | 🟠 High: ${result.high_count} | 🟡 Medium: ${result.medium_count} | 🟢 Low: ${result.low_count}`);
          lines.push('');
    
          for (let i = 0; i < result.findings.length; i++) {
            const f = result.findings[i]!;
            lines.push(`### ${formatSeverityIcon(f.severity)} #${i + 1}: ${f.title}`);
            if (f.file) {
              lines.push(`📁 ${f.file}${f.line ? `:${f.line}` : ''}`);
            }
            if (f.tool_name) {
              lines.push(`🔧 Tool: ${f.tool_name}`);
            }
            lines.push(f.description);
            if (f.owasp_agentic || f.owasp_mcp) {
              const refs: string[] = [];
              if (f.owasp_agentic) refs.push(`OWASP Agentic: ${f.owasp_agentic}`);
              if (f.owasp_mcp) refs.push(`OWASP MCP: ${f.owasp_mcp}`);
              lines.push(`📋 ${refs.join(' | ')}`);
            }
            lines.push(`💡 ${f.remediation}`);
            lines.push('');
          }
        } else {
          lines.push('## ✅ No security findings detected');
        }
    
        // Deep scan flow
        if (parsed.deep && response.scan_id) {
          lines.push('');
          lines.push('---');
          lines.push('## 🔬 Deep Analysis');
          lines.push('Triggering AI deep analysis...');
    
          try {
            await client.triggerSkillDeepScan(response.scan_id);
          } catch {
            lines.push('⚠️ Could not trigger deep analysis. Returning standard results.');
            return {
              content: [{ type: 'text', text: lines.join('\n') }],
            };
          }
    
          const deadline = Date.now() + 15 * 60 * 1000;
          let deepDone = false;
    
          while (Date.now() < deadline) {
            await sleep(5000);
            try {
              const detail: SkillScanDetailResponse = await client.getSkillScan(response.scan_id);
              const status = detail.scan?.ai_scan_status as string | undefined;
    
              if (status === 'completed') {
                const deepOutput = formatDeepFindings(detail.scan);
                if (deepOutput) {
                  lines.push(deepOutput);
                } else {
                  lines.push('✅ Deep analysis completed — no additional findings.');
                }
                deepDone = true;
                break;
              }
              if (status === 'failed') {
                lines.push('⚠️ Deep analysis failed. Standard scan results are shown above.');
                deepDone = true;
                break;
              }
            } catch {
              // Polling error — continue waiting
            }
          }
    
          if (!deepDone) {
            lines.push('⏱️ Deep analysis timed out (15 min). Check the dashboard for results.');
          }
        }
    
        return {
          content: [
            {
              type: 'text',
              text: lines.join('\n'),
            },
          ],
        };
      } catch (err) {
        if (err instanceof InkogAuthError) {
          return {
            content: [{ type: 'text', text: '🔐 Authentication required. Set INKOG_API_KEY environment variable.' }],
            isError: true,
          };
        }
        if (err instanceof InkogRateLimitError) {
          return {
            content: [{ type: 'text', text: '⏳ Rate limited. Please wait and try again.' }],
            isError: true,
          };
        }
        if (err instanceof InkogNetworkError) {
          return {
            content: [{ type: 'text', text: '🌐 Network error. Check your connection and try again.' }],
            isError: true,
          };
        }
        if (err instanceof InkogApiError) {
          return {
            content: [{ type: 'text', text: `❌ API error: ${err.message}` }],
            isError: true,
          };
        }
        throw err;
      }
    }
  • Input validation schema for the skill scan tool parameters.
    const SkillScanArgsSchema = z
      .object({
        repository_url: z
          .string()
          .url()
          .optional()
          .describe('GitHub repository URL of the skill package to scan'),
        path: z
          .string()
          .optional()
          .describe('Local path to the skill package directory'),
        deep: z
          .boolean()
          .optional()
          .default(false)
          .describe('Enable AI deep analysis (slower but catches novel threats)'),
      })
      .refine(
        (data) =>
          data.repository_url !== undefined ||
          data.path !== undefined,
        {
          message: 'Either repository_url or path must be provided',
        }
      );
  • Definition and registration of the 'inkog_skill_scan' tool, which maps the tool name and schema to the handler function.
    export const skillScanTool: ToolDefinition = {
      tool: {
        name: 'inkog_skill_scan',
        description:
          'Scan SKILL.md packages and agent tool definitions for security vulnerabilities. ' +
          'Detects tool poisoning, command injection, data exfiltration, prompt injection, excessive permissions, ' +
          'obfuscation, supply chain risks, and more. Maps findings to OWASP Agentic Top 10 and OWASP MCP Top 10. ' +
          'Set deep=true for AI-powered deep analysis (~10 min, catches novel threats). ' +
          'For MCP server scanning, use inkog_mcp_scan instead.',
        inputSchema: {
          type: 'object' as const,
          properties: {
            repository_url: {
              type: 'string',
              description: 'GitHub repository URL of the skill package',
            },
            path: {
              type: 'string',
              description: 'Local path to skill package directory',
            },
            deep: {
              type: 'boolean',
              description: 'Enable AI deep analysis',
              default: false,
            },
          },
        },
      },
      handler: handleSkillScan,
    };
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: the types of vulnerabilities detected (e.g., tool poisoning, command injection), mapping to OWASP frameworks, and that deep analysis takes ~10 minutes. However, it lacks details on permissions needed, rate limits, or output format, which are important for a security scanning tool.

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?

The description is well-structured and concise: it starts with the core purpose, lists key capabilities, mentions OWASP mapping, explains the 'deep' parameter, and ends with a clear sibling tool distinction. Every sentence adds value without redundancy.

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

Completeness3/5

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

Given no annotations and no output schema, the description is moderately complete. It covers purpose, usage, and some behavioral aspects, but lacks details on output format, error handling, or security implications of the scan itself. For a security tool with 3 parameters, it could benefit from more context on results or limitations.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters. The description adds some context: it explains that 'deep=true' enables AI-powered deep analysis taking ~10 minutes and catching novel threats. However, it doesn't provide additional meaning for 'repository_url' or 'path' beyond what the schema states, so it meets the baseline.

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 clearly states the tool's purpose: 'Scan SKILL.md packages and agent tool definitions for security vulnerabilities.' It specifies the target (SKILL.md packages and agent tool definitions) and the action (scan for security vulnerabilities), and distinguishes it from sibling tools by explicitly mentioning 'For MCP server scanning, use inkog_mcp_scan instead.'

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?

The description provides explicit usage guidance: it specifies when to use this tool (for scanning SKILL.md packages and agent tool definitions) and when not to use it (for MCP server scanning, use inkog_mcp_scan instead). It also mentions the 'deep' parameter for AI-powered analysis, indicating when to enable it for catching novel threats.

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/inkog-io/inkog'

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