{"record":{"id":"3e84a961b81f2bb1","repo":"upstash/context7","slug":"this-skill-contains-potentially-malicious-content","errorCode":null,"errorMessage":"This skill contains potentially malicious content and cannot be installed.","messagePattern":"This skill contains potentially malicious content and cannot be installed\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/skill.ts","lineNumber":262,"sourceCode":"    log.blank();\n    return;\n  }\n  const repo = `/${parsed.owner}/${parsed.repo}`;\n\n  log.blank();\n  const spinner = ora(`Fetching skills from ${repo}...`).start();\n\n  let selectedSkills: (Skill & { project: string })[];\n\n  // When a specific skill name is provided, fetch only that skill\n  if (skillName) {\n    spinner.text = `Fetching skill: ${skillName}...`;\n    const skillData = await getSkill(repo, skillName);\n\n    if (skillData.error || !skillData.name) {\n      if (skillData.error === \"prompt_injection_detected\") {\n        spinner.fail(pc.red(`Prompt injection detected in skill: ${skillName}`));\n        log.warn(\"This skill contains potentially malicious content and cannot be installed.\");\n        return;\n      }\n\n      spinner.text = `Fetching skill from GitHub: ${skillName}...`;\n      const ghResult = await getSkillFromGitHub(repo, skillName);\n      if (ghResult.status === \"repo_not_found\") {\n        spinner.fail(pc.red(`Repository not found: ${repo}`));\n        return;\n      }\n      if (ghResult.status !== \"ok\" || !ghResult.skill) {\n        spinner.fail(pc.red(`Skill not found: ${skillName}`));\n        return;\n      }\n\n      spinner.succeed(`Found skill: ${skillName}`);\n      selectedSkills = [ghResult.skill];\n    } else {\n      spinner.succeed(`Found skill: ${skillName}`);","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/upstash/context7/blob/4416fb855b8f752be735e34f943b5d0762701aad/packages/cli/src/commands/skill.ts#L244-L280","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Do not install the flagged skill; choose an alternative, vetted skill","Review the skill repo manually on GitHub to confirm the content is actually malicious","If you believe it is a false positive, contact/flag via the skill's repo or Context7 support for re-review","Pin to a different version/fork of the skill that has been cleaned up"],"exampleFix":"// before\n// $ context7 skill install some-repo/suspicious-skill\n//   ! Prompt injection detected in skill: suspicious-skill\n// after\n// $ context7 skill install some-repo/cleaned-skill  // vetted alternative","handlingStrategy":"validation","validationCode":"const skill = await getSkill(repo, skillName);\nif (skill.error === \"prompt_injection_detected\") {\n  console.error(\"Refusing to install: flagged for prompt injection.\");\n  return; // check BEFORE writing any files\n}","typeGuard":"function isSafeSkill(skill) {\n  return !skill?.error && typeof skill?.name === \"string\" && skill.error !== \"prompt_injection_detected\";\n}","tryCatchPattern":"try {\n  const skill = await getSkill(repo, skillName);\n  if (skill.error === \"prompt_injection_detected\") {\n    // treat as a security block, not a retryable error\n    return;\n  }\n} catch (e) {\n  // network failures only; the injection flag comes back as a normal response\n}","preventionTips":["Only install skills from trusted, reviewed repositories","Read the skill's source on GitHub before installing","Prefer skills with high install counts and active maintenance","Never bypass the injection warning — treat it as a hard block"],"tags":["security","prompt-injection","skill-install"],"backgroundTag":"prompt-injection-detected","analyzedSha":"4416fb855b8f752be735e34f943b5d0762701aad","analyzedAt":"2026-09-16T20:28:07.148Z","contentChangedAt":"2026-09-16T20:28:07.148Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}