Skip to content

Pick any model your agent offers: secfoo models, validation before the run, per-skill defaults, model in the dashboard and cost #111

Done

Description

@vsn411

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:

  1. secfoo models [--agent ID] [--refresh] [--json]. Each adapter gets list_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; check codex, copilot, droid for a models command or --help output), 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 a verified_at date and an "unverified" marker in the output. api filters LiteLLM's model map by the provider keys present. Results are cached in ~/.secfoo/models.json for 24 hours; --refresh bypasses. With no --agent, list the agents that are available (reuse _detect_agent / is_available() from secfoo agents).
  2. Validate before the run. secfoo run --model X checks X against the agent's list when one is available and fails fast with the three closest ids (difflib) and the command to list them. --model-unchecked bypasses, and a curated-only list never blocks (warn instead). For agy and devin, an explicit --model is an error, not a warning; re-check both CLIs for a model flag and wire it if one exists now.
  3. Defaults with scope. Keep [agents.<id>].model; add [skills.<skill-id>].model and [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> and secfoo config get round-trip these.
  4. Show it everywhere. secfoo list and secfoo show print the model; the --json document carries model per run; the run detail page and runs list in the dashboard show it (column already exists in runs); secfoo cost --by model joins the existing agent/skill/project groupings; the overview page's spend widget can be grouped by model.
  5. Docs: docs/agents.md gets a "Models" column per adapter (how to list, two example ids, whether validation is live or curated), and docs/REFERENCE.md documents the precedence and cost --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

  1. added
    enhancement
    help wanted
    hackathon
    difficulty: medium
    on Nov 15, 2026
  2. SriRamkunamsetty commented on Nov 29, 2026

    @SriRamkunamsetty
    Contributor

    I'd like to take this

  3. added a commit that references this issue on Nov 29, 2026
    aa0e363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: mediumenhancementhackathonhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions