Skip to content

Latest commit

 

History

History
73 lines (63 loc) · 10.5 KB

agents.md

File metadata and controls

73 lines (63 loc) · 10.5 KB

Agent setup and troubleshooting

Select an adapter with --agent. CLI adapters must be installed on PATH and authenticated before the run; secfoo cannot answer interactive prompts. Install commands and authentication steps not specified by the adapters are unverified here: consult the relevant agent's installation and login instructions. The table describes the argv secfoo builds, not a command to paste verbatim. PROMPT is the rendered review prompt, WORKDIR the target directory, and brackets indicate optional arguments. All CLI processes run in WORKDIR.

--agent Setup and command Models
claude Install via npm install -g @anthropic-ai/claude-code or curl -fsSL https://claude.ai/install.sh | bash (docs). Authenticate with claude auth login. For non-interactive use, set ANTHROPIC_API_KEY, or with a Claude subscription run claude setup-token once and set the token it prints as CLAUDE_CODE_OAUTH_TOKEN (verified 2.1.329 (Claude Code) on 2026-11-21, macOS Darwin arm64). claude [--model MODEL] -p --output-format json --allowedTools TOOLS --permission-mode default --setting-sources user --strict-mcp-config --no-session-persistence [--mcp-config PATH] (prompt on stdin). TOOLS starts with Read,Grep,Glob,Bash(git log:*),Bash(git diff:*) and includes configured MCP servers when present. The tool grant is read-only, not an OS sandbox. secfoo models --agent claude. Examples: claude-sonnet-4-6, sonnet. Live via ANTHROPIC_API_KEY (Anthropic models API), else curated.
agent (Cursor) Install via curl https://cursor.com/install -fsS | bash (docs). Authenticate with agent login or set CURSOR_API_KEY for non-interactive use (login and CURSOR_API_KEY confirmed in agent --help for 2026.08.11-e8db854 on 2026-11-21, macOS arm64; install command from the official docs). agent [--model MODEL] -p PROMPT secfoo models --agent agent. Examples: auto, claude-4.5-sonnet. Live via CLI if supported, else curated.
agy (Antigravity) Install the agy CLI from the Antigravity distribution (docs), then run agy install to add it to PATH. The CLI has no login subcommand: sign in through Antigravity before headless runs (checked against agy --help for 1.5.3 on 2026-11-21, macOS arm64). agy --print PROMPT --print-timeout Ns (N is the effective timeout in seconds). Headless mode denies tool calls requiring approval. Not supported (--model fails fast).
gemini Install via npm install -g @google/gemini-cli (docs). Authenticate interactively with gemini or set GEMINI_API_KEY for non-interactive use (verified 0.38.1 on 2026-11-21, macOS Darwin arm64). gemini [--model MODEL] -p PROMPT --output-format json --skip-trust. No --yolo write auto-approval is passed. secfoo models --agent gemini. Examples: gemini-2.5-pro, gemini-2.5-flash. Live via GEMINI_API_KEY, else curated.
codex Install via npm install -g @openai/codex (docs). Authenticate with codex login or set OPENAI_API_KEY for non-interactive use (verified codex-cli 0.159.0 on 2026-11-21, macOS Darwin arm64; codex-cli 0.172.0 on Windows). codex exec [--model MODEL] --sandbox read-only [-c windows.sandbox="unelevated"] --skip-git-repo-check --ephemeral --color never --cd WORKDIR - (prompt on stdin; -c is Windows-only). MCP servers are registered into $CODEX_HOME/config.toml (default ~/.codex/config.toml) via secfoo mcp sync --agent codex (or secfoo mcp sync). secfoo models --agent codex. Examples: gpt-5.4, o4-mini. Live via OPENAI_API_KEY (or CLI), else curated.
copilot Install via npm install -g @github/copilot (docs). 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 (verified against the real CLI 1.0.117 on 2026-11-29, Windows: gh auth login plus GH_TOKEN from gh auth token worked; see the matrix below). copilot [--model MODEL] --output-format json --allow-all-tools --usage-output-file PATH (prompt on stdin). Token counts come from the usage file; premium requests / AI credits are not USD, so cost_usd stays unknown. Tools, including writes, are auto-approved: read-only behavior relies on review instructions, not a sandbox. secfoo models --agent copilot. Examples: claude-sonnet-4.5, gpt-5. Curated (live via CLI if supported).
droid Install via curl -fsSL https://app.factory.ai/cli | sh (docs). 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. secfoo models --agent droid. Examples: claude-sonnet-4-5-20250929, gpt-5. Curated (live via CLI if supported).
devin Install via brew install --cask devin-cli (docs). 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. Not supported (--model fails fast).
opencode Install via npm install -g opencode-ai or curl -fsSL https://opencode.ai/install | bash. Non-interactive opencode run --pure --format json --dir WORKDIR [-m MODEL] (prompt on stdin). Read-only permissions set via OPENCODE_CONFIG_CONTENT / OPENCODE_PERMISSION. secfoo models --agent opencode. Examples: anthropic/claude-sonnet-4-5, openai/gpt-5. Live via opencode models, else curated.
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 ([agents.api].tool_call_budget, 0 turns tools off). The tool phase also stops once the input tokens sent reach 4× the first call's. Each call, the number of rounds and the total input tokens are logged to stderr.log. secfoo models --agent api. Examples: openai/gpt-4.1-mini, anthropic/claude-sonnet-4-5. Live from LiteLLM filtered by env API keys.

