Add EnigmAgent MCP — Local Secrets Vault cursor rules#268
Add EnigmAgent MCP — Local Secrets Vault cursor rules#268Agnuxo1 wants to merge 5 commits intoPatrickJS:mainfrom
Conversation
New rule: rules/enigmagent-mcp-secrets-cursorrules-prompt-file/ Teaches the agent to route every credential (API keys, OAuth tokens, mnemonics, PEM blocks, connection strings with passwords) through a local AES-256-GCM encrypted vault (enigmagent-mcp) instead of pasting them into chat or source files. Includes detection heuristics, workflow patterns for set/get/list/rotate, and gitignore discipline rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds an EnigmAgent MCP Cursor ruleset and docs plus a README link: detect credential-like inputs, refuse to echo/store them inline, and redirect storage/access to a local AES-256-GCM encrypted vault via Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Agent as Agent
participant MCP as EnigmAgent MCP
participant Vault as Local Vault (encrypted)
User->>Agent: sends message containing credential
Agent->>Agent: detect credential (heuristics)
Agent->>User: request kebab-name to store (do not echo value)
User->>Agent: confirm name
Agent->>MCP: mcp set <name> <value>
MCP->>Vault: encrypt & store entry
MCP-->>Agent: acknowledge (name stored)
Agent-->>User: confirm by name only
alt Runtime use
Agent->>MCP: mcp get <name>
MCP->>Vault: retrieve & decrypt
MCP-->>Agent: return secret (in-memory only)
Agent->>Service: use secret at runtime (do not write to repo)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Line 280: The new README entry "EnigmAgent MCP — Local Secrets Vault" is
appended out of alphabetical order; move the line "- [EnigmAgent MCP — Local
Secrets
Vault](./rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules)" so
it appears between the existing "DragonRuby Best Practices" and "Graphical Apps
Development" entries to restore strict alphabetical order within that "Other"
category, then verify the remaining items in the section remain sorted.
In `@rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules`:
- Line 16: Update the ".gitignore discipline." rule text: remove
`~/.enigmagent/` from the repository `.gitignore` checklist and split the
guidance into two parts — a repository-level list mentioning `.env`,
`.env.local`, `*.pem`, `*.key`, and `id_rsa` that should be committed to the
repo `.gitignore`, and a separate system-level note explaining `~/.enigmagent/`
must be protected outside version control (e.g., added to a user/global
gitignore or otherwise kept out of the repo) so readers know to handle
`~/.enigmagent/` outside the repo `.gitignore`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0cbe8d6d-6292-479b-9373-55bdd018511e
📒 Files selected for processing (3)
README.mdrules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrulesrules/enigmagent-mcp-secrets-cursorrules-prompt-file/README.md
1. README.md: move EnigmAgent entry to correct alphabetical position
in the Other section (between DragonRuby Best Practices and
Graphical Apps Development, as E < G).
2. .cursorrules rule 5: split .gitignore discipline into two layers:
- Repository .gitignore covers .env, .env.local, *.pem, *.key, id_rsa
- System-level (~/.enigmagent/) must use global gitignore or
GIT_DIR/info/exclude — Git does not support tilde expansion in
.gitignore patterns.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks @coderabbitai for the thorough review! Both issues addressed in commit 1a0593f:
|
|
Only users with a collaborator, contributor, member, or owner role can interact with CodeRabbit. |
1. README.md alphabetical order: move 'EnigmAgent MCP' line to its correct
position between 'DragonRuby Best Practices' and 'Graphical Apps Development'
in the 'Other' category. Removes the appended-at-the-bottom anomaly.
2. .cursorrules .gitignore guidance: split the previously conflated rule into
two distinct concerns:
- Rule 5 (repository .gitignore): .env / .env.local / *.pem / *.key / id_rsa
- Rule 6 (system-level): ~/.enigmagent/ lives outside the repo entirely;
protected via global gitignore, not project .gitignore. Includes a heuristic
for the agent to flag if it ever sees ~/.enigmagent/ proposed for a project
.gitignore.
Both fixes match CodeRabbit's review feedback verbatim.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Both CodeRabbit findings addressed:
Thanks for the review @coderabbitai. Both were correct — the appended-at-the-bottom anomaly was sloppy on submit, and the conflated gitignore guidance was technically wrong (Git doesn't tilde-expand patterns). |
|
Only users with a collaborator, contributor, member, or owner role can interact with CodeRabbit. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules (1)
42-46: Consider noting heuristics are non-exhaustive and may produce false positives.The regex set is reasonable, but a couple of small notes worth considering (optional):
AIza[0-9A-Za-z_-]{35}andAKIA[0-9A-Z]{16}are unanchored substrings — fine for a "trigger" heuristic, but worth being explicit that detection is best-effort and intentionally err on the side of pausing.- Other common providers not listed (Stripe
sk_live_…/rk_live_…, Slackxoxa-/xoxs-, GitHub fine-grained PATgithub_pat_…, Anthropicsk-ant-…, Google OAuth refresh tokens, JWTeyJ…shape) could be mentioned as additional triggers, since the rule already calls out JWTs and OAuth refresh tokens in Hard Rule 1.:password@will miss connection strings using a different literal username/identifier in the password slot (e.g.,mongodb://user:S3cr3t@host/...); a looser pattern like://[^/\s:]+:[^/\s@]+@would catch more real cases.Not blocking — this is a prompt rule, and the model is expected to apply judgment beyond the listed patterns.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules` around lines 42 - 46, Update the prompt rule text to explicitly state that the heuristic regexes are non-exhaustive and may produce false positives, and expand recommendations: note that unanchored patterns like `AIza[0-9A-Za-z_-]{35}` and `AKIA[0-9A-Z]{16}` are best-effort triggers, suggest adding additional provider tokens (examples: Stripe `sk_live_…`/`rk_live_…`, Slack `xoxa-`/`xoxs-`, GitHub fine-grained `github_pat_…`, Anthropic `sk-ant-…`, JWT `eyJ…`) as optional triggers, and recommend loosening the connection-string pattern `:password@` to a broader form such as `://[^/\s:]+:[^/\s@]+@` to catch credentials like `mongodb://user:pass@` while preserving the original examples (`sk-[A-Za-z0-9]{20,}` etc.) as illustrative triggers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules`:
- Around line 60-70: The example mcp server config is missing the required
--vault argument which causes enigmagent-mcp to fail at runtime; update the
mcpServers entry for "enigmagent" and add "--vault" plus an absolute vault file
path to the args array for the command invocation (the args array that currently
contains ["-y","enigmagent-mcp"] should include "--vault" and the path),
ensuring the enigmagent-mcp process receives the vault file location.
---
Nitpick comments:
In `@rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules`:
- Around line 42-46: Update the prompt rule text to explicitly state that the
heuristic regexes are non-exhaustive and may produce false positives, and expand
recommendations: note that unanchored patterns like `AIza[0-9A-Za-z_-]{35}` and
`AKIA[0-9A-Z]{16}` are best-effort triggers, suggest adding additional provider
tokens (examples: Stripe `sk_live_…`/`rk_live_…`, Slack `xoxa-`/`xoxs-`, GitHub
fine-grained `github_pat_…`, Anthropic `sk-ant-…`, JWT `eyJ…`) as optional
triggers, and recommend loosening the connection-string pattern `:password@` to
a broader form such as `://[^/\s:]+:[^/\s@]+@` to catch credentials like
`mongodb://user:pass@` while preserving the original examples
(`sk-[A-Za-z0-9]{20,}` etc.) as illustrative triggers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dd65e68a-8f35-4f74-9637-f8ef09e057e0
📒 Files selected for processing (1)
rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules
Critical fix: - MCP server config was missing required --vault argument; added it with an absolute path placeholder plus concrete macOS/Linux and Windows examples using the default ~/.enigmagent/vault.json location. Without --vault the enigmagent-mcp process exits immediately. Nitpick improvements: - Detection heuristics section now explicitly states patterns are best-effort and non-exhaustive (apply judgment, err on pausing). - Added provider patterns: Anthropic sk-ant-, GitHub fine-grained github_pat_, Slack xoxa-/xoxs-, Stripe sk_live_/rk_live_. - JWT trigger clarified (eyJ... header shape). - Connection-string pattern broadened from :password@ to the more general ://[^\s:]+:[^\s@]+@ to catch mongodb://, postgres://, etc. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks again @coderabbitai — both round-2 points addressed in commit c03c9da: 🔴 Critical — 🟡 Nitpick — detection heuristics (lines 42–46)
|
|
Only users with a collaborator, contributor, member, or owner role can interact with CodeRabbit. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules`:
- Around line 83-89: Replace the non-absolute and malformed vault paths in the
mcpServers.enigmagent args array (the "command": "npx", "args": ["-y",
"enigmagent-mcp", "--vault", ...]) with concrete absolute paths (e.g.
"/Users/<you>/.enigmagent/vault.json" for macOS/Linux and
"C:\\Users\\<you>\\.enigmagent\\vault.json" for Windows) and escape backslashes
in the Windows JSON so it is valid JSON; if you intend to rely on enigmagent-mcp
to expand ~ or %USERPROFILE%, first confirm that behavior in the CLI, otherwise
always use explicit absolute paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8fee6025-fea4-410d-acf3-c74eb2d77aa5
📒 Files selected for processing (1)
rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules
Critical fix (verified against published npm tarball): - enigmagent-mcp v1.0.4 index.js line 232 passes --vault path directly to fs with no tilde or env-var expansion whatsoever. - Replace '~/.enigmagent/vault.json' with '/Users/<you>/...' (real absolute path, macOS/Linux). - Replace '%USERPROFILE%\.enigmagent\vault.json' with 'C:\Users\<you>\.enigmagent\vault.json': (a) %USERPROFILE% is not expanded by MCP host / CreateProcess, and (b) the original used invalid JSON escape sequences (\. \v). - Add explicit warning that ~ and %USERPROFILE% are not expanded. - Add ENIGMAGENT_VAULT env-var as the cross-platform alternative. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Round 3 addressed in commit 3265750 — I actually verified the published tarball before fixing: No tilde or Changes:
|
Summary
Adds a new
.cursorrulesrule under Other that teaches the agent to never paste secrets into chat or source files, and to instead route every credential through a local AES-256-GCM encrypted vault — the enigmagent-mcp Model Context Protocol server.Files added
rules/enigmagent-mcp-secrets-cursorrules-prompt-file/.cursorrules— the rule promptrules/enigmagent-mcp-secrets-cursorrules-prompt-file/README.md— overview, benefits, synopsisREADME.mdunder the Other category, alphabetical orderWhat the rule does
sk-...,ghp_..., AWS access keys, BIP-39 mnemonics, PEM blocks, connection strings with embedded passwords..env,*.pem,~/.enigmagent/are gitignored before commits.Why it's useful
Cursor and Claude Code are great at pasting secrets back into your codebase. This rule turns that off and gives the agent a safe place to put them — encrypted with AES-256-GCM + Argon2id, on disk only, no cloud.
EnigmAgent itself: MIT, npm, Glama security A.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Summary by CodeRabbit
Documentation
New Features