Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/barmplus/locklens/agents-mdgit clone --depth 1 https://github.com/BARMPlus/locklensWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02164 | $0.02164 |
| Opus 5 | $0.01082 | $0.01082 |
| Sonnet 5 | $0.00433 | $0.00433 |
| Haiku 4.5 | $0.00216 | $0.00216 |
Grade A, and why
locklens AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 264 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
本文件用于帮助后续接手本仓库的 Codex / Agent 快速理解项目结构、运行方式与当前约定。
项目定位
locklens 是一个基于 audit-ci 的 lockfile 审计工具,支持两种运行模式:
- MCP Server
- CLI /
npx直接调用
当前能力覆盖:
- 本地项目目录审计
- 远程 Git 仓库审计
npm/yarn/pnpmlockfile 检测- 统一格式的漏洞输出
当前技术栈
- TypeScript
- Node.js ESM
tsup构建tsx运行手动联调脚本prettier+eslint+lint-staged+huskycommitlint@modelcontextprotocol/sdkaudit-ci
关键目录
src/client.ts- 单入口,负责 CLI 与 MCP 双模式
src/cli/- CLI 参数解析与执行
src/audit/- 审计核心实现
src/tests/- 手动联调入口,不是自动化测试
tests/cli/- 正式构建产物驱动的自动化 CLI 测试
审计核心结构
src/audit/service.ts- 审计总入口
runPackageAudit(...)
- 审计总入口
src/audit/lockfile.ts- lockfile 检测
src/audit/adapters/library-audit-adapter.ts- npm / pnpm 审计适配
src/audit/adapters/yarn-cli-audit-adapter.ts- Yarn 专用适配链路
src/audit/git-source/source-resolver.tssource解析:本地目录 / 远程仓库
src/audit/git-workspace/remote-workspace.ts- 远程仓库最小化工作区准备
src/audit/normalizers/- 审计结果归一化
当前输入模型
统一使用 source,不再使用 directory:
- 本地目录:
source: "/path/to/project" - 远程仓库:
source: "https://github.com/org/repo.git"或git@host:group/repo.git
远程仓库协议规则
当前远程协议策略如下:
-
github.com/gitlab.com/gitee.com- 用户传 HTTPS,会先执行一次非交互
ssh -T git@host探测 - 如果探测成功,则自动转换成 SSH 执行
- 如果探测失败或无法明确判断,则继续按 HTTPS 执行
- 用户传 SSH,则按 SSH 执行
- 用户传 HTTPS,会先执行一次非交互
-
其他域名
- 如果用户传的是 HTTP(S),统一转换成 SSH
- 目的是尽量避免内网 Git 服务触发交互式密码弹窗
远程 Git 执行要求:
- 工具不接管交互认证
- 只支持“本机 Git 已具备无交互访问能力”的仓库
- 在真正执行
git clone之前,会先做一次基于 Git 协议的 TCP 连通性预检查,不使用系统ping - 远程连通性预检查默认超时为
5s,若主机不可达、DNS 失败或目标端口不通,会直接报错,不再进入 Git clone 阶段 - 当前远程 provider 分为三类:
GitLab provider- 仅用于
gitlab.com - 仅使用
LOCKLENS_GITLAB_TOKEN
- 仅用于
GitLab Self-Managed provider- 仅用于除
github.com/gitee.com/gitlab.com外的其他 Git 域名 - 当前默认把这些域名视为 GitLab 自建实例候选
- 仅使用
LOCKLENS_GITLAB_PRIVATE_TOKEN
- 仅用于除
Git clone provider- 作为最终兜底路径,保持现有 Git clone 语义
- TCP 连通性预检查是所有远程 provider 的统一前置校验,不属于某一个 provider 内部逻辑
LOCKLENS_GITLAB_TOKEN与LOCKLENS_GITLAB_PRIVATE_TOKEN不混用,也不会交叉回退- Git 命令显式禁用交互提示
- 远程最小工作区除了
package.json与 lockfile 外,也会补齐常见包管理器配置文件:.npmrc.yarnrc.yml.pnpmfile.cjs
- 当前不考虑 monorepo / workspace 语义,因此不会额外拉取
pnpm-workspace.yaml等工作区级配置文件 - locklens 运行时临时资源统一使用
locklens-frontend-audit-*前缀 - 每次审计启动前都会尝试清理系统临时目录下超过
24 小时的同前缀历史残留 - 正常执行结束后仍会立即执行当前工作区 cleanup;启动前清理只是用于兜底异常退出后的遗留目录/文件
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 264 lines · 2,164 tokens per session scan A 0447ff885a9e
locklens AGENTS.md is an instructions file published in the GitHub repository BARMPlus/locklens (83 stars, last pushed 3mo ago), licensed MIT. It adds 2,164 tokens to every session, about $0.0108 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
depsguard AGENTS.md
Instructions for arnica/depsguard, covering agents, project overview, git workflow, ai disclosure and commit messages.
kkRepo protocol-compat.instructions.md
Instructions for klboke/kkRepo, a project described as: kkRepo is a Nexus-compatible, self-hosted artifact repository for Maven, npm, PyPI, Go, Helm, NuGet, Cargo/Rust, Dart/Pub, Docker/OCI, RubyGems, and Yum artifacts. It supports one-click migration from Nexus to kkRepo.
huly-mcp CLAUDE.md
Instructions for dearlordylord/huly-mcp, covering project instructions, design principle: llm-first api, project harness (copy to new projects), package manager and verification.
jentic-one GEMINI.md
Instructions for jentic/jentic-one: Otherwise, read AGENTS.md — this repo's canonical agent guidance.
hig-doctor AGENTS.md
AGENTS.md instructions for raintree-technology/hig-doctor: HIG Doctor combines open-source audit tooling with an attributed snapshot of Apple's Human Interface Guidelines.
briefloop AGENTS.md
Instructions for Stahl-G/briefloop, covering agents.md, purpose, instruction scope, environment separation and context mode.