File size: 14,506 Bytes
8213626 6c29ddb 8213626 6c29ddb 8213626 6c29ddb 8213626 6c29ddb 8213626 6c29ddb 8213626 6c29ddb 8213626 6c29ddb 8213626 6c29ddb 6edbf17 6c29ddb 6edbf17 6c29ddb 6edbf17 6c29ddb c825397 2ad8e85 6852cc0 2ad8e85 6c29ddb 47a3454 6c29ddb 2dfd4d9 6c29ddb f8043e3 6c29ddb 1c806f9 47a3454 1c806f9 8213626 1b6cd43 8213626 1b6cd43 8213626 1b6cd43 8213626 1b6cd43 3425054 cf017f9 00da716 cf017f9 3425054 8213626 1b6cd43 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | # V.A.P.E. Architecture
> Status legend: [OK] implemented & running Β· [WIP] partial/scaffolded Β· [TBD] planned
V.A.P.E. is an autonomous on-chain security & intelligence operation. It runs as
**two cooperating runtimes** plus a **self-improving skill ecosystem**, all on free
tiers (Groq + GitHub Actions + open-source tooling).
## High-level flow
```
ββββββββββββββββββββββββββββββββββββββββββββ
β DATA SOURCES (real) β
β Base RPC Β· Etherscan V2 Β· DexScreener β
β GoPlus Β· CoinGecko Β· DeFiLlama Β· CVEs β
β Immunefi/Code4rena Β· X/@based_vape β
βββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ
β β β
βββββββββΌβββββββββ βββββββββββΌββββββββββ βββββββββββΌββββββββββ
β PYTHON ENGINE β β SKILLFORGE β β ACP MONITOR β
β (CI, hourly) β β (GitHub Actions) β β (job lifecycle) β
β agents/*.py β β skillforge/* β β scripts/acp-* β
βββββββββ¬βββββββββ βββββββββββ¬βββββββββββ βββββββββββ¬ββββββββββ
β β β
βββββββββββββββββββ¬ββββββββββββββββ΄ββββββββββββββββββ¬ββββββββββββββββ
β β
ββββββββββΌβββββββββ ββββββββββΌββββββββββ
β intel/ β β Virtuals ACP β
β reports/audits/ β β eventsβtriageβ β
β broadcasts/ β β negotiate/fund/ β
β bounty-radar/ β β complete jobs β
ββββββββββ¬βββββββββ ββββββββββ¬ββββββββββ
β β
ββββββββββΌβββββββββ ββββββββββΌββββββββββ
β GitHub Pages β β USDC escrow on β
β (docs/) β UI β β Base β payment β
βββββββββββββββββββ ββββββββββββββββββββ
```
Component-level status detail (see the legend above) lives in the table
below, not inside the diagram β a diagram should show structure, a table
should show status, so neither has to be hand-re-aligned every time a
component's state changes.
| Component | Status | Notes |
|---|---|---|
| `agents/run.py` | [OK] | Hourly bounty-cycle orchestration |
| `agents/investigate.py` | [OK] | Deep-investigation engine, real recon+scoring |
| Groq LLM tier | [OK] | Frontier-model fallback chain, see `agents/llm.py` |
| `skillforge/tools/static/slither.sh` | [OK] | Static analysis wrapper |
| `agents/acp_fulfill.py` / wallet | [WIP] | ACP job fulfillment + wallet scaffolding |
| `skillforge/harvest.py` | [OK] | Hourly CVE/tool harvest |
| `skillforge/toolcheck.py` | [OK] | 6x/day tool smoke-test |
| `skillforge/synthesize.py` | [OK] | Daily skill distillation β PR |
| Security tool tiers | [OK] | 13 tools registered across static/fuzzing/ai-redteam/recon |
| `skillforge/memory/` | [OK] | Shared append-only memory base |
## Components
### 1. Python engine β `agents/` [OK] (the CI workhorse)
Runs hourly in GitHub Actions (`.github/workflows/bounty-cycle.yml`).
- **`run.py`** β single-pass orchestrator. `ask_llm()` (Groq `llama-3.1-8b-instant`,
3-retry rate-limit backoff) + `run_slither()` (30s timeout). Dual mode via
`--review-repo` β bounty reports vs. self-review reports.
- **`main.py`** β `VAPE` (investigator) + `HACK` (red-team auditor) over fetched bounties.
- **`vape.py` / `hack.py`** β persona engines with `vape_system.md` / `hack_system.md` prompts.
- **`tools.py`** β `fetch_bounties()`, `log_report()`.
- **`acp_fulfill.py` / `wallet.py`** [WIP] β ACP job fulfillment + wallet scaffolding (signing via ACP CLI).
- **`investigate.py`** [OK] β deep-investigation engine, CertiK-style scoring (risk is the default,
not the exception β see README's table for the full check list). Every real verdict is
permanent in `intel/investigations/ledger.json`; auto mode never re-investigates an address
already on record, `--address` always forces a re-check (hired job / deliberate deep-dive).
`fail-list.md`/`caution-list.md`/`pass-list.md` regenerate from the ledger every run.
- **`review_ledger.py`** [OK] β self-review: re-checks the oldest-reviewed addresses per list
against fresh data (pass/caution weekly, fail monthly, `review-ledger.yml`), logs a real
finding when a past verdict drifts. This is VAPE auditing its own track record, not just
producing new ones.
- **`token_scan.py`** [OK] β free Hunt console + paid x402 quick-check, same keyless checks as
`investigate.py` minus the ones needing an optional Etherscan key. Ported field-for-field to
`worker/src/scan.ts` and `docs/assets/app.js`, kept honest by `scan-parity.yml`.
- **`scout.py`** [OK] β bounty-radar triage, rule-based fit scoring (no LLM), hourly via `scout.yml`.
- **`intel_common.py` / `security_sweep.py` / `base_sweep.py` / `sentiment_sweep.py` /
`virtuals_sweep.py` / `macro_sweep.py` / `mainnet_patch_check.py` / `bug_bounty_intel.py`**
[OK] β revives the intel/reports/{security,base,sentiment,virtuals,macro,mainnet-patch-check,
bug-bounty-intel}-*.md sweeps, which used to run as ad hoc Claude Code sessions (never
committed code) until they all silently stopped 2026-07-01 with zero trace in git history.
Same design rule as `scout.py`: the headline verdict/score is computed deterministically
from real data (`data_fetchers.py` + `skillforge/research.py`'s live web search), the LLM
only narrates what the real data means. Scheduled via `intel-sweeps.yml` β security/base/
virtuals 4x/day, sentiment 2x/day, macro daily, the two follow-up checks weekly.
`security_sweep.py` also writes `data/attack-feed.json` (real, dated incidents over a
rolling 56-day/8-week window from the same hacks feed, powering the site's homepage
ticker + "Threat Ledger" section β see `docs/assets/attackfeed.js`) and, for any new
Base-chain incident it can resolve a real on-chain address for via web search, runs
`investigate.py`'s actual forensics pipeline against it (`attempt_incident_forensics()`)
β never a fabricated address, honestly skipped when one can't be found.
`investigate.py::hack_correlation()` was also fixed to genuinely cross-reference a
target's risk traits against real incidents in the same feed (citing the specific
matching incident by name/date/amount) instead of returning generic canned text
regardless of what the real data showed.
`security_sweep.py::learn_from_incidents()` closes the loop from "reports/investigates"
to "learns": every incident within the same 14-day actionable window is run through a
deterministic keyword classifier (`ATTACK_PATTERNS`) mapping its real `technique` string
to a known vulnerability class, a concrete prevention measure, and β honestly β whether
`investigate.py`'s `score()` already has a named check for it or whether this is an
admitted coverage gap. Where forensics resolved a real Base address, it also backtests
VAPE's own scoring model against the actual verdict (`PROCEED`/`CAUTION`/`REJECT`) on
that contract β a `PROCEED` verdict on something that then got exploited is logged as a
real model miss, not smoothed over. Every lesson is logged once (idempotent via
`attack_lessons_state.json`) to `skillforge/memory/findings.jsonl`, surfaced in the
report's "Lessons Learned" section and per-incident in `data/attack-feed.json`/the
Threat Ledger UI. Nothing here is LLM-guessed β see this module's design law above.
- **`self_improve.py`** [OK] β finds one real, evidence-backed issue, priority order: (1)
unaddressed CRITICAL/HIGH findings from the AI red-team tools below β closes the loop
from "VAPE discovers it's vulnerable" to "VAPE proposes to fix itself" β then (2) pyflakes
bugs, then (3) tool-registry gaps (never an open-ended LLM guess). Has `builder.py`
propose a fix grounded in the actual target file, opens a real PR via `skillforge/mcp.py`'s
`GitHubMCPWrapper` for human review (never auto-merges), and logs a "lesson" to
`skillforge/memory/lessons.jsonl` every cycle β the missing link that now feeds
self-improvement's own real work into the same Memory `skillforge/synthesize.py` distills
from. `skillforge/memory/self_improve_state.json` tracks which findings already got a PR
so the same one isn't re-targeted forever.
- **`build_request.py`** [OK] β the concrete "VAPE can build tools/apps/anything needed"
capability: label a GitHub issue `vape-build` (real-time via `build-request.yml`'s
`issues: labeled` trigger, not polled) and `builder.py`'s new `generate_project()`
attempts a real multi-file implementation (parses `### FILE: path` blocks, rejects path
traversal/absolute paths, caps file count/size). Files land in an isolated
`build-requests/issue-<N>-<slug>/` directory via a PR β never applied to the real codebase
automatically. Same two gates as `self_improve.py`: Builder's security validation, then
human PR review.
- **`redteam.py`** [OK] β real prompt-injection test against VAPE's own report pipeline: crafts
a malicious token symbol, runs it through the real `investigate.py -> run.py` grounding
path and a real LLM call, judges the actual output, and logs a real finding if it's
hijacked (daily via `redteam.yml`). See `agents/run.py::_build_grounding()` for the
untrusted-data framing this test verifies.
- **`skillforge/tools/ai-redteam/`** [OK] β garak (native `groq` generator), promptfoo (native
`groq:` provider, config generated from the real `VAPE_REPORT_SYSTEM`), and deepteam
(`vape_deepeval_model.py` wraps `agents/llm.py` as the simulator+judge β zero new
cost/secrets) all wired against VAPE's real production model, daily via
`redteam-deep.yml`. See `skillforge/skills/ai-agent-redteam.md`.
### 2. SKILLFORGE β `skillforge/` [OK] (self-improving skill+tool ecosystem)
Zero-local-compute skill growth via GitHub Actions. See `skillforge/MANIFEST.md`.
- **harvest** (hourly) β real CVE + tool-release intel, no LLM.
- **toolcheck** (6Γ/day) β installs & verifies 13 security tools on runners, no LLM.
- **synthesize** (daily) β Groq distills harvested data β opens a PR.
- **Tool tiers:** static (slither/aderyn/mythril) Β· fuzzing (echidna/foundry) Β·
ai-redteam (garak/promptfoo/deepteam) Β· recon (token_safety/contract_recon/wallet_trace/base_rpc/market_data).
- **Memory:** append-only `memory/` (tools-registry.json, findings/skills/lessons.jsonl, INDEX.md).
- **Skills:** playbooks in `skillforge/skills/` (sc-static-analysis, ai-agent-redteam, onchain-recon-forensics).
### 3. intel/ pipeline [OK] (the audit trail)
Timestamped real-data outputs committed continuously: `reports/`, `audits/poc-reports/`,
`broadcasts/`, `bounty-radar/`, `engagements/`, `catalog/`. Synced to the HF Space via
`sync-to-hub.yml`.
### 4. ACP job monitor [OK] (autonomous revenue)
Catches incoming ACP jobs and negotiates β funds β completes at near-zero compute.
3 layers: persistent `acp events listen` daemon (zero LLM) β drain+triage loop (zero LLM)
β reasoning handler that fires only on a real funded job. 14 live offerings; USDC escrow on Base.
*(Operational layer; runs on the host alongside the repo.)*
### 5. UI β `app.py` / `docs/` [OK]
Gradio app (`app.py`, `requirements.txt: gradio`) for the HF Space; `docs/index.html` is
VAPE's public site β narrative case-file pages over the same real data (investigations,
reputation, TVL, Intel Explorer), wallet connect + a wallet profile β portfolio, 24h P&L,
an Alchemy+CoinGecko-backed cost-basis estimate, and case history
(`docs/assets/wallet.js`/`profile.js`) β and hiring surfaces for both payment rails: an
x402 pay-per-call panel backed by `worker/` (Cloudflare Worker/Deno Deploy, see
`docs/DEPLOYMENT.md` section E) and an ACP panel surfacing the real job lifecycle in
`docs/ACP_PROTOCOL.md`.
Still zero-build β `docs/assets/*.js` are plain files, no bundler.
## Data-flow summary
Real sources β engines analyze β findings written to `intel/` (audit trail) and
SKILLFORGE memory (learning) β surfaced via UI/broadcasts β monetized via ACP jobs.
Every loop is grounded in **real data only** β no simulated or hypothetical output.
## Runtime map
| Runtime | Trigger | Compute | State |
|---|---|---|---|
| Python engine | GH Actions hourly | free runner | reports/ commits |
| SKILLFORGE | GH Actions (hourly/6x/daily) | free runner | skillforge/memory |
| ACP monitor | persistent daemon | ~zero idle | acp-monitor/state.json |
## Current vs. future
**Now:** autonomous hourly LLM+slither reports, SKILLFORGE 13-tool verification, intel
audit trail, ACP job monetization, self-review PRs.
**Next:** richer UI, external-target auditing (beyond self-repo), persistent
cross-run agent memory, full ACP deliverable automation.
|