Repository navigation
Description
Problem: #45 added --model and [agents.<id>].model, so a model can be chosen, but only if you already know the exact id your agent accepts. There is no way to ask secfoo what is available; a typo surfaces minutes into a run as a CLI error (or a silent fallback, depending on the CLI); agy and devin ignore the setting with a warning; the api agent only speaks LiteLLM names; the model is stored on the run (runs.model) but shown nowhere; and spend cannot be compared by model.
Goal: secfoo models tells you what you can pick for each agent you have, secfoo run --model refuses an id that is not on that list before anything is sent, defaults can be set per skill as well as per agent, and the dashboard, secfoo list, secfoo show and secfoo cost all say which model produced what.
Build:
secfoo models [--agent ID] [--refresh] [--json]. Each adapter getslist_models() -> list[ModelInfo](id,display_name,source,verified_at). Discovery per agent, in this order: the CLI's own listing where one exists (opencode models; checkcodex,copilot,droidfor a models command or--helpoutput), then the provider's models endpoint when its key is in the environment (Anthropic, OpenAI, Google), then a curated list shipped in the adapter with averified_atdate and an "unverified" marker in the output.apifilters LiteLLM's model map by the provider keys present. Results are cached in~/.secfoo/models.jsonfor 24 hours;--refreshbypasses. With no--agent, list the agents that are available (reuse_detect_agent/is_available()fromsecfoo agents).- Validate before the run.
secfoo run --model XchecksXagainst the agent's list when one is available and fails fast with the three closest ids (difflib) and the command to list them.--model-uncheckedbypasses, and a curated-only list never blocks (warn instead). Foragyanddevin, an explicit--modelis an error, not a warning; re-check both CLIs for a model flag and wire it if one exists now. - Defaults with scope. Keep
[agents.<id>].model; add[skills.<skill-id>].modeland[agents.<id>.skills.<skill-id>].model(a cheap model for secret scanning, a strong one for threat modeling). Precedence:--model, then agent+skill, then skill, then agent, then the CLI's own default.secfoo config set agents.claude.model <id>andsecfoo config getround-trip these. - Show it everywhere.
secfoo listandsecfoo showprint the model; the--jsondocument carriesmodelper run; the run detail page and runs list in the dashboard show it (column already exists inruns);secfoo cost --by modeljoins the existingagent/skill/projectgroupings; the overview page's spend widget can be grouped by model. - Docs:
docs/agents.mdgets a "Models" column per adapter (how to list, two example ids, whether validation is live or curated), anddocs/REFERENCE.mddocuments the precedence andcost --by model.
Where to look: src/secfoo/agents/base.py (configure_model, model_flag, supports_model), every adapter in src/secfoo/agents/, src/secfoo/cli.py (run, agents, cost, CostGroup, _detect_agent), src/secfoo/settings.py (agent_models), src/secfoo/storage/repository.py (runs.model, cost queries), src/secfoo/web/routes/runs.py and its templates, docs/agents.md.
Relation: builds on #45. #106 adds agent auto-detection that secfoo models should reuse. The GitHub Action already passes a model input through.
Done when: tests cover list_models() for every adapter with the network and CLIs mocked (fake_popen in tests/conftest.py), the cache and --refresh, validation errors with suggestions and the bypass, the four-level precedence, cost --by model, and the list/show/--json output; the dashboard shows the model on a run; docs updated.
Activity
SriRamkunamsetty commentedon Nov 29, 2026
I'd like to take this
feat(models): add secfoo models discovery, validation, per-skill defa…
feat(models): secfoo models, pre-run validation, per-skill defaults a…