{"record":{"id":"1a722de2c6422953","repo":"davila7/claude-code-templates","slug":"sem-e009","errorCode":"SEM_E009","errorMessage":"Context manipulation attempt detected","messagePattern":"Context manipulation attempt detected","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli-tool/src/validation/validators/SemanticValidator.js","lineNumber":71,"sourceCode":"        code: 'SEM_E006',\n        message: 'Shell access attempt detected',\n        severity: 'critical'\n      },\n      {\n        pattern: /(disable|bypass|override|skip)\\s+(security|safety|filter|protection|validation)/gi,\n        code: 'SEM_E007',\n        message: 'Security bypass attempt detected',\n        severity: 'critical'\n      },\n      {\n        pattern: /always\\s+(obey|follow|comply\\s+with|execute)\\s+the\\s+user/gi,\n        code: 'SEM_E008',\n        message: 'Unconditional obedience instruction detected',\n        severity: 'high'\n      },\n      {\n        pattern: /(forget|disregard|remove)\\s+(everything|all\\s+previous|prior\\s+context)/gi,\n        code: 'SEM_E009',\n        message: 'Context manipulation attempt detected',\n        severity: 'high'\n      },\n      {\n        pattern: /modify\\s+your\\s+(own\\s+)?(code|behavior|instructions?|rules?)/gi,\n        code: 'SEM_E010',\n        message: 'Self-modification request detected',\n        severity: 'high'\n      }\n    ];\n\n    // Suspicious patterns (warnings, not errors)\n    this.SUSPICIOUS_PATTERNS = [\n      {\n        pattern: /\\bpretend\\s+(you\\s+are|to\\s+be)\\b/gi,\n        code: 'SEM_W001',\n        message: 'Suspicious instruction: Role pretending detected',\n        severity: 'medium'","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/validation/validators/SemanticValidator.js#L53-L89","documentation":"SEM_E009 is a high-severity semantic finding matching /(forget|disregard|remove)\\s+(everything|all\\s+previous|prior\\s+context)/gi. It detects context-wiping instructions typical of injection attacks that try to erase system prompts or prior guardrails. The validator emits it whenever the phrase appears in a component's validated content.","triggerScenarios":"Content containing 'forget everything', 'disregard all previous instructions/context', or 'remove prior context' (case-insensitive). Frequently appears in conversation-reset features or in quoted prompt-injection examples.","commonSituations":"Components implementing a 'fresh start' or reset workflow; summarization components that legitimately want to ignore earlier chatter; docs that quote classic 'ignore all previous instructions' attacks.","solutions":["Rephrase reset semantics: 'Treat this message as the start of a new task' instead of 'forget everything'","For summarization, use 'summarize independent of prior turns' rather than 'disregard all previous context'","Keep quoted injection text out of validated fields or paraphrase it","Waive through the review pipeline when the wording is clearly benign and reviewed"],"exampleFix":"// before\nForget everything above and start fresh.\n\n// after\nBegin a new task; earlier conversation is out of scope for this request.","handlingStrategy":"validation","validationCode":"const CTX_RE = /(forget|disregard|remove)\\s+(everything|all\\s+previous|prior\\s+context)/i;\nfunction wipesContext(text) { return CTX_RE.test(text); }","typeGuard":"function isSafeContextText(text) { return !/(forget|disregard|remove)\\s+(everything|all\\s+previous|prior\\s+context)/i.test(text); }","tryCatchPattern":null,"preventionTips":["Express resets as 'start a new task' rather than 'forget everything'","Describe scoping positively ('only this message is in scope')","Paraphrase quoted injection examples"],"tags":["context-manipulation","jailbreak","semantic-validation"],"backgroundTag":"prompt-injection-detected","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}