{"record":{"id":"6122af017295e911","repo":"davila7/claude-code-templates","slug":"sem-w004","errorCode":"SEM_W004","errorMessage":"Repetition instruction (potential prompt leakage)","messagePattern":"Repetition instruction \\(potential prompt leakage\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/validation/validators/SemanticValidator.js","lineNumber":105,"sourceCode":"        code: 'SEM_W001',\n        message: 'Suspicious instruction: Role pretending detected',\n        severity: 'medium'\n      },\n      {\n        pattern: /\\b(jailbreak|DAN|ChatGPT\\s+Developer\\s+Mode)\\b/gi,\n        code: 'SEM_W002',\n        message: 'Known jailbreak terminology detected',\n        severity: 'medium'\n      },\n      {\n        pattern: /output\\s+raw\\s+(code|text|data)/gi,\n        code: 'SEM_W003',\n        message: 'Raw output request (potential data exfiltration)',\n        severity: 'low'\n      },\n      {\n        pattern: /(repeat|echo)\\s+after\\s+me/gi,\n        code: 'SEM_W004',\n        message: 'Repetition instruction (potential prompt leakage)',\n        severity: 'low'\n      }\n    ];\n\n    // Sensitive data patterns\n    this.SENSITIVE_DATA_PATTERNS = [\n      {\n        pattern: /(?:password|passwd|pwd)\\s*[:=]\\s*[^\\s]+/gi,\n        code: 'SEM_E011',\n        message: 'Hardcoded password detected',\n        severity: 'critical'\n      },\n      {\n        pattern: /(?:api[_-]?key|apikey)\\s*[:=]\\s*['\"]?[a-zA-Z0-9]{20,}['\"]?/gi,\n        code: 'SEM_E012',\n        message: 'Hardcoded API key detected',\n        severity: 'critical'","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/validation/validators/SemanticValidator.js#L87-L123","documentation":"SEM_W004 is a low-severity warning from checkSuspiciousPatterns when content matches /(repeat|echo)\\s+after\\s+me/gi. 'Repeat after me' phrasing is a classic prompt-leakage technique trying to make the model echo hidden system instructions or secrets. As a suspicious pattern it yields a warning normally and an error in strict mode.","triggerScenarios":"validate() on a component whose content string contains 'repeat after me' or 'echo after me' in any casing/spacing; escalated to an error when options.strict = true.","commonSituations":"Educational/tutoring agents that genuinely ask users to repeat phrases for practice, or markdown that documents social-engineering examples. Both are false positives that nonetheless trip the rule.","solutions":["Reword the instruction, e.g. 'say the following phrase back' or 'recite the snippet'","For language-practice agents, use phrasing like 'read this sentence aloud'","Accept the warning (non-strict runs) if the usage is demonstrably benign"],"exampleFix":"# before\nRepeat after me: const x = 42;\n# after\nRecite this line: const x = 42;","handlingStrategy":"validation","validationCode":"if (/(repeat|echo)\\s+after\\s+me/i.test(component.content)) {\n  // reword to 'recite' / 'say back'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer 'recite'/'say the following' phrasing in tutoring agents","Keep a lint step that greps for known suspicious phrases"],"tags":["prompt-leakage","static-analysis","component-validation"],"backgroundTag":"prompt-injection-pattern","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}