Incident Response Procedures — V025-claude-toolkit¶
Response procedures for security incidents affecting the VisiTrans Claude Toolkit. Each incident type follows the standard lifecycle: Detect → Contain → Eradicate → Recover → Learn.
1. Compromised npm Package¶
Detect¶
setup.sh --verifyreports integrity mismatch for an MCP packagenpm auditflags a known vulnerability in an installed package- Security advisory published for a pinned dependency
Contain¶
- Stop all Claude Code sessions using the affected MCP server
- Remove the MCP server:
claude mcp remove <server-name> - Clear npm cache for the affected package:
npm cache clean --force
Eradicate¶
- Identify the compromised version in
configs/security/mcp-package-hashes.yaml - Check npm advisory for the vulnerability details and affected version range
- If the package has a safe version: update the pin in
setup.shand hash manifest - If no safe version exists: remove the MCP server from
setup.shentirely
Recover¶
- Install the verified safe version: run
setup.sh --full - Verify integrity: run
setup.sh --verify - Review recent agent sessions for any suspicious tool calls or file modifications
- Run
/repo-auditto verify no files were tampered with
Learn¶
- Document the incident in a session journal entry:
/vt-c-journal "Incident: compromised npm package [name]" - If the vulnerability was not caught by existing controls, create a SPEC to add detection
- Update
configs/security/mcp-package-hashes.yamlwith the new safe version
2. Secret Leaked to External Service¶
Detect¶
- Secret scanner hook blocks a write containing a credential pattern
capture_thoughtsends content that should have been sanitized- Git pre-commit hook catches a staged secret
- Manual discovery of credentials in logs, thoughts, or committed files
Contain¶
- Immediately revoke the leaked credential (API key, token, password)
- If leaked via
capture_thought: purge the thought from Open Brain if possible - If committed to git: do NOT force-push yet — first assess the blast radius
Eradicate¶
- Rotate all credentials that may have been exposed
- If the secret was committed:
- Create a new commit removing the secret
- Add the file pattern to
.gitignoreif applicable - Consider using
git filter-branchor BFG Repo-Cleaner if the secret was pushed to a remote - Update environment variables with new credential values
Recover¶
- Verify new credentials work: test affected integrations
- Run
setup.sh --verifyto confirm no secrets remain in tracked files - Run
/repo-auditto scan for any remaining credential patterns - Monitor service logs for unauthorized access using the leaked credential
Learn¶
- Document:
/vt-c-journal "Incident: secret leaked via [channel]" - If the leak bypassed the secret scanner: update scanner regex patterns
- If the leak was via
capture_thought: strengthen sanitization rules in CLAUDE.md 10a - Create an intake proposal if a new control is needed
3. Malicious Article/Proposal Injected¶
Detect¶
/inbox-qualifyencounters malformed YAML or suspicious content- Proposal contains unexpected
target_skillnot in manifest - Slug contains path traversal characters after sanitization should have removed them
- Review identifies a routed article containing prompt injection attempts
Contain¶
- Do NOT process the suspicious file further
- Move the file to a quarantine location:
intake/archive/quarantine/ - If the file was already routed: check the destination for any files created by the injection
Eradicate¶
- Remove the malicious file from all locations (inbox, knowledge, pending)
- If a proposal was generated from the malicious content: delete the proposal
- Review
intake/knowledge/for any files created or modified around the same time - Check git history for any unusual commits:
git log --oneline --since="2 hours ago"
Recover¶
- Re-run
/inbox-qualifyon remaining inbox items - Verify knowledge index integrity: check
intake/knowledge/index.jsonfor unexpected entries - Run
/repo-auditto verify no files were placed outside expected directories
Learn¶
- Document:
/vt-c-journal "Incident: malicious article in intake pipeline" - If the injection bypassed validation: strengthen the validation rules in
/inbox-qualify - Create an intake proposal for any new sanitization patterns needed
- Consider adding content-based heuristics for detecting injection attempts
4. Hook Checksum Mismatch¶
Detect¶
/repo-auditreports hook checksum differs fromconfigs/security/trusted-hooks.yaml- Manual inspection reveals unexpected hook content
- Hook behavior changes without a corresponding commit
Contain¶
- Stop all Claude Code sessions in the affected project
- Do NOT run any commands that would trigger the suspect hook
- Identify which hook file has been modified
Eradicate¶
- Compare the modified hook with the expected version:
- If the modification is unauthorized: restore from the toolkit repository
- If the modification is legitimate (new feature): update
trusted-hooks.yamlwith new checksum
Recover¶
- Restore hooks: run
setup.sh --fullto reinstall all hooks from source - Verify integrity: run
setup.sh --verifyand/repo-audit - Review recent session activity for any actions taken while the compromised hook was active
Learn¶
- Document:
/vt-c-journal "Incident: hook checksum mismatch for [hook-name]" - If the modification was unauthorized: investigate how the hook was modified
- Consider enabling
allowManagedHooksOnly: trueif not already set - Evaluate whether a session-start hook verification step is warranted
5. Unauthorized MCP Server¶
Detect¶
claude mcp listshows an MCP server not in the governed list (azure-devops, taskmaster-ai, github, plugin-provided)/repo-healthflags an unknown MCP server- Manual discovery of unexpected server in
~/.claude.json
Contain¶
- Remove the unauthorized server immediately:
claude mcp remove <server-name> - Do NOT interact with the server before removal
- Note the server configuration (name, transport, command, args) for investigation
Eradicate¶
- Check
~/.claude.jsonfor any remaining references to the unauthorized server - Verify no project-level
.mcp.jsonfiles reference the server - If the server was installed via npm: uninstall and clear cache
Recover¶
- Run
setup.sh --verifyto confirm only governed servers are configured - Review recent sessions for any tool calls made via the unauthorized server
- If the server had stdio transport: check for any files created by the server process
Learn¶
- Document:
/vt-c-journal "Incident: unauthorized MCP server [name] discovered" - If the server was added without team knowledge: review who has access to modify MCP configuration
- Consider enforcing
enableAllProjectMcpServers: falsein managed settings - Create an intake proposal if MCP server governance controls need strengthening
General Principles¶
- Evidence first: Before taking destructive actions, capture screenshots, log output, and file contents
- Least disruption: Contain the threat without destroying evidence or disrupting unaffected systems
- Communication: Inform the team immediately for any P0 (credential leak, compromised package) incident
- Documentation: Every incident results in a journal entry and, if appropriate, a SPEC for improved controls
- No blame: Focus on systemic improvements, not individual mistakes