MAGDOX Code Security documentation

AI review with your own model

Optional second opinion on each finding from a provider and model you choose; the engine still decides what is a finding.

Status: Implementation reference

The engine is deterministic and runs locally. With --ai, a model you configure reads each finding and the code around it and adds an advisory verdict: likely real, likely false positive or needs review, with a short reason. With --ai-fix it also proposes a patch; the CLI re-scans a patched copy of the file and marks the fix verified only when that finding is gone and nothing new appeared. Your files are never modified by the CLI.

Providers

Providers
PresetProtocolKey
anthropicAnthropic APIANTHROPIC_API_KEY or typed once
openai, groq, gemini, openrouter, mistral, deepseek, together, meta, azure, customOpenAI-compatible chat completionsProvider key; azure and custom need --base-url
ollamaOpenAI-compatible, localNone
bedrockAWS Bedrock ConverseBedrock API key and --region
textexample
magdox ai add groq
magdox ai models groq
magdox ai use groq --model <model-id> --effort medium
magdox ai test
magdox scan --ai --ai-show-prompt .    # preview what would be sent; sends nothing
magdox ai allow .                      # approve this project
magdox scan --ai --ai-fix .

What leaves the machine, and when

  • Nothing until a project is approved with magdox ai allow, or MAGDOX_AI_CONSENT=1 in CI. Approval is stored in your configuration, never in the repository.
  • For each reviewed finding: the rule and its guidance, the engine's trace, and a bounded excerpt of the file with project-relative paths. Values the secrets engine recognises, and credential-style assignments, are replaced with a placeholder first.
  • Keys are stored owner-only in the configuration directory or read from an environment variable; status output never prints them.
  • Uploads to the dashboard carry the verdict, confidence, provider and model. The written reason travels only with --include-code. Proposed patches are never uploaded.

Verdicts are advisory. Code being scanned can contain text written to mislead a model, so a verdict never removes a finding or changes its severity, and --ai-gate, which lets high-confidence likely-false-positive verdicts bypass --fail-on, is off by default.