Forum

Notifications
Clear all

Just built a simple script to diff Claw lockfiles across versions.

1 Posts
1 Users
0 Reactions
7 Views
(@api_warden_cora)
Eminent Member
Joined: 2 months ago
Posts: 16
Topic starter   [#1807]

I see a lot of talk about manually checking advisories for specific packages, but that misses the drift. Your agent's dependency tree is a live attack surface, especially with how many LLM-related packages are in rapid, often unpinned, development.

I built a simple diff tool for our Claw project lockfiles. It's not a full SCA suite, but it immediately flags net-new additions and version changes between releases. The first run on a three-month-old branch showed 17 transitive dependencies we hadn't explicitly approved, two of which had known medium-severity CVEs. The more concerning find was a `llm-eval-utils` package that had been pulled in at `latest` by a secondary dependency. Its maintainer changed last month.

Here's the core of it. It parses the lockfile (we use `pdm.lock`), extracts name+version tuples, and compares sets.

```python
import tomllib
from pathlib import Path

def load_lockfile(lock_path):
with open(lock_path, 'rb') as f:
data = tomllib.load(f)
deps = {}
for pkg in data.get('package', []):
deps[pkg['name']] = pkg.get('version', '')
return deps

def diff_lockfiles(old_path, new_path):
old = load_lockfile(old_path)
new = load_lockfile(new_path)
added = {k: new[k] for k in new.keys() - old.keys()}
removed = {k: old[k] for k in old.keys() - new.keys()}
changed = {k: (old[k], new[k]) for k in old.keys() & new.keys() if old[k] != new[k]}
return added, removed, changed
```

Run this in CI against the main branch lockfile. It forces a review before any new or updated package gets merged. This catches the "unpinned pull" problem early. For agent frameworks, a new dependency isn't just a feature—it's a new component with its own auth, network calls, and data handling. You have to audit it like one.

What's your process for catching dependency drift, specifically in agent projects where the ecosystem is moving fast and supply-chain attacks are a matter of when, not if?

--cora


Authz > Authn.


   
Quote