How agentgg-dev/agentgg works
agentgg is an agentic SAST scanner with CLI scanning, finding validation, persisted reports, and a local findings viewer. The main workflow runs a repository or diff scan, uses recon to brief analysis agents, checks candidate findings, and saves results for status, revalidation, and browsing. The README documents provider choice, agent catalogs and creation, Semgrep, and fix/dedup workflows; these remain represented where the tree supports them. Relationships are limited to README statements and excerpted or indexed references; unsampled subsystem links are omitted or marked unverified.
Main entry points: scan.ts Scan orchestration · detect.ts Agent detection · page.tsx Local report viewer · cli.ts CLI commands
Components 20
Scanning
- CLI commands
packages/cli/src/cli.ts - Scan orchestration
packages/cli/src/commands/scan.ts - Repository recon
packages/cli/src/recon.ts - Agent catalog
packages/cli/src/agent-catalog.ts - Scope filtering
packages/cli/src/pre-filter.ts
Analysis
- Agent detection
packages/cli/src/detect.ts - Model providers
packages/cli/src/providers/index.ts - Semgrep analysis
packages/cli/src/semgrep.ts - Finding validation
packages/cli/src/validator.ts - Live reproduction
packages/cli/src/validation/reproduce.ts - Finding scoring
packages/cli/src/scoring.ts - Finding deduplication
packages/cli/src/deduper.ts - Finding fixes
packages/cli/src/fixer.ts
Results
- Domain and persistence
packages/core/src/persistence.ts - Markdown reports
packages/cli/src/reporters/md.ts
Viewer
- Local report viewer
packages/viewer/app/page.tsx - Viewer state loader
packages/viewer/app/lib/state.ts - Findings table
packages/viewer/app/components/FindingsTable.tsx
Other components
- CLI user
- Model service
Connections 20
- CLI user → CLI commands: runs commands
- CLI commands → Scan orchestration: starts scans
- Scan orchestration → Repository recon: runs recon
packages/cli/src/commands/scan.ts - Scan orchestration → Agent catalog: loads agents
packages/cli/src/commands/scan.ts - Scan orchestration → Scope filtering: filters scope
packages/cli/src/commands/scan.ts - Scan orchestration → Agent detection: runs analysis
packages/cli/src/commands/scan.ts - Agent detection → Model providers: uses provider
- Model providers → Model service: sends requests
- Scan orchestration → Semgrep analysis: uses Semgrep
packages/cli/src/commands/scan.ts - Agent detection → Finding validation: validates findings
packages/cli/src/detectors/vercel-agent.ts - Finding validation → Live reproduction: requests reproduction
- Agent detection → Finding scoring: scores findings
packages/cli/src/scoring.ts - Scan orchestration → Finding deduplication: deduplicates findings
packages/cli/src/commands/scan.ts - Scan orchestration → Finding fixes: applies fix phase
packages/cli/src/commands/scan.ts - Scan orchestration → Domain and persistence: reads and writes state
packages/cli/src/commands/scan.ts - Scan orchestration → Markdown reports: writes reports
packages/cli/src/commands/scan.ts - CLI user → Local report viewer: opens results
- Local report viewer → Viewer state loader: loads scan state
packages/viewer/app/page.tsx - Local report viewer → Findings table: renders findings
packages/viewer/app/page.tsx - Viewer state loader → Domain and persistence: reads domain state
packages/viewer/app/lib/state.ts