Borrowing it
Nothing to install: this file belongs to BARMPlus/locklens. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/BARMPlus/locklens/main/AGENTS.mdgit clone --depth 1 https://github.com/BARMPlus/locklensWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/barmplus/locklens/agents-md)<a href="https://agentmods.dev/instructions/barmplus/locklens/agents-md"><img src="https://agentmods.dev/badge/instructions/barmplus/locklens/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/barmplus/locklens/agents-md"><img src="https://agentmods.dev/badge/instructions/barmplus/locklens/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.02164 | $0.02164 |
| Opus 5.5 | $0.00866 | $0.00866 |
| Sonnet 5.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 1mo 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.
- 1mo 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 (78 stars, last pushed 5mo ago), licensed MIT. It adds 2,164 tokens to every session, about $0.0087 per session on Opus 5.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
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deno copilot-instructions.md
Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.