upstash/context7 · error

This skill contains potentially malicious content and…

Error message

This skill contains potentially malicious content and cannot be installed.

What it means

In skill.ts installCommand(), after fetching skill metadata via getSkill(), the API may report error === "prompt_injection_detected". The CLI fails the spinner and logs 'This skill contains potentially malicious content and cannot be installed.', refusing installation as a security guard against prompt-injection payloads embedded in the skill.

Solutions

  1. Do not install the flagged skill; choose an alternative, vetted skill
  2. Review the skill repo manually on GitHub to confirm the content is actually malicious
  3. If you believe it is a false positive, contact/flag via the skill's repo or Context7 support for re-review
  4. Pin to a different version/fork of the skill that has been cleaned up

Example fix

// before
// $ context7 skill install some-repo/suspicious-skill
//   ! Prompt injection detected in skill: suspicious-skill
// after
// $ context7 skill install some-repo/cleaned-skill  // vetted alternative
Defensive patterns

Strategy: validation

Validate before calling

const skill = await getSkill(repo, skillName);
if (skill.error === "prompt_injection_detected") {
  console.error("Refusing to install: flagged for prompt injection.");
  return; // check BEFORE writing any files
}

Type guard

function isSafeSkill(skill) {
  return !skill?.error && typeof skill?.name === "string" && skill.error !== "prompt_injection_detected";
}

Try / catch

try {
  const skill = await getSkill(repo, skillName);
  if (skill.error === "prompt_injection_detected") {
    // treat as a security block, not a retryable error
    return;
  }
} catch (e) {
  // network failures only; the injection flag comes back as a normal response
}

Prevention

When it happens

Trigger: Installing a skill whose content triggered Context7's server-side prompt-injection scan: getSkill(repo, skillName) returns skillData.error === "prompt_injection_detected", taking the early-return branch before any GitHub fallback or file writes.

Common situations: Installing third-party community skills that contain instructions like 'ignore previous rules', hidden exfiltration prompts, or obfuscated commands; a repo was flagged/removed upstream; false positives on skills with security-testing content.

Related errors


AI-assisted analysis of upstash/context7@4416fb855b (2026-09-16). Data as JSON: /api/errors/3e84a961b81f2bb1. Report an issue: GitHub.

Appendix: source

Thrown at packages/cli/src/commands/skill.ts:262

    log.blank();
    return;
  }
  const repo = `/${parsed.owner}/${parsed.repo}`;

  log.blank();
  const spinner = ora(`Fetching skills from ${repo}...`).start();

  let selectedSkills: (Skill & { project: string })[];

  // When a specific skill name is provided, fetch only that skill
  if (skillName) {
    spinner.text = `Fetching skill: ${skillName}...`;
    const skillData = await getSkill(repo, skillName);

    if (skillData.error || !skillData.name) {
      if (skillData.error === "prompt_injection_detected") {
        spinner.fail(pc.red(`Prompt injection detected in skill: ${skillName}`));
        log.warn("This skill contains potentially malicious content and cannot be installed.");
        return;
      }

      spinner.text = `Fetching skill from GitHub: ${skillName}...`;
      const ghResult = await getSkillFromGitHub(repo, skillName);
      if (ghResult.status === "repo_not_found") {
        spinner.fail(pc.red(`Repository not found: ${repo}`));
        return;
      }
      if (ghResult.status !== "ok" || !ghResult.skill) {
        spinner.fail(pc.red(`Skill not found: ${skillName}`));
        return;
      }

      spinner.succeed(`Found skill: ${skillName}`);
      selectedSkills = [ghResult.skill];
    } else {
      spinner.succeed(`Found skill: ${skillName}`);

View on GitHub (pinned to 4416fb855b)