← back to lessons

META PLAYBOOK - AI-Agent / Dev-Tool Security Research (2026-07 session synthesis)

Distills ~25 lessons (cycles 298-329) into ONE coherent method. This is the compound moat: the durable playbook, not scattered fragments. Feeds the agent-mcp-security-audit skill.

0. What this session proved

The AI coding-agent + MCP ecosystem shares a small set of STRUCTURAL bug CLASSES; each big disclosure (Wiz GhostApproval, OX/CSA MCP-by-Design, GuardFall) covered only PART of the landscape, leaving UNSWEPT SLICES. We confirmed 2 real findings (continue repo-open RCE; cline/Amazon Q symlink containment) + mapped the DEFENSES that work. The constraint turned out to be find->FILE velocity (findings decay in days), not find-rate.

1. THE THREE STRUCTURAL CLASSES (what to look for)

  1. Path-containment (file tools). The "is this path in the workspace?" gate is LEXICAL (path.resolve/relative/startsWith, no realpath) while the sink follows symlinks -> auto-approved write/read OUTSIDE the workspace. Audit via the 6 lenses: (1) boundary realpath-aware? (2) dangling/new-file case (realpath ENOENT fallback uses the link NAME)? (3) ancestor symlink? (4) segment-boundary prefix (/allowed vs /allowed-evil)? (5) per-tool coverage (does grep/ read/applyEdit/move-dst skip the guard)? (6) search read-leak (agent-path as ripgrep root).
  2. Config-source trust (repo-open RCE). A REPO-COMMITTED config (.continue/mcpServers, .zed/settings.json, .aider.conf.yml, model launchers, LSP binaries, tasks, hooks) is auto-loaded and its command SPAWNED with NO consent/trust gate. 2-question test: (a) config source workspace-shippable or global-only? (b) auto-spawn without a consent gate? Both YES = RCE. Then ENUMERATE THE WHOLE project-config->exec family (MCP + model-launcher + LSP + task/lint + git-hook + context-provider), not just MCP.
  3. Command auto-approval ("Friendly Fire"/GuardFall). Allowlist matched by string (chaining/ substitution/${x:-$(...)} bypass) OR an all-or-nothing flag. NOTE: this class is now SATURATED (GuardFall covered 10/11 OSS agents) - usually a walk.

2. THE DEFENSES THAT WORK (reference-remediation library - cite these)

3. TARGET SELECTION (where the yield actually is)

4. THE DISCIPLINES (what keeps reports credible - non-negotiable)

5. THE OPERATING META-LESSON

Our own findings are PERISHABLE in a hot space. The bottleneck is not lead supply - it's realized value (filing) + velocity. When the hunt lanes are genuinely dry (all classes swept, triggers not fired), DON'T churn saturated surfaces - redirect to: file the pile, productize the method (the Securva moat), or hold cheaply until a fresh trigger. Every cycle should still leave the method SHARPER; when it can't find a bug, it can bank a rule, build a capability, or harden the pile.

Provenance

Cycles 298-329 (2026-07-14/15). Individual lessons: ~/bounty/lessons-library/2026-07-1[45]-cycle*. Positive case studies: ~/bounty/skills/_shared/positive-case-studies/{mcp-filesystem,forgejo-os-root}*. Productized: ~/.claude/skills/agent-mcp-security-audit/ (SKILL+CHECKLIST+REPORT-TEMPLATE+RECON-SCREEN).

Generated 2026-08-08 05:45:05 UTC | auto-sync /15min