Skip to content

Feature Multi Backend

Luigi Colluto edited this page Jul 14, 2026 · 1 revision

Feature: Multi-Backend

Argo runs the same multi-stage pipeline on a swappable agent backend, so you can run it with whatever you already have — Claude Code, the Codex CLI (OpenAI), or a local/open-source model — without changing any audit logic. This also makes Argo a vehicle for a clean cross-model comparison: identical prompts and pipeline, different model, directly comparable results.

AgentRunner (ABC)
├─ HeadlessClaudeRunner   # `claude -p` — Claude Code
├─ CodexRunner            # `codex exec` — OpenAI, or local/OSS via --oss
├─ MockClaudeRunner       # fixtures (zero tokens; the test suite)
└─ FallbackRunner         # wraps an ordered chain of the above (resilience, below)

--runner {headless|codex|mock} picks the backend (default headless = Claude Code).

The guardrails are backend-neutral, enforced per backend

One SessionPolicy — no network except the two OSINT stages (research + corroborate), and the repo is never writable — and each backend translates it into its own dialect:

Guarantee Claude Codex
Repo read-only via --add-dir + chmod outside the workspace + chmod, never --add-dir'd
Writes only scratch session cwd = scratch -s workspace-write, cwd = scratch
No network (default) tools stripped from allowlist OS sandbox denies egress
Network only for research/corroborate OSINT tools kept for those stages network re-enabled only for those stages
Never a sandbox escape network/mutation tools always disallowed never danger-full-access

Both mappings are unit-tested independently. See Guardrails & Safety.

Local / open-source models (Ollama / LM Studio)

Any model Ollama or LM Studio serves works — including Qwen (qwen2.5-coder, qwen3) and DeepSeek (deepseek-coder, deepseek-v3, deepseek-r1):

ollama pull qwen2.5-coder:32b
python -m argo.cli pipeline --runner codex --codex-oss --codex-local-provider ollama \
  --codex-model qwen2.5-coder:32b --brief BRIEF.txt --repo PATH

Cost is ~$0 for local models. Caveat: capability, not plumbing. Some stages are format-strict — recon must emit prompts carrying the RoE/prohibited-techniques anchors verbatim, audit must emit schema-valid JSON. A capable coder model clears the bar; very small (~7B) models may not — exactly what the Benchmarks & Costs harness measures.

Cost note: Claude Code returns real total_cost_usd per call; Codex reports tokens, not dollars, so Argo estimates USD from a price table (unknown/OSS/local models estimate to $0). The consequence: with Codex, the hard mid-session budget kill is unavailable — the per-run budget abort between stages still applies, on the estimated cost.

Resilience — multi-account & multi-backend fallback

Backends and accounts chain transparently: when one hits a session/rate limit (429), the same call is retried on the next (a per-run circuit breaker disables the walled one; a non-retryable error propagates immediately). Since limits are per-account, two logged-in Claude accounts double your capacity before falling through to Codex:

python -m argo.cli pipeline --repo <url> --calibration \
  --claude-accounts ~/.claude,~/.claude-b --fallback codex
# set up the 2nd account once:  CLAUDE_CONFIG_DIR=~/.claude-b claude login

Codex multi-account works the same way (--codex-accounts ~/.codex,~/.codex-b, via CODEX_HOME). So a long Opus run that used to wall on the Claude session limit mid-validate now self-heals to the next account/backend instead of degrading or failing. When a session-limit error carries a human-readable reset time, it's pulled out into the error message and the run's log, so you know exactly when it's safe to retry.

Verify your backend

python -m argo.cli pipeline --smoke                                              # Claude
python -m argo.cli pipeline --smoke --runner codex                               # Codex/OpenAI
python -m argo.cli pipeline --smoke --runner codex --codex-oss --codex-local-provider ollama

Model landscape (why the backend is swappable)

Argo deliberately keeps the model behind the AgentRunner interface, because detection quality tracks the model, and the frontier is moving fast toward security specifically. As security-specialized models become accessible, the swappable backend means Argo gets better by pointing at a stronger engine — no pipeline changes needed.

Related

Clone this wiki locally