concealer
CLAUDE.md17 starsChanged 12 days agoMITView on GitHub
concealer is a local‑only secret manager: a thin wrapper over SOPS + age that adds typed secrets, scoping, a web UI, an audit log, and an MCP server. Read README.md for the product overview.
In this repositoryOne other file it gives its agents.
- docs/llms.txtllms.txt
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 58
passwd2nd factor: keep requiring (and consuming) a recovery code — master password alone must not rotate the key. - Very specific: line 60
Audit tamper‑evidence: keep the monotonic seq in the signed payload and the keys/audit.head anchor check for tail‑truncation.
≈ “Common” is an estimate: at least 1 in 5 of the 28,633 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md — guidance for AI agents working on concealer
concealer is a local‑only secret manager: a thin wrapper over SOPS + age that adds typed secrets, scoping, a web UI, an audit log, and an MCP server. Read README.md for the product overview.
🚨 Security rules (non‑negotiable)
- NEVER commit vault data.
keys/,secrets.enc.yaml,secrets.enc.json, and.sops.yamlare git‑ignored and must stay that way. This repo ships the tool, never a vault. Before anygit add, confirm none of these are staged. - NEVER print real secret values in test output, commits, or messages. Use dummy values (
sk-DUMMY-…) for tests. - NEVER weaken the crypto. All encryption is delegated to
sops/ageon purpose. Do not add a home‑grown cipher, do not store plaintext secrets, do not roll your own KDF. The stdlibscryptverifier and HMAC audit chain are the only crypto concealer itself performs. - Test against an isolated vault, never the user's real one:
CONCEALER_HOME=/tmp/testvault concealer initthen point the web/CLI there. The real vault's master password is the user's and is unknown to you.
Architecture
concealer— single Python 3 script (stdlib only, no pip deps). CLI + web server + MCP server.load()/save()shell out tosops(--config .sops.yaml,--filename-override). Data model is one JSON dict{ "secrets": [ {record}, ... ] }.- A record:
{id, name, type, tenant, project, environment, repo, tags[], url, notes, fields{}, created, updated}. norm()upgrades/legacy‑migrates records on load.entry_public()masks secret fields.- Masking is record‑aware:
rec_field_secret(e, fname)/rec_mask(e, fname, v)resolve secrecy as per‑field override (e["field_meta"][fname] = {"secret": bool, "mask": "partial"|"full"}) → type template (field_is_secret) → name regex → value heuristic (_URL_CREDS: a value with embeddeduser:pass@, e.g.jdbc_url/dsn, is masked even in a "plain" field).entry_public()(web + MCP) and the TUI go through these. Overrides may only add masking by default; a field is shown plain only if the user explicitly setsecret:false. Keep it that way — never let a template‑secret field render plain without an explicit override. - Master password:
write_master()/verify_master()use stdlibhashlib.scryptagainstkeys/master.json(no tty). age passphrase ops (_age_pw) are driven viaexpectbecause age reads/dev/tty, not stdin._age_pw's expect pattern matches the substringpassphrase(NOTpassphrase:) — age's encrypt prompt ends in…one):, sopassphrase:never matches and every call would hang 30 s. - Key‑at‑rest: the age private key is not on disk in plaintext for new vaults.
initremoveskeys/age-key.txtafter makingkeys/age-key.txt.age(master‑pw encrypted)._unlock_key()resolves the key text in order: in‑memory_KEY_CACHE→CONCEALER_TOKENenv (viakeys/agents.json) → legacy plaintextage-key.txtif present (returnsNone→ sops reads the file) → interactive master‑pw prompt on a TTY._env()passes the key to sops viaSOPS_AGE_KEY(memory), never a temp file. Old vaults with a plaintext key keep working unchanged;hardenmigrates them. - Unlock tokens (
keys/agents.json):mint_token()stores per‑token{scrypt‑hash, token‑wrapped age key}; the token value lives only in the client env (CONCEALER_TOKEN), never on disk. Humans get a TTL token viaunlock; agents get a long‑lived, revocable token viaagent register.resolve_token()honours revoke + expiry. - Recovery codes (
keys/recovery.json):initprints 8 one‑time codes (shown once, only scrypt‑hash + code‑wrapped age key stored). Any code recovers the vault viarecover;passwdrequires a code as a 2nd factor (consumed) so a stolen master password alone can't take over.recoveryregenerates the set. - Audit:
audit()appends an HMAC‑SHA256‑chained line tokeys/audit.logwith a monotonicseq;audit_verify()recomputes the chain and compares the tail against thekeys/audit.headanchor to catch tail‑truncation (deleting the last lines). Ceiling:audit.keyis on disk, so a full FS‑root attacker can still re‑forge — documented in theaudit_verifycomment.
webui.html— the SPA. Served by the Python server with__IDLE__replaced at request time. Talks to a JSON API (/api/...). Bilingual (TR/EN) via theI18Ndict +t()+data-i18nattributes. Brand is renderedconceal<span class="ac">er</span>(theersuffix is accent‑colored — house branding rule).
Conventions
- Style: minimal. One file where reasonable, stdlib over dependencies, delegate to
sops/age. Match the existing terse, comment‑where‑subtle style. - Code comments must be English across the whole codebase. User‑facing web strings must still exist in both
trandenin theI18Ndict (those stay bilingual — only comments are English‑only). - Branding rule: product names ending in “er” render the “er” in the accent color. Applied in
webui.html(.brand .ac). - No tool names in user‑facing text. No surface the user sees — CLI output,
--help, TUI, web UI, MCP responses, Chrome extension — may contain the wordssopsorage. Say “vault key” / “encryption engine” instead. Subprocess stderr does name them, so every error string that reaches a user goes throughscrub()(CLIsys.exit, web/api/*error JSON, MCP tool errors, TUI status line) — add new error boundaries to it. Internal names are untouched on purpose:keys/age-key.txt,.sops.yaml,SOPS_AGE_KEY, argv and temp‑file suffixes keep their real names, and comments/docstrings/README/docs/still document the delegation honestly (rule 3 above depends on it being visible to developers). - Timestamps are UTC ISO‑8601 (
now_iso()). - Versioning: single source of truth is
VERSIONinconcealer(surfaced byconcealer versionand MCPserverInfo). concealer went public at1.0.0alongside the mobile app's public release; from here it follows semver (MAJOR.MINOR.PATCH) and the desktop tool + mobile app stay on the same version line. Any user‑visible change bumpsVERSIONand adds a dated entry toCHANGELOG.md(Keep a Changelog format).
Running & testing
# isolated smoke test — init now HARDENS (removes plaintext key) and prints a CLI token
CONCEALER_HOME=/tmp/tv sh -c 'printf "pw\npw\n" | ./concealer init' # prints `export CONCEALER_TOKEN=…` + recovery codes
export CONCEALER_TOKEN=… # CLI ops now need a token (or run `concealer unlock`); grab it from init output
CONCEALER_HOME=/tmp/tv ./concealer get --name A # token-driven, no prompt
CONCEALER_HOME=/tmp/tv ./concealer web 8799 & # web unlock (master pw) holds the key in memory; then curl /api/*
python3 -c "import py_compile; py_compile.compile('concealer', doraise=True)" # syntax checkSelf-checks: python3 test_agent_install.py, python3 test_sync.py (pair/sync end-to-end between two temp vaults, ssh stubbed via CONCEALER_SSH). There are no external test frameworks; verify by exercising the CLI (set CONCEALER_TOKEN), the JSON API (curl /api/unlock then the rest), and the MCP stdio protocol (CONCEALER_TOKEN=… ./concealer mcp with piped JSON‑RPC lines). New commands: unlock, agent register|list|revoke, harden, recover, recovery.
MCP contract
Tools: list_secrets, search_secrets, run_with_secrets, set_secret. The agent must never receive plaintext secret values — run_with_secrets injects into a child env and redact()s values from the returned output. Every MCP call is audited with source=mcp and actor=<agent label>. The MCP server unlocks via CONCEALER_TOKEN in its env (from concealer agent register <name>), resolved once per process — agents are never prompted for a password. Without a valid token on a hardened vault it fails closed (no secret leaks).
- Registration is mandatory:
_mcp_callresolves the token via_mcp_agent()and refuses any call whose token isn't a registered agent (source=="agent"). A CLI/human token or no token → access denied. Keep this gate — it's what stops unregistered agents from reading anything. - Anti-bulk-exfiltration (
rate_gate):list_secrets/search_secretsresults pass throughrate_gate(agent, rows). Two per-agent limits (agent_limits()→CFG["limits"], default{per_call:10, window_quota:25, window_sec:3600}):per_callcaps rows in one response;window_quotacaps distinct secret names revealed in the rolling window across list+search combined. Already-disclosed names re-list free (idempotent) unlesswindow_quota==0, which is a full block. State lives inkeys/ratestate.json(git-ignored; names+timestamps only, never values) so it survives an MCP restart. Limits are edited in the web Settings page (per-agent overrides) viaGET/POST /api/settings(limits+ registeredagents). Don't move enumeration back to a rawfilt()→_fmt()path that skipsrate_gate, and don't apply the gate to the web UI (that's the human owner, unlocked by master password).
Things to preserve when editing
- Key‑at‑rest: never write the age private key to disk in plaintext on a hardened vault. Keep the
_unlock_key()resolution order (cache →CONCEALER_TOKEN→ legacy file → TTY prompt) and pass the key to sops viaSOPS_AGE_KEY(memory), not a temp file. Keep the legacy fallback so old plaintext‑key vaults still work. - Token store: the token value must stay client‑side (
CONCEALER_TOKEN); only its scrypt‑hash + token‑wrapped key go inkeys/agents.json. Preserve revoke/expiry. passwd2nd factor: keep requiring (and consuming) a recovery code — master password alone must not rotate the key.- Recovery codes / master password are shown once; never persist them in plaintext, never print real ones in tests (
sk-DUMMY-…only). - Audit tamper‑evidence: keep the monotonic
seqin the signed payload and thekeys/audit.headanchor check for tail‑truncation. - Passkey unlock (
passkeys()/passkey_add/passkey_key,/api/passkeys*): a passkey is asource:"passkey"token inkeys/agents.jsonwhose value is the WebAuthn PRF output (never stored; cred id + salt are public via/api/passkeys/options). No assertion signature is verified — producing the PRF secret is the proof. Adding/removing needs the master password; the MCP gate still accepts onlysource=="agent"./api/ext/attachgives a trusted extension (Origin in_ext_ids()) its own session only while another session is live. - Locked sign-in queue (
/api/autofill/queue→af_queue/af_flush): saving from the extension needs no session. The record is encrypted toPUBKEYvia_age_enc_to(stdin→stdout, never a plaintext temp file) intokeys/pending/(0600, capped at 50), and merged throughaf_saveon the next web unlock; a file is deleted only after the vault save. Keep the Origin gate (trusted extension IDs from_ext_ids()only) and keep the endpoint write-only — it must never return vault data. - The
_age_pwexpect pattern (passphrase, notpassphrase:) — reverting it makes every age call hang 30 s. - The web unlock path decrypts the backup into memory per session (
_SESS_KEY) — do not reintroduce age/tty prompts into the request path. - Broken‑pipe suppression in the HTTP handler.
- The
.gitignoreprotecting vault data (now alsokeys/audit.head,keys/recovery.json,keys/agents.json). - Idle auto‑lock (server session TTL + client timer) — it also clears
_SESS_KEY/_KEY_CACHE. - Machine sync (
pair/sync/sync-serve): pairing data lives only inside the vault (d["sync_peers"]); the remote's sync token (sourcesync) is held only by the initiating vault and is refused by_unlock_keyand the MCP gate — onlysync_serveresolves it.sync/pairrefuse agent tokens (_UNLOCK_FOR); cron uses a--sync-onlytoken (sourcesync-local, opens the vault only forsync). Keep_rec_ok(schema + timestamp ≤ now+300 s), the mass‑delete guard, the pre‑save snapshot and_vault_lockon every sync merge;inject_envmust keep strippingCONCEALER_TOKEN/CONCEALER_HOME. Records travel only as_age_enc_to()ciphertext (stdin→stdout, never a plaintext temp file). Keepsync-serveJSON‑only on stdout and every pair/sync audited with counts only.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

