{"record":{"id":"e24a784efbcba981","repo":"Tencent/WeKnora","slug":"skill-not-allowed-s","errorCode":null,"errorMessage":"skill not allowed: %s","messagePattern":"skill not allowed: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/skills/manager.go","lineNumber":264,"sourceCode":"\n\tm.mu.RLock()\n\tdefer m.mu.RUnlock()\n\n\t// Return a copy to prevent external modification\n\tresult := make([]*SkillMetadata, len(m.metadataCache))\n\tcopy(result, m.metadataCache)\n\treturn result\n}\n\n// LoadSkill loads the full instructions of a skill (Level 2)\nfunc (m *Manager) LoadSkill(ctx context.Context, skillName string) (*Skill, error) {\n\tif !m.enabled {\n\t\treturn nil, fmt.Errorf(\"skills are not enabled\")\n\t}\n\n\t// Check if skill is allowed\n\tif !m.isSkillAllowed(skillName) {\n\t\treturn nil, fmt.Errorf(\"skill not allowed: %s\", skillName)\n\t}\n\n\treturn m.resolveSource(skillName).LoadSkillInstructions(skillName)\n}\n\n// isSkillAllowed checks if a skill is in the allowed list\nfunc (m *Manager) isSkillAllowed(skillName string) bool {\n\tif len(m.allowedSkills) == 0 {\n\t\treturn true\n\t}\n\tfor _, name := range m.allowedSkills {\n\t\tif name == skillName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/skills/manager.go#L246-L282","documentation":"Authorization guard in Manager.LoadSkill: isSkillAllowed(skillName) returned false, so the requested skill exists/loads but is not in the allow-list (tenant or deployment policy). It is a policy rejection, deliberately distinct from \"not found\".","triggerScenarios":"Thrown at internal/agent/skills/manager.go:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the skill to the tenant/deployment allow-list if access is intended","Verify the exact skill name matches the allowed entry (case and spelling)","Surface a user-facing permission error rather than retrying"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}