agentmask CLAUDE.md

agentmask CLAUDE.md is an instructions file for coding agents from adithyan-ak/agentmask. It costs 2,326 tokens per session, scanned A, original, MIT.

A security guide and integration layer for AI coding assistants that blocks access to secrets such as API keys, passwords, and connection strings. It supports Claude Code and Cursor and uses secret-scanning checks to detect exposed credentials.

In plain words
What is it for?
Use it to protect secrets while working with Claude Code or Cursor. It can scan code, block listed files or values, and catch passwords, credential-bearing connection strings, and several provider-specific token formats.
Why use it?
It helps prevent an AI assistant from reading, leaking, or committing sensitive values in a codebase. A shared blocklist and checks from more than one scanner cover different kinds of secret patterns.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/adithyan-ak/agentmask/claude-md
Clone the repo
git clone --depth 1 https://github.com/adithyan-ak/agentmask

Wrote 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.

agentmods badge for agentmask CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/adithyan-ak/agentmask/claude-md.svg)](https://agentmods.dev/instructions/adithyan-ak/agentmask/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/adithyan-ak/agentmask/claude-md"><img src="https://agentmods.dev/badge/instructions/adithyan-ak/agentmask/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,326 This file is loaded in full into every session.
When invoked 2,326 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.02326 $0.02326
Opus 5 $0.01163 $0.01163
Sonnet 5 $0.00465 $0.00465
Haiku 4.5 $0.00233 $0.00233

Measured 5d ago against content hash 336b257162b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agentmask CLAUDE.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 5d 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.

CLAUDE.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

agentmask — Contributor Context

What This Is

agentmask is an open-source secrets firewall for AI coding agents. It prevents Claude Code, Cursor, and other AI assistants from reading, leaking, or committing secrets like API keys, tokens, passwords, and connection strings.

agentmask's value is the IDE integration layer — hooks, blocklist, MCP server, behavioral rules. Currently supports Claude Code and Cursor with auto-detection. Primary detection is delegated to gitleaks (150+ battle-tested rules). An agentmask scanner (src/scanner/tier2.ts) runs as a second pass to catch patterns gitleaks's generic-api-key rule deliberately excludes: password/passwd/pwd field assignments, connection strings with embedded credentials, and provider prefixes without dedicated gitleaks rules (whsec_, GOCSPX-).

Architecture

agentmask = IDE integration layer (Claude Code + Cursor)
  ├── Scanner backend: gitleaks (150+ rules, auto-downloaded if not installed)
  ├── agentmask scanner: complementary TS regex pass (password fields, conn strings, whsec_, GOCSPX-)
  ├── Blocklist manager (.agentmask/blocklist.json, shared between IDEs)
  ├── IDE adapters (src/ide/targets.ts — hook format, rules format, config paths per IDE)
  ├── Hooks (pre-read, pre-write, pre-bash, post-scan) with --format adapter
  ├── MCP server (safe_read, env_names, scan_file, scan_staged)
  └── Behavioral rules (per-IDE: .claude/rules/*.md, .cursor/rules/*.mdc)

Three Reinforcing Layers

Layer 1: BLOCK (PreToolUse hooks)
  → Pre-read: static path patterns + dynamic blocklist lookup (no subprocess, <5ms)
  → Pre-write: gitleaks + agentmask scan on content via temp file (~200ms)
  → Pre-bash: pattern match on commands + gitleaks scan on staged files for git commit
  → Post-scan: gitleaks + agentmask scan on tool output, warns + auto-adds to blocklist

Layer 2: REDIRECT (MCP server)
  → safe_read: reads file, uses merged gitleaks + agentmask findings to redact secrets
  → env_names: lists .env variable names without values
  → scan_file / scan_staged: explicit scans (scan_file also runs agentmask scanner)

Layer 3: INSTRUCT (.claude/rules/agentmask.md)
  → Behavioral rules telling the agent to prefer safe_read
  → Installed automatically by `agentmask init`

Read the full file on GitHub · 185 lines

Changes

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.

  1. 5d ago First seen · 185 lines · 2,326 tokens per session scan A 336b257162b8

Subscribe to this mod's changes

agentmask CLAUDE.md is an instructions file published in the GitHub repository adithyan-ak/agentmask (12 stars, last pushed 5mo ago), licensed MIT. It adds 2,326 tokens to every session, about $0.0116 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.

Related

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).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,733 tokens