-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: skill:pre-install and skill:post-install Hook Events #23926
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
Add two new hook events —
skill:pre-install(blocking) andskill:post-install(observational) — so that hooks and plugins can automatically scan, warn about, or block potentially dangerous skills before they land on the system.Problem to solve
OpenClaw's docs say: "Treat third-party skills as untrusted code. Read them before enabling." But there's no automated way to enforce this.
When a user runs
clawhub syncor installs a skill via the UI, it lands on disk with zero security checks. The user has to manually read every SKILL.md — and realistically, nobody does this for 50+ skills.The need for automated scanning became clear after the ClawHavoc campaign in January 2026, where Snyk documented that 341 skills on ClawHub were compromised.
To understand the current state of the registry, we built an open-source static analysis scanner (VettAI) and ran it against all 12,986 publicly listed ClawHub skills. Our scanner flagged 568 skills (4.4%) as potentially dangerous based on pattern matching against known attack techniques (shell injection, data exfiltration, credential access, memory poisoning, prompt injection).
Among the findings:
youtube-summarize,auto-updater,solana,phantom) were each published 20–35 times with randomized suffixes — a flooding pattern consistent with the ClawHavoc campaign's distribution techniqueNote: These are static analysis results, not manual verifications. Some findings may be false positives. But even a conservative reading suggests that the registry contains a meaningful number of skills with suspicious patterns that users currently have no automated way to detect before installation.
The current hook system supports
gateway:startup,command:*,message:*, andagent:bootstrap— but nothing fires during skill installation. Security tools have no standard integration point to protect users automatically.Current workarounds all fall short:
Proposed solution
Two new hook events
skill:pre-install(blocking)Fires before a skill is written to disk. Handlers receive the skill content and can block installation:
skill:post-install(observational)Fires after a skill is installed. For audit logging, notifications, and compliance:
Where events fire
clawhub install <skill>clawhub sync --all~/.openclaw/skills/Implementation scope
The hook infrastructure (
triggerInternalHook, handler discovery, HOOK.md metadata) already exists. Main work:src/hooks/types.ts{ block: true }return for pre-install (new pattern, but aligned with the Extended Core Hook proposal's pre-action concept)clawhub syncintegrationThis complements existing proposals: the Extended Core Hook System Proposal (request/response lifecycle) and
tool:call/tool:resultevents (#10502) — this adds the missing skill lifecycle dimension.Alternatives considered
No response
Impact
For users: Third-party skills get scanned automatically before installation. Skills matching known attack patterns are flagged or blocked before they can do damage. No manual review needed.
For the security ecosystem: Tools like VettAI, ClawSec, and SkillAudit get a standard integration point instead of relying on workarounds. This turns "scan your skills" from a recommendation into an enforceable default.
For enterprise adoption: Organizations can enforce skill allowlists, audit every install, and integrate with SIEM systems — all through the existing hook architecture.
For ClawHub trust: A native pre-install scan mechanism raises the security baseline for the entire skill marketplace, which is critical as the registry continues to grow.
Happy to contribute a PR if the approach looks good to maintainers.
Evidence/examples
No response
Additional information
No response