Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Built an Autonomous AI Agent That Earns USDC While I Sleep

说明与用途

在 Cloudflare Workers 上构建的自治 AI 代理,使用 x402 接收 USDC 支付,运行精简版 CodeBERT 模型检测代码漏洞,并自动赚取收入。

问题

Create a self‑contained software component that provides a useful service, accepts programmable cryptocurrency payments (USDC on Base), and operates with minimal human oversight.

结果

Over a three‑month test period the agent processed requests with <200 ms inference latency, maintained >85 % F1 on the Devign dataset, and earned USDC payments with observable cost‑revenue metrics.

工作流

  • Deploy Cloudflare Workers API endpoint with rate limiting
  • Mount persistent object store (KV/S3) for model weights
  • Load distilled CodeBERT model once per worker instance
  • Validate incoming HTTP POST with x402 header
  • Verify x402 signature using x402‑js
  • Run inference to predict vulnerability and confidence
  • Return JSON response with prediction
  • If payment verified, credit USDC to agent wallet
  • Log request, metrics, and payment status to Cloudflare Logpush/Prometheus
  • Monitor logs and alerts for failures or cost anomalies

证据

The agent follows a classic request‑response loop: an external client sends an HTTP request to a public endpoint, the agent validates the request, performs a computation, returns a result, and—if the request includes a valid x402 payment—receives USDC in its wallet.

来源

The model is a distilled version of microsoft/codebert-base fine‑tuned on the Devign dataset.

来源

  • 记录日期: 2026-09-16T16:45:20.394Z