Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/automations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Secfoo Automations & `secfoo hook`

Secfoo provides a single tested hook entrypoint (`secfoo hook <recipe> --host <tool>`) and a recipe manager (`secfoo automations`) for AI coding tools.

## Recipes

Built-in recipes live in `src/secfoo/automations/recipes/*.toml` (and user overrides in `~/.secfoo/automations/*.toml` — never loaded from untrusted target repositories):

- `commit-guard`: Scans staged changes for secrets and high-risk issues before `git commit`, `git push`, or `gh pr create`.
- `secret-on-edit`: Scans edited files for credentials after file edits.
- `pr-security-review`: Runs quick SAST + reachability checks on changed files before PR creation.

## Host Support & Detection

Supported hosts: `claude` (reference adapter), `cursor`, `copilot`, `gemini`, `antigravity`, `kiro`, `droid`, `codex`, `opencode`.

`secfoo hook` detects the actual host from environment variables and stdin payload shape, warns on `--host` mismatches, enforces `SECFOO_HOOK_ACTIVE=1` recursion protection and `stop_hook_active` / `continuationActive` / `loop_count` loop guards, deduplicates concurrent hooks, and fails open on errors or expired budgets.

## CLI

```sh
secfoo automations list
secfoo automations enable commit-guard --host claude --dry-run
secfoo automations enable commit-guard --host claude
secfoo automations status
secfoo automations doctor
secfoo automations disable commit-guard --host claude
```
1 change: 1 addition & 0 deletions src/secfoo/automations/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading