Back to skill

Security audit

Kimi

Security checks for vulnerabilities and agentic risk

Overview

This is a Kimi API helper that clearly discloses sending prompts to Moonshot and only saves local workflow notes with user approval.

Install only if you intend to use Moonshot's Kimi API and are comfortable sending selected prompts there. Keep MOONSHOT_API_KEY in environment variables, do not paste keys into chats or logs, confirm before saving ~/kimi/ memory or logs, and redact sensitive customer, internal, or secret-bearing content before API calls.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (13)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · memory-template.md (reported line 15)May include surrounding context.

md
integration: pending | done | declined

## Context
<!-- What the user is trying to achieve with Kimi -->
<!-- Example: Use Kimi as the cheap long-context pass before a stricter local validator -->

## Routes

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · safety-workflows.md (reported line 7)May include surrounding context.

md
Before sending anything non-trivial to Kimi, verify:

1. Does the prompt contain secrets, access tokens, or internal hostnames?
2. Does it include customer identifiers or contract-sensitive text?
3. Can the task succeed with a redacted or metadata-only version?
4. Does the user want this exact content to leave the machine?

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 123)May include surrounding context.

md
- stores lightweight local notes only after user approval

This skill NEVER:
- invent live model availability without checking
- persist secrets in `~/kimi/`
- execute destructive downstream automation from unvalidated output
- treat cost-sensitive or sensitive-send boundaries as implicit

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · api-patterns.md (reported line 25)May include surrounding context.

Minimal Chat Completion

bash
curl -s "${KIMI_BASE_URL}/chat/completions" \
  -H "Authorization: Bearer $MOONSHOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · api-patterns.md (reported line 43)May include surrounding context.

Minimal Chat Completion

bash
curl -s "${KIMI_BASE_URL}/chat/completions" \
  -H "Authorization: Bearer $MOONSHOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 52)May include surrounding context.

md
## Migration Order

1. Replace the base URL with `https://api.moonshot.ai/v1`.
2. Replace the auth env var lookup with `MOONSHOT_API_KEY`.
3. Refresh model IDs from `/models` instead of copying old names.
4. Re-run one minimal request before touching prompts or business logic.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 93)May include surrounding context.

md
## Migration Order

1. Replace the base URL with `https://api.moonshot.ai/v1`.
2. Replace the auth env var lookup with `MOONSHOT_API_KEY`.
3. Refresh model IDs from `/models` instead of copying old names.
4. Re-run one minimal request before touching prompts or business logic.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 94)May include surrounding context.

md
## Migration Order

1. Replace the base URL with `https://api.moonshot.ai/v1`.
2. Replace the auth env var lookup with `MOONSHOT_API_KEY`.
3. Refresh model IDs from `/models` instead of copying old names.
4. Re-run one minimal request before touching prompts or business logic.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · api-patterns.md (reported line 7)May include surrounding context.

md
## Migration Order

1. Replace the base URL with `https://api.moonshot.ai/v1`.
2. Replace the auth env var lookup with `MOONSHOT_API_KEY`.
3. Refresh model IDs from `/models` instead of copying old names.
4. Re-run one minimal request before touching prompts or business logic.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · api-patterns.md (reported line 16)May include surrounding context.

md
## Migration Order

1. Replace the base URL with `https://api.moonshot.ai/v1`.
2. Replace the auth env var lookup with `MOONSHOT_API_KEY`.
3. Refresh model IDs from `/models` instead of copying old names.
4. Re-run one minimal request before touching prompts or business logic.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · migration-playbook.md (reported line 7)May include surrounding context.

md
## Migration Order

1. Replace the base URL with `https://api.moonshot.ai/v1`.
2. Replace the auth env var lookup with `MOONSHOT_API_KEY`.
3. Refresh model IDs from `/models` instead of copying old names.
4. Re-run one minimal request before touching prompts or business logic.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation guidance is broad enough to trigger on generic mentions of 'Kimi', 'Moonshot', 'long-context analysis', or 'Kimi-based coding', which can cause the skill to engage outside the user's actual intent. In a routing and workflow skill, over-broad activation increases the chance of unsolicited persistence, unnecessary data handling prompts, or accidental steering of unrelated conversations into this skill's behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The markdown instructs users to inspect and modify MOONSHOT_API_KEY, which is a sensitive credential. While the steps are operationally reasonable, the document does not warn users to avoid exposing, logging, or sharing the key while troubleshooting.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.