Skip to content
BreachPilot

Tool Family: peer-models

  • Registration source: tools/mcp_tools/peer_models.py:38 register_peer_model_tools(mcp, *, ctx) — auto-discovered but conditionally registers only when _multi_model_enabled(config) (tools/mcp_tools/registry.py:225-230): multi_model.enabled: true OR AI_NMAP_MULTI_MODEL_ENABLED env var truthy override. Otherwise no tools.
  • Gate: both @audit_tool (no target touch — peer models receive no tool schemas, return suggestions only).

Tools Exported (2) — conditional

ToolParamsResult ShapeNotes
consult_peer_modelsquestion: str, context: str="", preferred_aliases: str="" (comma/space CSV from models.registry)`PEER_MODEL_CONSULTATION: BLOCKEDUNAVAILABLE
peer_review_outcomeverdict: str, evidence: str, planner_alias: str="", preferred_grader_aliases: str=""`PEER_REVIEW_OUTCOME: BLOCKEDDISABLED

Budget & Lock

  • Single per-run counter _consultation_count (process singleton, tools/mcp_tools/registry.py:143 + tools/mcp_tools/peer_models.py:22-35 mirror on mcp_exploit_server._consultation_count) + _consultation_lock (threading.Lock) serializes reservation.
  • remaining = max_consultations - current; selected sliced to remaining; incremented atomically; BUDGET_EXHAUSTED when remaining <= 0.
  • Both tools share the counter — using both drains the same budget.

Dependencies

  • tools/model_router.build_router, tools/config_manager.get_ai_provider, get_chatgpt_config
  • tools/mcp_tools/registry._get_model_router, _resolve_consult_aliases, _multi_model_enabled, _chat_content, _truncate_text, _positive_int

Config

  • multi_model.enabled: bool (default false) + AI_NMAP_MULTI_MODEL_ENABLED=1/0 env override
  • multi_model.consult_aliases: list[str] (default kimi,deepseek,...)
  • multi_model.max_consultations: int (default 10), max_question_chars: int (4000), max_answer_chars: int (8000)
  • models.registry: map[alias] -> {provider, model}, models.default_alias: str (active model excluded)
  • outcome_judgment.peer_review: bool (gates peer_review_outcome)

Auditing

  • Both @audit_toolquestion/context not wholesale-redacted but inline secrets masked; no target IP in these entries.
  • Budget state not persisted — process lifetime only.

Validation

  • Empty question/verdict/evidenceBLOCKED; unavailable router → UNAVAILABLE with AVAILABLE_PEERS listed.
  • preferred_aliases filtered to actual registry keys; unknown aliased → SKIPPED.

Tests

  • tests/test_mcp_tool_registration.py — expects consult_peer_models when multi_model.enabled: true and registry has peers
  • tests/test_peer_models.py (if present) — budget exhaustion, peer_review disabled, planner exclusion
  • docs/mcp/registration.md
  • tools/model_router.py — router seam
  • docs/providers.md — ChatGPT vs Ollama provider path
source: repo docs (build sync)Edit this page on GitHub →