agy and devin do not support adapter model selection; passing an explicit --model (or agent-scoped config) errors before the run. Other CLI model flags are shown above; run secfoo models to inspect available models and whether validation is live or curated.

Real-CLI verification matrix (issue #116)

✓ means checked against a real installed CLI, with the transcript committed under tests/fixtures/agents/<id>/<cli-version>/ and replayed by tests/test_agents/test_copilot_recordings.py. — means not verified yet; the setup notes above still come from help output or documentation only. Recordings are redacted by scripts/record_agent.py, which refuses to save a fixture if a credential-shaped string survives.

Adapter CLI version Date (UTC) Verifier Install Auth Full non-interactive run Timeout Cost/tokens Evidence
copilot 1.0.117 2026-11-29 Shruti070107 ✓ npm install -g @github/copilot ✓ gh auth login, GH_TOKEN from gh auth token; 401 with an invalid token ✓ secret-scanning --depth quick on examples/ ✓ 1s run killed by secfoo ✓ tokens from --usage-output-file; CLI reports credits, not USD success.json, auth_failure.json, timeout.json, binary_not_found.json
claude, agent, agy, gemini, codex, droid, devin, opencode — — — — — — — — Not verified in this PR; opencode is covered separately in upstream PR #207.

not_configured is the api adapter's status for a missing model key, not a CLI adapter status. CLI adapters report a missing binary as binary_not_found and rejected credentials as failed.

Troubleshooting

  • binary_not_found: binary '<name>' not found on PATH means the CLI was not found. Install it and make its binary available on PATH. Detection checks the binary, not authentication.
  • Authentication or trust prompts cannot be answered during a run: stdin is closed or used for the prompt. Authenticate beforehand. Droid reports Authentication failed without its key; Devin was observed reporting Error: Login canceled without login. Gemini uses --skip-trust; Devin uses --respect-workspace-trust false because its headless mode cannot show the trust prompt. Check the CLI's error if trust still fails.
  • timeout: secfoo kills the process tree. Cursor's headless mode has a documented hang; its default timeout is 900 seconds (other CLI adapters default to 1800). Antigravity also receives its effective print timeout.
  • failed: inspect the error. Gemini can report IneligibleTierError; the adapter suggests Antigravity (--agent agy) if it persists. Codex reports a failed run if its sandbox rejects commands. Antigravity may return empty output or Error: Agent execution terminated due to error.; try another agent if it remains unreliable. Claude can put an error reason in stdout JSON even when stderr is empty; secfoo extracts it.
  • API not_configured: No API key set. Set one of: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY. If LiteLLM or LangGraph cannot be imported, the run is failed and the error says to reinstall secfoo.

For a run failure, see ~/.secfoo/reports/<run-uuid>/stderr.log; see Reporting bugs for what to include when reporting it.