Skip to content

feat(agent-audit): cover Claude command/agent/skill/plugin + settings exec surfaces - #94

Closed
sandstream wants to merge 1 commit into
feat/agent-coverage-opencode-codexfrom
feat/claude-surface-coverage
Closed

sandstream wants to merge 1 commit into
feat/agent-coverage-opencode-codexfrom
feat/claude-surface-coverage

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Completes the Claude Code surface-coverage gaps found in the audit. kit audited agent configs (.claude.json/.mcp.json/settings.json) and git-hook files, but several Claude surfaces went unscanned.

New coverage

Settings-declared exec surfaces (auditSettingsCommands, pure):

  • statusLine.command — a shell command run on every status-line render.
  • hooks.<event>[].hooks[].command — run on each matched lifecycle event.

kit scanned git-hook files for malware but not these inline command strings — the same execution surface. Same malware patterns are now applied (fail/high). kit's own <node> cli.js … memory hook entries are inert (no malware shape) → no false positive.

Command / agent / skill / plugin dirs (scanAgentDirs, depth- and size-bounded walk):

  • .claude/commands — slash commands can embed !`bash`
  • .claude/agents — subagents grant tools + carry a system prompt
  • .claude/skills — SKILL.md + scripts
  • .claude/plugins — installed plugin bundles (hooks/commands/MCP/agents)

Each file is flagged for: plaintext secrets (critical), inline-code/malware MCP servers in JSON bundles (high), and malware-shaped command bodies (warn — heuristic, may be documentation rather than live code).

Notes

  • Pure analyzers stay string-in/findings-out; runAgentAudit refactored (extracted scanAgentDirs) to keep complexity in check.
  • Tests: settings statusLine/hooks malware + kit's-own-hook negative; subagent secret; slash-command malware; plugin inline-MCP; clean-tree pass. Full suite 1457/0.

⚠️ Stacked on #87 (→ #75). Merge order: #75 → #87 → this.


🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg


Generated by Claude Code

… exec surfaces

kit audited agent configs (.claude.json/.mcp.json/settings.json) and git
hook *files*, but several Claude Code surfaces went unscanned:

- settings.json declares two code-execution surfaces inline — `statusLine.command`
  (runs every render) and `hooks[].command` (runs per lifecycle event). kit scanned
  git-hook files for malware but not these strings. New `auditSettingsCommands()`
  runs the same malware patterns over them (fail/high). kit's own `<node> cli.js …
  memory hook` entries are inert, so no false positive.
- `.claude/commands` (slash commands can embed `!`bash``), `.claude/agents`
  (subagents grant tools + carry a system prompt), `.claude/skills`, and
  `.claude/plugins` were entirely unscanned. New `scanAgentDirs()` walks them
  (depth/size-bounded) and flags plaintext secrets (critical), inline-code/malware
  MCP servers in JSON bundles (high), and malware-shaped command bodies (warn —
  heuristic, may be documentation).

Pure analyzers stay string-in/findings-out; runAgentAudit refactored to keep
complexity down. Tests: settings statusLine/hooks malware + kit's-own-hook
negative; subagent secret; slash-command malware; plugin inline-MCP; clean tree.
Full suite 1457/0.

⚠️ Stacked on #87 (→ #75). Closes the Claude-surface-coverage gaps from the audit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@sandstream
sandstream deleted the branch feat/agent-coverage-opencode-codex June 24, 2026 04:13
@sandstream sandstream closed this Jun 24, 2026
sandstream added a commit that referenced this pull request Jun 24, 2026
sandstream added a commit that referenced this pull request Jun 24, 2026
….0 (#97)

* recover(#94): feat(agent-audit): cover Claude command/agent/skill/plugin + settings exec surfaces

* recover(#90): feat(audit): SIEM export (CEF / syslog / json)

* chore(release): 1.24.0 — consolidated security batch + recovered #90/#94

Documents the merged hardening batch (#70-89) and bumps the version. The two
recovered features (#90 SIEM export, #94 Claude agent-audit surfaces) were
auto-closed when their stacked base branches were deleted on merge; recovered
here via the PRs' own deltas onto current main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* style: prettier-format recovered #90/#94 files

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@sandstream
sandstream deleted the feat/claude-surface-coverage branch June 30, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants