Skip to content

Pre-built secfoo automations for every AI coding tool: switch on in your tool, every run reports back #240

Backlog
0 of 11 issues completed

Description

@vsn411

Why

secfoo runs when someone types secfoo run, or when CI calls the Action. Most developers now spend their day inside an AI coding tool, and every major tool can run things automatically: hooks before a shell command, after a file edit or when the agent finishes a turn, plus scheduled and event-driven cloud agents and plugin bundles. secfoo should ship ready-made automations for those points. A user can then switch one on in the tool they're in, when they need it, with no hook scripts to write. Examples: "check what the agent is about to commit", "review what it just changed before it says it's done", "re-check dependencies when the lockfile changes". Every one of those runs must report back to the secfoo platform.

How this relates to #224: #224 puts secfoo into each tool (MCP server + skills, so the user asks for a review). This issue makes secfoo run by itself at the right moments. They share the install, the plugin packaging and the key rules.

Principles (apply to every sub-issue)

  1. Pick up on the fly. Every recipe is off by default. A user enables it per repo or per user with one command (secfoo automations enable <recipe> --tool <tool>), or from the tool's plugin UI, and removes it just as easily. Nothing is installed silently.
  2. Every run reports back. Every invocation that runs a skill ends as one run record (success, blocked, failed, timed out, cost-capped, skipped or not submitted). It is stored locally and pushed to the portal when a key is configured. Offline or sandboxed runs are queued and pushed later. No silent drops.
  3. Local by default. No key is needed. A key only adds central reporting, as in Secfoo in every agent marketplace: one MCP server, local by default, optional key for the org portal #224. View keys never upload.
  4. Thin per-tool glue. Tool configs only call secfoo hook <recipe> --host <tool>. Parsing, scoping, running, rendering and reporting live in Python, tested once with recorded payloads per tool.
  5. Never stall the developer. Blocking recipes have hard time budgets and fail open with a visible message. Slow reviews run in the background and surface on the next turn.
  6. Safe by construction.
    • No recursion: secfoo's own nested agent runs must not re-trigger hooks.
    • Nothing executed from the target repo or the hook payload.
    • No keys in project files.
    • Nothing from the hook payload (prompts, transcripts, emails) ever sent to the portal.

Recipe catalogue (v1)

Recipe secfoo skill(s) When it runs Effect
commit-guard secret-scanning, sast on the staged diff Before the agent runs git commit / git push / gh pr create Blocks at the --fail-on threshold, with findings the agent can fix
turn-review sast on files changed this turn When the agent finishes a turn Hands findings back so the agent fixes them before finishing (loop-guarded)
dependency-watch sca-reachability After a manifest/lockfile edit (or file save) Background; surfaces reachable High+ on the next turn
design-review threat-modeling, security-architecture-review After edits to design docs, OpenAPI specs, IaC Background, debounced
ai-feature-review responsible-ai-compliance, prompt-review After edits to LLM SDK calls or prompt files Background, debounced
session-brief none (local DB read) Session start Injects open High+ findings for this repo as context (under 1 s, no run)
session-flush none Session end Flushes queued reports, marks host-mode runs that were never submitted
fix-findings any On demand (skill/command) Lists open findings → fixes → re-runs to confirm closure
scheduled-baseline full set for the repo Schedule (cloud/desktop schedulers, CI) Full baseline on the default branch
test-reachability (later) runtime probe When the agent runs the test suite Runs tests under the probe, so findings get runtime evidence (shift-left sensor)

Each recipe runs in delegate mode (secfoo runs its own agent: independent, costs spend) or host mode (the host agent follows the secfoo skill and calls submit_report on secfoo mcp serve, no extra spend; needs #224 / PR #229).

Compatibility matrix (checked against official docs on 2026-12-03)

✓ = documented and usable, ◐ = partial or needs verification, ✗ = not available.

Tool Block a shell command Hand findings back at turn end Post-edit trigger Background hooks Cloud / scheduled Plugin bundle Notes
Claude Code ✓ PreToolUse deny ✓ Stop block (8-cap) ✓ PostToolUse ✓ async, asyncRewake ✓ cloud scheduled tasks ✓ .claude-plugin/plugin.json 600 s default; SessionEnd only 1.5 s; hooks fire in claude -p
Grok Build (formerly Cursor) ✓ beforeShellExecution deny ✓ stop → followup_message (loop_limit 5) ✓ afterFileEdit ◐ ✓ Automations (schedule + events) ◐ via Customize Cloud agents skip session hooks; CLI is now grok; stdin has user_email
GitHub Copilot (CLI, VS Code, cloud agent) ✓ preToolUse deny ✓ agentStop block (8-cap) ✓ postToolUse ◐ ◐ cloud agent + Actions ✓ Agent Plugins 1.0 30 s default fails open; cloud firewall blocks the portal unless allowlisted; reads .claude/settings.json
OpenAI Codex ✓ PreToolUse deny ✓ Stop block ✓ PostToolUse ✓ async ◐ scheduled tasks (app/web only) ✓ Hooks must be trusted; workspace-write blocks network; .agents/skills
Gemini CLI ✓ BeforeTool deny ◐ AfterAgent deny = forced retry ✓ AfterTool ✗ ✗ ✓ extensions Timeout in ms, 60 s; replaced by Antigravity for unpaid/Google One users
Antigravity (agy) ✓ PreToolUse deny ✓ Stop continue ✓ PostToolUse ◐ ◐ schedule tool ✓ plugins dir 30 s default; workflows deprecated → skills
Devin (Local/Desktop, ex-Windsurf; cloud) ✓ PreToolUse exit 2 ✓ Stop block ✓ PostToolUse ◐ ✓ Automations (schedule, GitHub, webhook…) ◐ Reads Claude settings files; no default timeout
Factory Droid ✓ ✓ Stop block ✓ ◐ ✗ ✗ Claude-like format; hooks fire under droid exec
OpenCode ✓ tool execute.before ✓ inject via ctx.session.prompt ✓ execute.after ✓ (JS) ✗ ✓ JS/TS plugins Hook names changed V1 → current; needs a TS shim
Kiro ✓ Pre Tool Use ◐ Agent Stop → context ✓ File Save ◐ ✗ ✗ One JSON per hook in .kiro/hooks/
Cline ✓ PreToolUse ◐ TaskComplete ✓ PostToolUse ✗ ✗ ✗ Hooks must be enabled in the UI; path varies by version

Cross-tool hazards the foundation must handle:

  • Shared config files: Copilot and Devin read .claude/settings.json, and Grok Build sets CLAUDE_PROJECT_DIR. Detect the real host and de-duplicate.
  • Recursion: secfoo's own claude, droid, copilot, codex, gemini, agy, devin and opencode adapters run these CLIs non-interactively, and hooks fire there.
  • Very different timeouts: from 1.5 s to 600 s.

Sub-issues

Foundation (do first):

Per tool (any order once the foundation lands; Claude Code is the reference):

For contributors

  • Start with the foundation issues, or pick a tool you use daily. Every per-tool issue lists the exact events, file paths and gotchas we found, with links. Re-check the docs and record the tool version you tested. These tools change monthly.
  • Record real hook payloads as fixtures (redacted, like tests/fixtures/agents/), rather than writing them from docs.
  • Each per-tool PR needs a verification row: tool version, OS, recipes tested, and proof the run reached secfoo serve (and the portal, if you have a key) with the right trigger.host.

Done when

Both foundation issues are closed, Claude Code plus at least three other tools ship the v1 recipes, docs/automations.md has a "which recipes work where" table, and every remaining tool is either done or documented with why not.

Sub-issues

Sub-issues

0 of 11 Issues completed
Loading 11 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: hardenhancementhelp wantedtracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions