fix(skills): inject published skills when Auto-approve is off (#6643)

With Auto-approve OFF the agent loop asked get_relevant_skills for
min_confidence=2.0, meant as 'published only'. The gate applies the
confidence check to published skills too, and confidence is 0-1, so no
user skill was ever injected, published or not. The explicit-activation
path already treats OFF as status == published.

Add a published_only flag to get_relevant_skills and pass it from both
callers that used the sentinel (relevance injection and the skill
preflight). Auto-approve ON is unchanged: a skill still needs a passing
audit and the confidence threshold.

Fixes #6634
This commit is contained in:
Harshit Ojha
2026-10-13 21:02:23 +01:00
committed by GitHub
parent 0e2c08300e
commit b5b76fe46d
3 changed files with 35 additions and 7 deletions
+10 -3
View File
@@ -745,6 +745,7 @@ class SkillsManager:
min_confidence: float = 0.0,
available_toolsets: Optional[Iterable[str]] = None,
platform: Optional[str] = None,
published_only: bool = False,
) -> List[Dict]:
if skills is None:
skills = self.load_all()
@@ -775,9 +776,15 @@ class SkillsManager:
if not skill.get("platforms") or platform in skill.get("platforms", [])
]
# Prompt injection is fail-closed for user skills. Built-ins are
# shipped procedures; every other skill needs a passing audit and a
# confidence score at the user's current threshold.
if min_confidence > 0:
# shipped procedures. With Auto-approve OFF (published_only), the
# user's publish is the approval; otherwise a skill needs a passing
# audit and a confidence score at the user's current threshold.
if published_only:
skills = [
s for s in skills
if s.get("source") == "builtin" or s.get("status") == "published"
]
elif min_confidence > 0:
def _passes(s):
if s.get("source") == "builtin":
return True