argus-ai-scanner 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- argus_ai_scanner-1.1.0/.gitignore +60 -0
- argus_ai_scanner-1.1.0/CONTRIBUTING.md +94 -0
- argus_ai_scanner-1.1.0/LICENSE +190 -0
- argus_ai_scanner-1.1.0/PKG-INFO +315 -0
- argus_ai_scanner-1.1.0/README.md +266 -0
- argus_ai_scanner-1.1.0/SECURITY.md +82 -0
- argus_ai_scanner-1.1.0/adjudicator/__init__.py +0 -0
- argus_ai_scanner-1.1.0/adjudicator/agent.py +465 -0
- argus_ai_scanner-1.1.0/adjudicator/config.py +18 -0
- argus_ai_scanner-1.1.0/adjudicator/opus_adapter.py +92 -0
- argus_ai_scanner-1.1.0/adjudicator/prompts.py +310 -0
- argus_ai_scanner-1.1.0/analysis/__init__.py +0 -0
- argus_ai_scanner-1.1.0/analysis/ensemble.py +184 -0
- argus_ai_scanner-1.1.0/dast/MULTI_IMAGE_DESIGN.md +166 -0
- argus_ai_scanner-1.1.0/dast/__init__.py +0 -0
- argus_ai_scanner-1.1.0/dast/discovery.py +612 -0
- argus_ai_scanner-1.1.0/dast/inference.py +216 -0
- argus_ai_scanner-1.1.0/dast/journal.py +208 -0
- argus_ai_scanner-1.1.0/dast/orchestrator.py +531 -0
- argus_ai_scanner-1.1.0/dast/per_finding.py +477 -0
- argus_ai_scanner-1.1.0/dast/prompts.py +1578 -0
- argus_ai_scanner-1.1.0/dast/runner.py +301 -0
- argus_ai_scanner-1.1.0/dast/sandbox/__init__.py +0 -0
- argus_ai_scanner-1.1.0/dast/sandbox/client.py +1051 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/Dockerfile +64 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/Dockerfile.ml_tools +94 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/Dockerfile.networked +58 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/MULTI_IMAGE.md +268 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/build_and_push_multi.sh +157 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/dast-capture-server.py +316 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/dast-init.sh +96 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/entrypoint.py +326 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/fly.ml_tools.toml +10 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/fly.networked.toml +10 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/fly.toml +22 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/preflight.ps1 +125 -0
- argus_ai_scanner-1.1.0/dast/sandbox/firecracker/preflight.sh +81 -0
- argus_ai_scanner-1.1.0/dast/sandbox/multi_image_wiring.py +233 -0
- argus_ai_scanner-1.1.0/dast/validator.py +324 -0
- argus_ai_scanner-1.1.0/docs/api-keys.md +64 -0
- argus_ai_scanner-1.1.0/docs/architecture.md +100 -0
- argus_ai_scanner-1.1.0/docs/contributing.md +66 -0
- argus_ai_scanner-1.1.0/docs/cost-guide.md +75 -0
- argus_ai_scanner-1.1.0/docs/dast-setup.md +148 -0
- argus_ai_scanner-1.1.0/docs/index.md +59 -0
- argus_ai_scanner-1.1.0/docs/install.md +86 -0
- argus_ai_scanner-1.1.0/inference/__init__.py +0 -0
- argus_ai_scanner-1.1.0/inference/adapters.py +300 -0
- argus_ai_scanner-1.1.0/methodology/__init__.py +0 -0
- argus_ai_scanner-1.1.0/methodology/baseline_runner.py +318 -0
- argus_ai_scanner-1.1.0/methodology/bench.py +506 -0
- argus_ai_scanner-1.1.0/methodology/build_consensus.py +183 -0
- argus_ai_scanner-1.1.0/methodology/dast_replay.py +301 -0
- argus_ai_scanner-1.1.0/methodology/diff_report.py +599 -0
- argus_ai_scanner-1.1.0/methodology/judge.py +566 -0
- argus_ai_scanner-1.1.0/methodology/launch_report.py +1154 -0
- argus_ai_scanner-1.1.0/methodology/oracle_builder.py +434 -0
- argus_ai_scanner-1.1.0/methodology/per_fix_runner.py +354 -0
- argus_ai_scanner-1.1.0/methodology/run_phase_a_report.py +229 -0
- argus_ai_scanner-1.1.0/methodology/run_voter_pass.py +194 -0
- argus_ai_scanner-1.1.0/methodology/score_rich.py +162 -0
- argus_ai_scanner-1.1.0/methodology/scoring.py +369 -0
- argus_ai_scanner-1.1.0/methodology/voters.py +644 -0
- argus_ai_scanner-1.1.0/preprocessing/__init__.py +50 -0
- argus_ai_scanner-1.1.0/preprocessing/ai_file_patterns.py +108 -0
- argus_ai_scanner-1.1.0/preprocessing/attack_vector_extensions.py +48 -0
- argus_ai_scanner-1.1.0/preprocessing/binary_detect.py +66 -0
- argus_ai_scanner-1.1.0/preprocessing/crypto_sensitivity.py +282 -0
- argus_ai_scanner-1.1.0/preprocessing/deobfuscation.py +664 -0
- argus_ai_scanner-1.1.0/preprocessing/framework_markers.py +173 -0
- argus_ai_scanner-1.1.0/preprocessing/imperative_install.py +210 -0
- argus_ai_scanner-1.1.0/preprocessing/language.py +108 -0
- argus_ai_scanner-1.1.0/preprocessing/malware_hash.py +47 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/__init__.py +87 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/_base.py +50 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/crates.py +66 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/go.py +59 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/maven.py +62 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/npm.py +132 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/nuget.py +48 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/pypi.py +236 -0
- argus_ai_scanner-1.1.0/preprocessing/parsers/rubygems.py +42 -0
- argus_ai_scanner-1.1.0/preprocessing/pipeline.py +221 -0
- argus_ai_scanner-1.1.0/preprocessing/prompt_injection.py +361 -0
- argus_ai_scanner-1.1.0/preprocessing/prompt_markers.py +151 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/__init__.py +0 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/integration/__init__.py +0 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/integration/conftest.py +42 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/integration/test_real_files.py +311 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_ai_file_patterns.py +137 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_attack_vector_extensions.py +68 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_binary_detect.py +85 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_crypto_sensitivity.py +299 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_deobfuscation.py +834 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_framework_markers.py +274 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_imperative_install.py +204 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_language.py +23 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_parsers.py +189 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_pipeline.py +293 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_prompt_injection.py +304 -0
- argus_ai_scanner-1.1.0/preprocessing/tests/test_prompt_markers.py +337 -0
- argus_ai_scanner-1.1.0/prompts/__init__.py +0 -0
- argus_ai_scanner-1.1.0/prompts/scanner.py +364 -0
- argus_ai_scanner-1.1.0/pyproject.toml +163 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/12_gh_bot_automerge_backdoor.py +175 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/12_glpi_sso_session_fixation.py +163 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/audit_log_compression.py +210 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/backup_manager.py +251 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/clean.py +21 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/compat_hooks.pth +4 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/consistency_variable.py +9 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/db2_query_health_check.py +250 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/docker_entrypoint_init.py +182 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/event_stream_flatmap_compromise.js +130 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/high_stakes_crypto.py +28 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/high_with_vuln.py +18 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/init__.py +195 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/known_malware.py +8 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/litellm_obfuscated.py +17 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/load_distributed_checkpoint.py +199 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/low.py +27 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/megatron_gpt2_loader.py +266 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/multi_layer_b64.py +11 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/oracle.json +32 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/perceiver_model_loader.py +203 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/photoshow_ffmpeg_config.py +172 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/preinstall.py +241 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/regression_baseline.json +362 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/sandbox_runner.js +178 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/sitecustomize_inject.pth +7 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/tenda_device_audit.py +225 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/tpm_symmetric_cipher.py +338 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/wvr30_admin_provisioning.py +185 -0
- argus_ai_scanner-1.1.0/samples/regression_v1/xrechnung_visualizer.py +146 -0
- argus_ai_scanner-1.1.0/scanner/__init__.py +0 -0
- argus_ai_scanner-1.1.0/scanner/cli.py +911 -0
- argus_ai_scanner-1.1.0/scanner/engine.py +638 -0
- argus_ai_scanner-1.1.0/scanner/repo_scanner.py +613 -0
- argus_ai_scanner-1.1.0/scanner/runners.py +452 -0
- argus_ai_scanner-1.1.0/scanner/sanitizer.py +173 -0
- argus_ai_scanner-1.1.0/scanner/sarif.py +201 -0
- argus_ai_scanner-1.1.0/shared/__init__.py +0 -0
- argus_ai_scanner-1.1.0/shared/types/__init__.py +192 -0
- argus_ai_scanner-1.1.0/shared/types/analysis.py +205 -0
- argus_ai_scanner-1.1.0/shared/types/enums.py +387 -0
- argus_ai_scanner-1.1.0/shared/types/extractions.py +197 -0
- argus_ai_scanner-1.1.0/shared/types/label.py +32 -0
- argus_ai_scanner-1.1.0/shared/types/meta.py +227 -0
- argus_ai_scanner-1.1.0/shared/types/preprocessing.py +251 -0
- argus_ai_scanner-1.1.0/shared/types/triage.py +39 -0
- argus_ai_scanner-1.1.0/shared/types/verdict.py +120 -0
- argus_ai_scanner-1.1.0/shared/utils/__init__.py +46 -0
- argus_ai_scanner-1.1.0/shared/utils/hashing.py +41 -0
- argus_ai_scanner-1.1.0/shared/utils/json_recovery.py +120 -0
- argus_ai_scanner-1.1.0/shared/utils/logging.py +42 -0
- argus_ai_scanner-1.1.0/shared/utils/policy.py +83 -0
- argus_ai_scanner-1.1.0/shared/utils/schema.py +22 -0
- argus_ai_scanner-1.1.0/shared/utils/scoring.py +118 -0
- argus_ai_scanner-1.1.0/shared/utils/tokens.py +34 -0
- argus_ai_scanner-1.1.0/tests/integration/test_dast_107_litellm.py +111 -0
- argus_ai_scanner-1.1.0/tests/integration/test_inference_anthropic_smoke.py +71 -0
- argus_ai_scanner-1.1.0/tests/integration/test_inference_gemini_smoke.py +70 -0
- argus_ai_scanner-1.1.0/tests/integration/test_phase1_oracle.py +95 -0
- argus_ai_scanner-1.1.0/tests/integration/test_runners_opus_smoke.py +62 -0
- argus_ai_scanner-1.1.0/tests/integration/test_runners_sonnet_smoke.py +65 -0
- argus_ai_scanner-1.1.0/tests/integration/test_runners_triage_smoke.py +92 -0
- argus_ai_scanner-1.1.0/tests/unit/test_bench.py +253 -0
- argus_ai_scanner-1.1.0/tests/unit/test_cli.py +244 -0
- argus_ai_scanner-1.1.0/tests/unit/test_dast_inference.py +201 -0
- argus_ai_scanner-1.1.0/tests/unit/test_dast_runner.py +292 -0
- argus_ai_scanner-1.1.0/tests/unit/test_diff_report.py +612 -0
- argus_ai_scanner-1.1.0/tests/unit/test_discovery.py +610 -0
- argus_ai_scanner-1.1.0/tests/unit/test_engine_smoke.py +581 -0
- argus_ai_scanner-1.1.0/tests/unit/test_judge.py +455 -0
- argus_ai_scanner-1.1.0/tests/unit/test_launch_report.py +444 -0
- argus_ai_scanner-1.1.0/tests/unit/test_oracle_builder.py +533 -0
- argus_ai_scanner-1.1.0/tests/unit/test_per_finding.py +608 -0
- argus_ai_scanner-1.1.0/tests/unit/test_repo_scanner.py +381 -0
- argus_ai_scanner-1.1.0/tests/unit/test_runners.py +446 -0
- argus_ai_scanner-1.1.0/tests/unit/test_sarif.py +238 -0
- argus_ai_scanner-1.1.0/tests/unit/test_voters.py +330 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.eggs/
|
|
9
|
+
build/
|
|
10
|
+
dist/
|
|
11
|
+
|
|
12
|
+
# uv / venvs
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
.python-version
|
|
16
|
+
uv.lock
|
|
17
|
+
|
|
18
|
+
# Env / secrets
|
|
19
|
+
.env
|
|
20
|
+
.env.*
|
|
21
|
+
!.env.example
|
|
22
|
+
*.pem
|
|
23
|
+
*.key
|
|
24
|
+
|
|
25
|
+
# Logs / runtime
|
|
26
|
+
logs/
|
|
27
|
+
*.log
|
|
28
|
+
journals/
|
|
29
|
+
results/
|
|
30
|
+
bench_results/*
|
|
31
|
+
!bench_results/v1_1_launch/
|
|
32
|
+
bench_results/v1_1_launch/*
|
|
33
|
+
!bench_results/v1_1_launch/launch_report.md
|
|
34
|
+
_eval_*.json
|
|
35
|
+
_phase_*_evaluation.json
|
|
36
|
+
_full_regression_*.json
|
|
37
|
+
_baseline_run_*.json
|
|
38
|
+
|
|
39
|
+
# IDE
|
|
40
|
+
.vscode/
|
|
41
|
+
.idea/
|
|
42
|
+
*.swp
|
|
43
|
+
.DS_Store
|
|
44
|
+
|
|
45
|
+
# Frontend
|
|
46
|
+
node_modules/
|
|
47
|
+
frontend/dist/
|
|
48
|
+
frontend/.vite/
|
|
49
|
+
|
|
50
|
+
# Test
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
.coverage
|
|
53
|
+
htmlcov/
|
|
54
|
+
.mypy_cache/
|
|
55
|
+
.ruff_cache/
|
|
56
|
+
|
|
57
|
+
# Local-only
|
|
58
|
+
TODO.local.md
|
|
59
|
+
NOTES.local.md
|
|
60
|
+
.claude/settings.local.json
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Contributing to Argus
|
|
2
|
+
|
|
3
|
+
Thanks for considering a contribution. Argus is an AI-native code security scanner; the things we care most about are detection quality, cost discipline, and DAST verification fidelity. PRs are welcome.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone git@github.com:dshochat/Argus_Scanner.git
|
|
9
|
+
cd Argus_Scanner
|
|
10
|
+
uv sync --extra dev
|
|
11
|
+
cp .env.example .env # add ANTHROPIC_API_KEY + GEMINI_API_KEY
|
|
12
|
+
uv run pytest tests/unit -v
|
|
13
|
+
uv run argus scan path/to/file.py
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
You'll need:
|
|
17
|
+
|
|
18
|
+
- Python 3.12+
|
|
19
|
+
- An Anthropic API key (Sonnet 4.6 / Opus 4.6 cascade tiers)
|
|
20
|
+
- A Google AI Studio key (Gemini Flash-Lite triage)
|
|
21
|
+
- Optionally, a Fly.io token for the DAST sandbox tier — not required for most contributions
|
|
22
|
+
|
|
23
|
+
## Where to start
|
|
24
|
+
|
|
25
|
+
- **Good first issues** are tagged in [GitHub Issues](https://github.com/dshochat/Argus_Scanner/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). They're scoped, clearly described, and reviewable in a sitting.
|
|
26
|
+
- **The architecture overview is [`docs/architecture.md`](docs/architecture.md).** Read this before touching `scanner/engine.py` or `dast/orchestrator.py` — both are integration glue with non-obvious invariants.
|
|
27
|
+
|
|
28
|
+
## Style
|
|
29
|
+
|
|
30
|
+
- **Python 3.12+, mypy `--strict`, ruff for lint + format.** No flake8 or black; please don't introduce them.
|
|
31
|
+
- **Pydantic v2** for every cross-boundary structure.
|
|
32
|
+
- **`structlog`** for logging; never `print()` outside the CLI.
|
|
33
|
+
- **Type everything.** `Any` is allowed at runner-injection seams (engine.py uses `Any` for `*_runner` parameters by design — duck typing is the testability story); elsewhere prefer concrete types.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv run ruff check . && uv run ruff format .
|
|
37
|
+
uv run mypy --strict .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
CI runs both on every PR.
|
|
41
|
+
|
|
42
|
+
## Tests
|
|
43
|
+
|
|
44
|
+
Two tiers, kept strictly separate:
|
|
45
|
+
|
|
46
|
+
- **`tests/unit/`** — no live API. Stubs all model calls. Must pass on every PR. Several hundred tests; fast (<3s for the full suite).
|
|
47
|
+
- **`tests/integration/`** — live API calls. Marked with `@pytest.mark.integration`. Skips if API keys aren't set. Costs API credits on every run. **CI does not run these** — run them locally before submitting cascade or runner changes.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
uv run pytest tests/unit -v # always
|
|
51
|
+
uv run pytest tests/integration -v -s # before runner / engine changes
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Don't add live API calls to `tests/unit/`. The rule has no exceptions: it's the difference between "dev iteration is fast" and "every contributor needs to fund their own scan budget."
|
|
55
|
+
|
|
56
|
+
## What we welcome
|
|
57
|
+
|
|
58
|
+
- **New deterministic detectors** in `preprocessing/` — fast, free, well-tested. Mirror existing detectors (`crypto_sensitivity.py`, `imperative_install.py`) for shape.
|
|
59
|
+
- **Prompt tuning** that improves verdict-distance on the regression suite (`samples/regression_v1/`). Show the before/after numbers in the PR.
|
|
60
|
+
- **DAST coverage extensions** — new sandbox image variants, new payload templates for Discovery mode, new oracle types.
|
|
61
|
+
- **Cost guardrails** — anything that makes per-scan cost more predictable or transparent.
|
|
62
|
+
- **Bug reports + reproductions** — issues with a reduced test case land fastest.
|
|
63
|
+
|
|
64
|
+
## What's out of scope right now
|
|
65
|
+
|
|
66
|
+
- Adding new model providers beyond Anthropic + Google — defer until v2 benchmark mode resurrects.
|
|
67
|
+
- Architectural pivots without prior discussion in an issue.
|
|
68
|
+
- Frontend work — `frontend/` is dormant for the deferred hosted tier.
|
|
69
|
+
|
|
70
|
+
## Architecture invariants (non-negotiable)
|
|
71
|
+
|
|
72
|
+
If your change touches one of these, expect a longer review:
|
|
73
|
+
|
|
74
|
+
1. **Preprocessing is deterministic and free.** Never call models in `preprocessing/`. If you're tempted, the change probably belongs in `analysis/`.
|
|
75
|
+
2. **The cascade short-circuits cheap files cheap.** Clean files cost $0.0001 (triage only); don't add expensive defaults.
|
|
76
|
+
3. **All runners are injectable.** `scan_file(triage_runner=, sonnet_runner=, opus_runner=, dast_runner=)`. Never hard-code provider calls in the engine.
|
|
77
|
+
4. **DAST never silently lowers an L1 verdict.** A `malicious` → `suspicious` downgrade only fires when *every* L1 finding is sandbox-grounded as `BLOCKED` or `UNREACHED`. Without that, L1's verdict stands.
|
|
78
|
+
5. **Methodology before lift claims.** Don't publish a verdict-exact number from a single regression run. N=2 minimum for cross-config comparisons.
|
|
79
|
+
|
|
80
|
+
## Pull request process
|
|
81
|
+
|
|
82
|
+
1. **Open an issue first** if the change is non-trivial. Saves rework on both sides.
|
|
83
|
+
2. **Branch from `main`.** Keep PRs focused — one task ID per PR is the norm.
|
|
84
|
+
3. **Tests pass.** `uv run pytest tests/unit -v && uv run ruff check . && uv run mypy --strict .`
|
|
85
|
+
4. **Live integration smoke** for runner / engine changes — paste the resulting verdict + cost in the PR description.
|
|
86
|
+
5. **Squash-merge by default.** Multi-commit PRs are fine if the commits tell a coherent story.
|
|
87
|
+
|
|
88
|
+
## Security disclosures
|
|
89
|
+
|
|
90
|
+
Please do not file public issues for security vulnerabilities. See [SECURITY.md](SECURITY.md) for the private disclosure path.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
By contributing, you agree that your contributions will be licensed under the [Apache License 2.0](LICENSE).
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may accept and charge a
|
|
167
|
+
fee for, or grant additional rights such as warranty, support,
|
|
168
|
+
indemnity, or other liability obligations and/or rights consistent
|
|
169
|
+
with this License. However, in accepting such obligations, You may
|
|
170
|
+
act only on Your own behalf and on Your sole responsibility, not
|
|
171
|
+
on behalf of any other Contributor, and only if You agree to
|
|
172
|
+
indemnify, defend, and hold each Contributor harmless for any
|
|
173
|
+
liability incurred by, or claims asserted against, such Contributor
|
|
174
|
+
by reason of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Dudy Shochat
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: argus-ai-scanner
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: AI-native code security scanner with cascade analysis and Firecracker-microVM DAST runtime validation
|
|
5
|
+
Project-URL: Homepage, https://github.com/dshochat/Argus_Scanner
|
|
6
|
+
Project-URL: Documentation, https://github.com/dshochat/Argus_Scanner#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/dshochat/Argus_Scanner
|
|
8
|
+
Project-URL: Issues, https://github.com/dshochat/Argus_Scanner/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/dshochat/Argus_Scanner/releases
|
|
10
|
+
Author-email: David Shochat <davidsho1131@gmail.com>
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: ai-security,anthropic,claude,code-scanner,dast,prompt-injection,sarif,security,static-analysis,supply-chain-security,vulnerability-scanner
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Information Technology
|
|
18
|
+
Classifier: Intended Audience :: System Administrators
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
25
|
+
Classifier: Topic :: Software Development :: Testing
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.12
|
|
28
|
+
Requires-Dist: anthropic>=0.40.0
|
|
29
|
+
Requires-Dist: google-genai>=0.3.0
|
|
30
|
+
Requires-Dist: httpx>=0.27.0
|
|
31
|
+
Requires-Dist: pathspec>=0.12.0
|
|
32
|
+
Requires-Dist: pydantic>=2.8.0
|
|
33
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
34
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
35
|
+
Requires-Dist: requests>=2.32.0
|
|
36
|
+
Requires-Dist: structlog>=24.4.0
|
|
37
|
+
Requires-Dist: tiktoken>=0.7.0
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: mypy>=1.11.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest>=8.3.0; extra == 'dev'
|
|
43
|
+
Requires-Dist: respx>=0.21.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: ruff>=0.6.0; extra == 'dev'
|
|
45
|
+
Provides-Extra: docs
|
|
46
|
+
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
|
|
47
|
+
Requires-Dist: mkdocs>=1.6.0; extra == 'docs'
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
# Argus
|
|
51
|
+
|
|
52
|
+
**An AI-native code security scanner (Semantic Deep Analysis) <mark>that proves exploitability at runtime</mark>.**
|
|
53
|
+
|
|
54
|
+
Argus combines a cost-graduated LLM cascade (Gemini Flash-Lite → Sonnet 4.6 → Opus 4.6) with a sandbox tier that *executes* suspect code in a Firecracker microVM and observes what it actually does. Static-analysis findings get promoted to **CONFIRMED** only when the sandbox captures concrete runtime evidence — a network call, a file write, a process spawn. Findings that cannot be triggered are marked **UNREACHED**; findings the file's own defenses block are **BLOCKED**. No more "the LLM said it might be malicious."
|
|
55
|
+
|
|
56
|
+
Open source, Apache 2.0, BYOK. You pay your providers directly — Anthropic + Google for the cascade, Fly.io for the optional DAST sandbox. Argus collects nothing.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## What makes it different
|
|
61
|
+
|
|
62
|
+
Most scanners stop at "this code matches a vulnerability pattern." Argus runs the code, watches what it does, and reports per-finding outcomes:
|
|
63
|
+
|
|
64
|
+
| Status | Meaning |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `CONFIRMED` | The sandbox observed the exploit firing at runtime. PoC + event trace are surfaced with the finding. |
|
|
67
|
+
| `BLOCKED` | The attack was tested; the file's own code defended against it (sanitization, escaping, allowlist, etc.). |
|
|
68
|
+
| `UNREACHED` | The attack was tested; the code path is genuinely unreachable. |
|
|
69
|
+
| `NOT_TESTED` | Sandbox couldn't execute the test (with a sub-reason: `infra_stub` / `inconclusive` / `not_planned`). |
|
|
70
|
+
|
|
71
|
+
### vs. other approaches
|
|
72
|
+
|
|
73
|
+
| Approach | Output | False-positive burden | Evidence type |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| Pattern-match scanner (regex / AST) | Syntactic match | High | None |
|
|
76
|
+
| Single frontier LLM (single-call) | Probabilistic opinion (semantic) | Medium-high | LLM reasoning |
|
|
77
|
+
| **Argus** | **Runtime-verified verdict** | **Low** | **Sandbox traces** |
|
|
78
|
+
|
|
79
|
+
A `CONFIRMED` finding looks like this in `argus scan` output:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"cwe": "CWE-200",
|
|
84
|
+
"type": "data_exfiltration",
|
|
85
|
+
"severity": "critical",
|
|
86
|
+
"status": "CONFIRMED",
|
|
87
|
+
"confidence": 1.0,
|
|
88
|
+
"runtime_evidence": "Mock HTTP server at 127.0.0.1:8000 captured POST body containing
|
|
89
|
+
'FAKE_PRIVATE_KEY_CONTENT' and 'ssh-rsa AAAAFAKEKEY user@host'. The malware decoded
|
|
90
|
+
its base64 payload (process_exit step=0) and POSTed the contents of ~/.ssh/ to the
|
|
91
|
+
rewritten C2 endpoint, exactly as L1's hypothesis predicted.",
|
|
92
|
+
"proof_of_concept": "On any Unix host with SSH keys present, execution sends the full
|
|
93
|
+
contents of ~/.ssh/ to the remote C2 server over HTTPS."
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
> **This is Argus's moat.**
|
|
98
|
+
> Static and single-LLM scanners report *suspicion*.
|
|
99
|
+
> Argus reports **what the code actually did** — with concrete evidence, or clear proof it didn't.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Benchmark — Argus vs frontier single-call scanners
|
|
104
|
+
|
|
105
|
+
Scored against a ground-truth oracle derived from external security research and a multi-vendor LLM consensus (majority agreement):
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Verdict-exact (higher = better)
|
|
109
|
+
Argus (cascade + DAST) ████████████████████ 91.3%
|
|
110
|
+
Gemini 3.1 Pro █████████████████░░░ 82.6%
|
|
111
|
+
Grok 4.3 █████████████████░░░ 82.6%
|
|
112
|
+
Opus 4.6 █████████████████░░░ 78.3%
|
|
113
|
+
GPT 5.4 ████████████████░░░░ 73.9%
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Argus is **+13.0pp more accurate than Opus 4.6** and **+17.4pp more accurate than GPT-5.4**. On the rich-oracle subset Argus also leads on finding quality: **CWE F1 0.297 vs Opus 0.180** (+65% lift) and **capability F1 0.771 vs Opus 0.720**. Mean verdict-distance: **0.087 vs Opus 0.217**.
|
|
117
|
+
|
|
118
|
+
But the differentiator the single-call scanners can't produce is **runtime evidence**. On the same suite, Argus's DAST tier observed **25 CONFIRMED exploits + 1 BLOCKED** with concrete sandbox-captured artefacts — network calls, exfil POST bodies, process traces. By verifying which findings are **actually exploitable** versus mere pattern matches, Argus minimizes the false-positive flood that drowns security teams using static-only scanners. Unlike single-call LLMs that must guess exploitability, Argus's DAST tier tests it — turning many "maybe" findings into proven CONFIRMED exploits or clean UNREACHED / BLOCKED resolutions.
|
|
119
|
+
|
|
120
|
+
Methodology + per-file breakdown: [`bench_results/v1_1_launch/launch_report.md`](bench_results/v1_1_launch/launch_report.md). Re-run is one command: `python -m methodology.run_phase_a_report`.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## How the cascade keeps it cheap
|
|
125
|
+
|
|
126
|
+
Most files in a real codebase are clean. Argus is built around that observation: spend $0.0001 to dispatch a clean file in 1 second, $0.07 to deep-analyze a suspicious one, and only invoke the sandbox tier on the small subset of files where runtime confirmation actually matters.
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
File
|
|
130
|
+
↓
|
|
131
|
+
[$0] Preprocessing hash, deobfuscation, deps, attack-vector flags
|
|
132
|
+
↓
|
|
133
|
+
[Gemini Flash-Lite] Triage CLEAN | LOW | HIGH ~$0.0001/file
|
|
134
|
+
↓
|
|
135
|
+
├─ CLEAN → return
|
|
136
|
+
├─ LOW → Gemini Flash combined analysis ~$0.02/file
|
|
137
|
+
└─ HIGH → Sonnet 4.6 combined analysis ~$0.07/file (default)
|
|
138
|
+
↓ borderline / high-stakes
|
|
139
|
+
Opus 4.6 deep analysis ~$0.15/file (~20% of HIGH)
|
|
140
|
+
↓
|
|
141
|
+
[N=3 Sonnet ensemble] borderline-uncertainty path
|
|
142
|
+
↓
|
|
143
|
+
[DAST sandbox] Sonnet orchestrator + Firecracker microVM
|
|
144
|
+
(minimal / networked / ml_tools images)
|
|
145
|
+
↓ inconclusive after 2 iterations
|
|
146
|
+
Opus iter-3 escalation
|
|
147
|
+
↓
|
|
148
|
+
[Engine guard] DAST never lowers L1's verdict without
|
|
149
|
+
sandbox-grounded refutation
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Cost projection per 100 files
|
|
153
|
+
|
|
154
|
+
| Stage | Calls | API spend |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| Triage (Flash-Lite) | 100 | $0.10 |
|
|
157
|
+
| LOW analysis (Flash, ~50 files) | 50 | $1.00 |
|
|
158
|
+
| HIGH analysis (Sonnet, ~15 files) | 15 | $1.05 |
|
|
159
|
+
| HIGH + Opus escalation (~5 files) | 5 | $1.00 |
|
|
160
|
+
| Borderline ensemble (Opus, ~3 files) | 3 | $0.60 |
|
|
161
|
+
| DAST verification (~3 files) | 3 | $0.90 |
|
|
162
|
+
| **Total** | | **~$4.65** |
|
|
163
|
+
|
|
164
|
+
Hard cost caps (`--max-cost <USD>` per file, or `ScanConfig.max_cost_per_file_usd`) abort scans that exceed your declared budget. You'll never get a surprise bill from Argus — the bill comes from your API providers, on a meter you control.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Quick start
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pip install argus-ai-scanner
|
|
172
|
+
export ANTHROPIC_API_KEY=...
|
|
173
|
+
export GEMINI_API_KEY=...
|
|
174
|
+
argus scan path/to/your/file.py
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Requirements:
|
|
178
|
+
- Python 3.12+
|
|
179
|
+
- An Anthropic API key — [console.anthropic.com](https://console.anthropic.com/settings/keys)
|
|
180
|
+
- A Google AI Studio key — [aistudio.google.com](https://aistudio.google.com/app/apikey)
|
|
181
|
+
- Optional: a Fly.io account if you want the DAST sandbox tier ([Fly setup runbook](docs/dast-setup.md))
|
|
182
|
+
|
|
183
|
+
### Single-file scan
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Default: cascade + DAST on confirmed-malicious verdicts
|
|
187
|
+
uv run argus scan suspicious_package.py
|
|
188
|
+
|
|
189
|
+
# Tunable DAST coverage — also DAST suspicious files (~30-50% more API spend)
|
|
190
|
+
uv run argus scan suspicious_package.py \
|
|
191
|
+
--dast-trigger-verdicts suspicious,malicious,critical_malicious
|
|
192
|
+
|
|
193
|
+
# Strictest budget mode — DAST only the highest-severity verdict tier
|
|
194
|
+
uv run argus scan suspicious_package.py --dast-trigger-verdicts critical_malicious
|
|
195
|
+
|
|
196
|
+
# Hard cost cap, any verdict
|
|
197
|
+
uv run argus scan suspicious_package.py --max-cost 0.50
|
|
198
|
+
|
|
199
|
+
# Discovery mode — proactive payload sweep for CWEs L1 missed (+~$0.25/file)
|
|
200
|
+
uv run argus scan suspicious_package.py --enable-discovery
|
|
201
|
+
|
|
202
|
+
# Skip DAST entirely (no Fly setup required; cascade-only verdicts)
|
|
203
|
+
uv run argus scan suspicious_package.py --no-dast
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Repo scan (whole project)
|
|
207
|
+
|
|
208
|
+
`argus scan-repo PATH` walks a directory tree, applies file-type and `.gitignore` filters, and dispatches every supported file through the cascade. **For private repos, clone locally first using your existing git credentials, then point Argus at the local path** — Argus reads files from disk, not via the GitHub API.
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Whole project, current directory
|
|
212
|
+
cd ~/work/my-project
|
|
213
|
+
uv run argus scan-repo .
|
|
214
|
+
|
|
215
|
+
# PR / CI mode — only files changed vs main
|
|
216
|
+
uv run argus scan-repo . --diff origin/main
|
|
217
|
+
|
|
218
|
+
# CI with budget + SARIF output for GitHub Code Scanning
|
|
219
|
+
uv run argus scan-repo . \
|
|
220
|
+
--diff origin/main \
|
|
221
|
+
--max-cost 5.00 \
|
|
222
|
+
--output sarif \
|
|
223
|
+
--output-file findings.sarif
|
|
224
|
+
|
|
225
|
+
# Add a custom exclude pattern on top of .gitignore
|
|
226
|
+
uv run argus scan-repo . --exclude "vendor/**" --exclude "**/*.generated.*"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**What gets scanned:** the file-type allowlist covers Python, JavaScript / TypeScript, shell, Java bytecode, Markdown / RST / AsciiDoc (AI-injection surface), HTML / SVG / XML (XSS / XXE), and supply-chain manifests (`package.json`, `requirements.txt`, `Cargo.lock`, `go.mod`, `Gemfile`, `composer.json`, etc.). AI-agent config sentinels (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`, `mcp.json`, `claude_desktop_config.json`, `devcontainer.json`, …) are explicitly recognized — these are the prime vectors for malicious-instructions-in-config attacks against coding agents. Always-ignored: `.git`, `node_modules`, `__pycache__`, `.venv`, build dirs, etc.
|
|
230
|
+
|
|
231
|
+
**Output formats:** `--output markdown` (default; human summary) / `json` (full per-file results) / `sarif` (SARIF v2.1.0 JSON, uploadable to GitHub Code Scanning).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## DAST sandbox tier
|
|
236
|
+
|
|
237
|
+
DAST is **optional**. Without it, Argus ships verdicts using the L1 cascade alone. With it, you get per-finding `CONFIRMED` / `BLOCKED` / `UNREACHED` evidence backed by real runtime traces.
|
|
238
|
+
|
|
239
|
+
When enabled, every DAST plan runs in an ephemeral Firecracker microVM (Fly.io managed). The orchestrator:
|
|
240
|
+
|
|
241
|
+
1. Reads L1's hypotheses about *how* the file might be exploitable
|
|
242
|
+
2. Generates a concrete plan — sandbox commands, expected oracle, image hint
|
|
243
|
+
3. Submits to the microVM, which runs the file with file-content materialized at `/workspace/<basename>`, captures network calls via DNS hijack, and emits a structured event stream
|
|
244
|
+
4. Reads back the events, scores each hypothesis as `CONFIRMED` / `BLOCKED` / `UNREACHED` / `NOT_TESTED`
|
|
245
|
+
5. Surfaces the captured evidence (`runtime_evidence` field per finding)
|
|
246
|
+
|
|
247
|
+
Three sandbox images cover most workloads:
|
|
248
|
+
|
|
249
|
+
| Image | Contents | Use cases |
|
|
250
|
+
|---|---|---|
|
|
251
|
+
| `minimal-v1` | Python 3.13 + Node.js + npm + JRE + bash + curl | Pickle exploits, file I/O, subprocess, basic crypto |
|
|
252
|
+
| `networked-v1` | minimal + curl / wget / nc / dig / openssl | Exfiltration confirmation via real DNS / network captures |
|
|
253
|
+
| `ml_tools-v1` | networked + torch CPU + transformers + safetensors | Malicious model loaders, pickled `__reduce__` payloads |
|
|
254
|
+
|
|
255
|
+
Multi-language coverage today: Python, JavaScript / TypeScript, bash, Java bytecode. Roadmap: Go, Rust, Java source (compile required), .NET.
|
|
256
|
+
|
|
257
|
+
Full setup: [docs/dast-setup.md](docs/dast-setup.md).
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Privacy
|
|
262
|
+
|
|
263
|
+
Files you scan never leave your machine in two-tier (no DAST) mode. With DAST enabled, file content is shipped (gzip + base64) to **your own** Fly app over the Fly machines API — nothing is routed through any Argus-operated infrastructure.
|
|
264
|
+
|
|
265
|
+
Argus has no telemetry, no opt-in analytics, and no usage reporting. The CLI does not phone home.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Architecture invariants
|
|
270
|
+
|
|
271
|
+
The non-negotiable design rules — break these in a PR and expect a long review:
|
|
272
|
+
|
|
273
|
+
1. **Preprocessing is deterministic and free.** No model calls in `preprocessing/`. If you're tempted, the change belongs in `analysis/`.
|
|
274
|
+
2. **The cascade short-circuits cheap files cheap.** A clean file costs $0.0001 (triage only). Don't add expensive defaults.
|
|
275
|
+
3. **All runners are injectable.** `scan_file(triage_runner=, sonnet_runner=, opus_runner=, dast_runner=)`. The engine never hard-codes provider calls — that's how unit tests run with no API spend.
|
|
276
|
+
4. **DAST never silently lowers an L1 verdict.** A `malicious` → `suspicious` downgrade only fires when *every* L1 finding is sandbox-grounded as `BLOCKED` or `UNREACHED`. Without that, L1's verdict stands and `dast_keep_l1` is recorded.
|
|
277
|
+
5. **Cost guardrails enforced before any user-facing release.** `max_cost_per_file_usd` aborts mid-scan rather than overrun.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Documentation
|
|
282
|
+
|
|
283
|
+
| Topic | Page |
|
|
284
|
+
|---|---|
|
|
285
|
+
| Install + first scan | [docs/install.md](docs/install.md) |
|
|
286
|
+
| API key sourcing | [docs/api-keys.md](docs/api-keys.md) |
|
|
287
|
+
| Cascade architecture | [docs/architecture.md](docs/architecture.md) |
|
|
288
|
+
| Cost guide + budget knobs | [docs/cost-guide.md](docs/cost-guide.md) |
|
|
289
|
+
| DAST sandbox setup (Fly.io) | [docs/dast-setup.md](docs/dast-setup.md) |
|
|
290
|
+
| Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) |
|
|
291
|
+
| Security disclosures | [SECURITY.md](SECURITY.md) |
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Development
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
uv sync --extra dev
|
|
299
|
+
uv run pytest tests/unit -v # always; no API spend
|
|
300
|
+
uv run ruff check . && uv run ruff format .
|
|
301
|
+
uv run mypy --strict .
|
|
302
|
+
uv run pytest tests/integration -v # before runner / engine changes; spends API
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Argus is Python 3.12+, mypy `--strict`, ruff for lint and format. Pydantic v2 for cross-boundary structures. `structlog` for logging — never `print()` outside the CLI. Tests are split into unit (mocked, mandatory) and integration (live API, optional + manual). CI runs unit + lint + types on every PR; integration tests stay local because nobody wants surprise API bills on their fork.
|
|
306
|
+
|
|
307
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full PR process.
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## License
|
|
312
|
+
|
|
313
|
+
[Apache License 2.0](LICENSE).
|
|
314
|
+
|
|
315
|
+
Copyright © 2026 David Shochat and contributors.
|