Module: ClawSec Suite Core

February 25, 2026 ยท View on GitHub

Responsibilities

  • Act as the main skill-of-skills security bundle for OpenClaw-style agents.
  • Verify advisory feed authenticity (Ed25519 signatures and optional checksum manifests).
  • Detect advisory matches against installed skills and emit actionable runtime alerts.
  • Enforce two-step confirmation for risky skill installations.

Key Files

  • skills/clawsec-suite/skill.json: suite metadata, embedded components, catalog defaults.
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/handler.ts: runtime event handler.
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/lib/feed.mjs: signed feed loading/parsing.
  • skills/clawsec-suite/hooks/.../lib/matching.ts: advisory-to-skill matching logic.
  • skills/clawsec-suite/hooks/.../lib/state.ts: scan state persistence.
  • skills/clawsec-suite/hooks/.../lib/suppression.mjs: allowlist-based suppression loader.
  • skills/clawsec-suite/scripts/guarded_skill_install.mjs: advisory-gated installer wrapper.
  • skills/clawsec-suite/scripts/discover_skill_catalog.mjs: remote/fallback catalog discovery.

Public Interfaces

InterfaceConsumerBehavior
Hook handler default exportOpenClaw hook runtimeHandles agent:bootstrap and command:new events.
guarded_skill_install.mjs CLIOperators/automationBlocks on advisory matches unless --confirm-advisory.
discover_skill_catalog.mjs CLISuite docs/automationLists installable skills with fallback metadata.
feed.mjs functionsSuite scripts and testsFeed load, signature verification, checksum manifest checks.
Exit code contractExternal wrappers42 indicates explicit second confirmation required.

Inputs and Outputs

Inputs/outputs are summarized in the table below.

TypeNameLocationDescription
InputAdvisory feed + signaturesRemote URLs or local advisories/ filesRisk intelligence source for hook and installer.
InputInstalled skill metadataSkill directories under install rootMatcher compares installed versions to advisory affected specs.
InputSuppression configOPENCLAW_AUDIT_CONFIG or default config pathsSelective suppression by check and skill name.
OutputRuntime alert messagesHook event messages[]Advisories and recommended user actions.
OutputPersistent state~/.openclaw/clawsec-suite-feed-state.jsonDe-dup alerts, track scan windows.
OutputCLI gating exit codesInstaller process statusEnsures deliberate user confirmation on risk.

Configuration

VariableDefaultModule Effect
CLAWSEC_FEED_URLHosted advisory URLChooses primary remote feed endpoint.
CLAWSEC_LOCAL_FEED* varsSuite-local advisories directoryConfigures local signed fallback artifacts.
CLAWSEC_FEED_PUBLIC_KEYadvisories/feed-signing-public.pemVerification key path.
CLAWSEC_ALLOW_UNSIGNED_FEED0Enables temporary migration bypass mode.
CLAWSEC_VERIFY_CHECKSUM_MANIFEST1Enables checksum manifest verification layer.
CLAWSEC_HOOK_INTERVAL_SECONDS300Controls event-driven scan throttling.

Example Snippets

// hook only handles selected events
function shouldHandleEvent(event: HookEvent): boolean {
  const eventName = toEventName(event);
  return eventName === 'agent:bootstrap' || eventName === 'command:new';
}
// guarded installer confirmation contract
if (matches.length > 0 && !args.confirmAdvisory) {
  process.stdout.write('Re-run with --confirm-advisory to proceed.\n');
  process.exit(EXIT_CONFIRM_REQUIRED); // 42
}

Edge Cases

  • Missing/malformed feed signatures force remote rejection and local fallback attempts.
  • Ambiguous checksum manifest basename collisions are treated as errors.
  • Unknown skill versions are treated conservatively in version matching logic.
  • Suppression is disabled unless config includes the pipeline sentinel (enabledFor).
  • Invalid environment path tokens are rejected to avoid accidental literal path usage.

Tests

Test FileFocus
skills/clawsec-suite/test/feed_verification.test.mjsSignature/checksum verification and fail-closed behavior.
skills/clawsec-suite/test/guarded_install.test.mjsConfirmation gating and match semantics.
skills/clawsec-suite/test/path_resolution.test.mjsHome/path expansion and invalid token handling.
skills/clawsec-suite/test/advisory_suppression.test.mjsSuppression config parsing and matching.
skills/clawsec-suite/test/skill_catalog_discovery.test.mjsRemote index and fallback merge behavior.

Source References

  • skills/clawsec-suite/skill.json
  • skills/clawsec-suite/SKILL.md
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/handler.ts
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/lib/feed.mjs
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/lib/matching.ts
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/lib/state.ts
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/lib/suppression.mjs
  • skills/clawsec-suite/hooks/clawsec-advisory-guardian/lib/version.mjs
  • skills/clawsec-suite/scripts/guarded_skill_install.mjs
  • skills/clawsec-suite/scripts/discover_skill_catalog.mjs
  • skills/clawsec-suite/test/feed_verification.test.mjs
  • skills/clawsec-suite/test/guarded_install.test.mjs
  • skills/clawsec-suite/test/path_resolution.test.mjs