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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ headers = { Authorization = "Bearer ..." }

With `--agent claude` the configured servers are attached to each run
automatically and nothing else (your global Claude config is not touched and
the target's own `.mcp.json` is not loaded). For Gemini CLI and Cursor run
`secfoo mcp sync --agent <agent>` once. Codex, Antigravity and the `api`
agent cannot use MCP servers yet. Details in
the target's own `.mcp.json` is not loaded). The `api` agent (the GitHub
Action's default) connects to the same servers itself and offers their
read-only tools to the model, within a budget of 20 calls per run. For Gemini
CLI and Cursor run `secfoo mcp sync --agent <agent>` once. Codex and
Antigravity cannot use MCP servers yet. Details in
[docs/REFERENCE.md](https://github.com/secfoo-com/secfoo/blob/main/docs/REFERENCE.md#configuration-secfooconfigtoml).

## A 30-second look at the dashboard
Expand Down
8 changes: 5 additions & 3 deletions docs/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,8 @@ args = ["-y", "mcp-remote@latest", "https://mcp.atlassian.com/v1/mcp/authv2"]
hosts = ["wiki.internal.example", "*.atlassian.net"]
```

The optional `tools` array (e.g. `["confluence_get_page", "jira_get_issue"]`) lists the tools the `api` agent may call on this server. Without it, only tools the server annotates `readOnlyHint: true` are offered. Other agents ignore it.

The optional `hosts` array specifies hostnames or domain patterns served by this MCP server (e.g. `["wiki.internal.example", "*.atlassian.net"]`). A `*.` pattern matches subdomains only; list the bare domain too if needed. secfoo uses `hosts` to route URL context sources to their likely MCP readers and classify internal enterprise Confluence / Jira URLs.

CLI flags always override `[defaults]`. See
Expand Down Expand Up @@ -979,6 +981,7 @@ How MCP servers reach each agent varies by what its CLI actually supports:
| Agent | Mechanism |
|---|---|
| `claude` | Automatic on every `secfoo run` (`--mcp-config`, scoped to that invocation only — your global Claude config is never touched). These are the only MCP servers loaded during a scan (`--strict-mcp-config`): servers from your global Claude config or from the target's `.mcp.json` are not started |
| `api` | Automatic on every `secfoo run`: secfoo connects to each server itself (stdio, HTTP or SSE) and offers its tools to the model as function tools. Only tools the server annotates `readOnlyHint: true` are offered, unless the server's entry lists tools by name in `tools = [...]`, which then offers exactly those. At most 20 tool calls and 5 minutes of tool use per run. After that the model is told the budget is spent and asked to finish the report. Results count toward `--max-input-tokens`, and a result over 40,000 characters is cut with a visible marker. Every call (server, tool, arguments, bytes returned) is logged to the run's `stderr.log`, and the log is shown to the model, so the coverage section can only claim pages a tool actually returned |
| `gemini`, `agent` (Cursor) | Run `secfoo mcp sync --agent <agent>` once to register persistently in that tool's own config |
| `codex` | Not wired up yet — Codex reads MCP servers from its own `~/.codex/config.toml` |
| `agy` (Antigravity) | Not supported yet — its CLI has no MCP configuration mechanism as of this writing |
Expand All @@ -1005,9 +1008,8 @@ secfoo memory logout

Once a key is saved, secfoo registers `secfoo-memory` as a default MCP
server. `secfoo mcp list` shows it next to your own servers. `claude` picks
it up on every run. For `gemini` or Cursor (`agent`), run
`secfoo mcp sync --agent <agent>` once. The `api` agent has no tool loop,
so memory doesn't apply to it. When memory is on, the prompt tells the
it up on every run, and so does the `api` agent. For `gemini` or Cursor
(`agent`), run `secfoo mcp sync --agent <agent>` once. When memory is on, the prompt tells the
agent when to use the three tools (`lookup_patterns`, `get_remediation`,
`check_false_positive`) and how to phrase a query.

Expand Down
2 changes: 1 addition & 1 deletion docs/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ brackets indicate optional arguments. All CLI processes run in `WORKDIR`.
| `copilot` | Install via `npm install -g @github/copilot` ([docs](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli)). Authenticate by running `copilot` and using its `/login` command, or set `GH_TOKEN` / `GITHUB_TOKEN` (a fine-grained token with the Copilot Requests permission) for non-interactive use (checked against official docs on 2026-11-21). `copilot [--model MODEL] --output-format json --allow-all-tools` (prompt on stdin). Tools, including writes, are auto-approved: read-only behavior relies on review instructions, not a sandbox. |
| `droid` | Install via `curl -fsSL https://app.factory.ai/cli \| sh` ([docs](https://docs.factory.ai/cli/getting-started/overview)). Set `FACTORY_API_KEY` for non-interactive use or run `droid` to sign in interactively (checked against official docs on 2026-11-21, not on an installed CLI). `droid exec [-m MODEL] --output-format json --cwd WORKDIR -- PROMPT`. Droid defaults to read-only; a full authenticated secfoo run was not verified in the adapter. |
| `devin` | Install via `brew install --cask devin-cli` ([docs](https://docs.devin.ai)). Authenticate beforehand with `devin auth login`; credential reuse for headless runs is unverified (install and login checked against official docs on 2026-11-21, not on an installed CLI). `devin -p PROMPT --respect-workspace-trust false --permission-mode auto`. The combined command and an authenticated end-to-end run are unverified; `auto` is documented by the CLI as approving read-only tools. |
| `api` | No agent binary is invoked. `litellm` and `langgraph` are installed with secfoo; if importing them fails, reinstall secfoo the way you installed it (`pipx reinstall secfoo` or `pip install --force-reinstall secfoo`). Set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY`. Source files are included in the API prompt. Model selection uses the configured model, then `SECFOO_API_MODEL`, then `openai/gpt-4.1-mini`. |
| `api` | No agent binary is invoked. `litellm` and `langgraph` are installed with secfoo; if importing them fails, reinstall secfoo the way you installed it (`pipx reinstall secfoo` or `pip install --force-reinstall secfoo`). Set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY`. Source files are included in the API prompt. Model selection uses the configured model, then `SECFOO_API_MODEL`, then `openai/gpt-4.1-mini`. MCP servers from `[[mcp_servers]]` (and `secfoo-memory`) are connected by secfoo itself. Only their read-only tools are offered to the model (`readOnlyHint: true`, or the server's `tools = [...]` list), with at most 20 tool calls per run. Each call is logged to `stderr.log`. |

`agy` and `devin` do not support adapter model selection; secfoo warns and
ignores a requested model. Other CLI model flags are shown above.
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ dependencies = [
"python-pptx>=1.0.2",
"langgraph>=1.2.24",
"litellm>=1.110.2",
# MCP client for the `api` agent's tool loop (agents/mcp_tools.py, #123).
# <2: the 2.x SDK reworks the client transports this module uses.
"mcp>=1.12,<2",
]

[project.optional-dependencies]
dev = ["jsonschema>=4.26.0", "pytest>=9.2.0", "pytest-cov>=7.1.0", "hypothesis>=6.168.5", "httpx>=0.28.1", "ruff>=0.17.6", "bandit>=1.9.4", "pip-audit>=2.10.1", "langgraph>=1.2.24"]
build = ["pyinstaller>=6.22.3"]
# The `api` agent (secfoo/agents/api.py) needs litellm and langgraph, which are regular
# The `api` agent (secfoo/agents/api.py) needs litellm, langgraph and mcp, which are regular
# dependencies above, so there is no separate `api` extra to install.
# (dev lists langgraph too so the real graph runs in tests; litellm is faked.)

Expand Down
Loading
Loading