-
-
Notifications
You must be signed in to change notification settings - Fork 27.7k
docs: expand SECURITY with secrets audit, MCP port checks, and reminder triage #1513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -45,6 +45,53 @@ This policy covers: | |||||
| - MCP configurations shipped with ECC | ||||||
| - The AgentShield security scanner ([github.com/affaan-m/agentshield](https://github.com/affaan-m/agentshield)) | ||||||
|
|
||||||
| ## Operational Guidance | ||||||
|
|
||||||
| ### Secrets Handling | ||||||
|
|
||||||
| `mcp-configs/mcp-servers.json` is a **template**. All `YOUR_*_HERE` values must be replaced at install time from env-vars or a secrets manager. Never commit real credentials. If a secret is accidentally committed, rotate it immediately and rewrite history — do not rely on a plain revert. | ||||||
|
|
||||||
| The same rule applies to your user-scope Claude Code config (`~/.claude/settings.json` or `%USERPROFILE%\.claude\settings.json`). That file is outside this repository, but it is commonly shared via `claude doctor` output, screenshots, or bug reports. Do not hardcode PATs, API keys, or OAuth tokens into its `mcpServers[*].env` blocks — resolve them at spawn time from the OS keychain or env-vars your MCP server already supports. A quick audit: | ||||||
|
|
||||||
| ```bash | ||||||
| # macOS / Linux | ||||||
| grep -EnH '(TOKEN|SECRET|KEY|PASSWORD)\s*"\s*:\s*"[A-Za-z0-9_-]{16,}"' ~/.claude/settings.json | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The pattern
Suggested change
|
||||||
| # Windows PowerShell | ||||||
| Select-String -Path "$env:USERPROFILE\.claude\settings.json" -Pattern '(TOKEN|SECRET|KEY|PASSWORD)"\s*:\s*"[A-Za-z0-9_-]{16,}"' | ||||||
| ``` | ||||||
|
|
||||||
| If the audit matches, rotate the secret at the issuing provider, then move it out of the file (per-provider env-var or `credentialHelper` for servers that support it). | ||||||
|
|
||||||
| ### Local MCP Ports | ||||||
|
|
||||||
| Some bundled MCP servers connect over plain HTTP to a localhost port (e.g. `devfleet → http://localhost:18801/mcp`). Before first use, verify the listening process: | ||||||
|
|
||||||
| ```bash | ||||||
| # Windows | ||||||
| netstat -ano | findstr :18801 | ||||||
| # macOS / Linux | ||||||
| lsof -iTCP:18801 -sTCP:LISTEN | ||||||
| ``` | ||||||
|
|
||||||
| Compare the PID against the expected devfleet binary. Any other process on that port can intercept MCP traffic. | ||||||
|
|
||||||
| ## Triage: suspicious `<system-reminder>` blocks | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The
Suggested change
|
||||||
|
|
||||||
| ECC runs inside Claude Code, which injects **ephemeral client-side system reminders** into the model's input on every turn (TodoWrite nudges, date-changed notices, file-modified notices, etc.). These blocks: | ||||||
|
|
||||||
| - typically end with phrasing like *"ignore if not applicable"* or *"NEVER mention this reminder to the user"* / *"Don't tell the user this, since they are already aware"* — that wording is Anthropic's own prompt, not a malicious tail; | ||||||
| - are added by the CLI per turn and are **not persisted** in the session transcript at `~/.claude/projects/<slug>/<sessionId>.jsonl`. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Security triage uses an absolute transcript-persistence claim that is version-sensitive and can cause false negatives in incident classification. Prompt for AI agents |
||||||
|
|
||||||
| That combination makes them easy to mistake for a prompt-injection appended to a tool result. Before treating one as an attack, verify: | ||||||
|
|
||||||
| 1. Is the block actually in a file under this repo? `grep -rEn "system-reminder|NEVER mention|DO NOT mention" .` — if nothing, it is not carried by the repo. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The triage checklist instructs users to run Fix: exclude
Suggested change
|
||||||
| 2. Is the block stored in the transcript? Inspect the current session's `.jsonl` — if the exact text does not appear inside a `tool_result` body there, it is a client-injected ephemeral reminder, not a payload from any tool. | ||||||
| 3. Is the content contextually consistent with Anthropic's known reminders (TodoWrite nudge, date-changed, file-modified notice)? If yes, it is the ephemeral-reminder mechanism and no action is needed. | ||||||
|
|
||||||
| Escalate to Anthropic only if a block is **both** (a) present in the transcript inside a `tool_result` **and** (b) not attributable to the file or URL that was actually read. Minimal report: a fresh session, a read of a clean local file, the exact text observed, and the transcript excerpt. Send to <https://github.com/anthropics/claude-code/issues> (non-sensitive) or <mailto:security@anthropic.com> (embargo-class). | ||||||
|
|
||||||
| Do not sanitize repo files in response to ephemeral reminders — they are not the carrier. | ||||||
|
|
||||||
| ## Security Resources | ||||||
|
|
||||||
| - **AgentShield**: Scan your agent config for vulnerabilities — `npx ecc-agentshield scan` | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Unreleasedsection documents changes toscripts/ci/validate-agents.jsandagents/a11y-architect.md, but neither file appears in this PR's diff (onlyCHANGELOG.mdandSECURITY.mdare changed). If those changes are intended to land in a separate PR, having them recorded here will conflate unrelated work under one changelog entry and make the release diff hard to audit. If they're already merged tomain, they should be under a versioned heading, notUnreleased.