Powered by Claude AI · Private Beta

Your AI Agent that
Codes. Audits. Hunts.

Luna is an autonomous desktop AI that executes complex developer tasks, audits smart contracts, and researches security vulnerabilities — without you lifting a finger.

🚀 Request Early Access Star on GitHub Read the Docs
luna-agent — autonomous session
Claude
AI Engine (Anthropic)
6+
AI Models Supported
100%
Local Mode Available
Solana
Native Web3 Support

How it works

One agent. Infinite tasks.

Tell Luna what you need in plain language. She plans, executes, reflects, and delivers — autonomously.

01

You set the goal

Describe your task in plain language — "audit this Solana program", "find vulnerabilities in this contract", "refactor my codebase". Luna understands full context.

02

Luna plans & executes

Luna breaks the task into steps, uses the right tools, writes code, runs analysis, searches docs — and uses a self-reflection loop to verify results before moving on.

03

You get results

Receive a detailed report, working code, or vulnerability findings. Luna presents everything clearly and waits for your next instruction.

Built for serious builders

Every feature was designed for developers and security researchers who can't afford to waste time.

🤖

Autonomous Agent Loop

Core

Luna uses a self-reflection loop — she plans, acts, evaluates, and corrects herself without interruption. Complex multi-step tasks run end-to-end while you focus on other things.

🔍

Smart Contract Auditing

Web3

Native support for Solana (Anchor/Rust) and EVM smart contracts. Luna scans for reentrancy, access control, overflow, and logic bugs with detailed, actionable reports.

🛡️

Bug Bounty Research

Security

Designed for Immunefi and HackerOne hunters. Luna assists with recon, exploit research, PoC generation, and formats professional vulnerability reports that get accepted.

👁️

Multimodal Vision

AI

Upload screenshots, architecture diagrams, or PDFs. Luna reads images alongside code and docs to give you richer, more accurate analysis than text-only AI tools.

🔒

Zero-Cloud Mode

Privacy

Run Luna 100% offline with Ollama. Your code and research never leave your machine — critical for sensitive security work, NDA projects, or regulated environments.

🗂️

Visual Workspace

Productivity

VS Code-style file tree with live preview. Luna navigates your project structure, edits files, and runs analysis directly — no copy-pasting required.

Multi-Model Support

Flexible

Switch between Claude (Anthropic), GPT-4o (OpenAI), Grok (xAI), Llama (Groq), and local Ollama models per task. Luna auto-routes to the best model for each job type.

💎

Grains Credit System

Payments

Pay for AI usage in Grains via USDC on Solana. No subscriptions — top up when you need it, pay only for what you use. Atomic on-chain payments with full transaction history.

In Action

See Luna at work

Real examples of what Luna produces — from audit reports to vulnerability research.

Solana Audit
Bug Bounty Report
Code Review
audit_report.md
# Smart Contract Audit — Solana AMM Protocol # Generated by Luna Agent · 2026-05-01 ## CRITICAL [HIGH] — Unchecked Arithmetic in swap_tokens() Location: programs/amm/src/lib.rs:247 Severity: CRITICAL Impact: Integer overflow → incorrect token amounts credited to attacker ### Vulnerable Code let out_amount = in_amount * reserve_out / reserve_in; // ↑ No overflow check — wraps silently on u64 overflow ### Recommended Fix let out_amount = (in_amount as u128) .checked_mul(reserve_out as u128) .ok_or(ErrorCode::Overflow)? / reserve_in as u128; PoC: Attacker swaps 2^63+1 tokens → overflow → receives 10x expected output Immunefi Severity: Critical — up to $50,000 bounty

Simple. Usage-based. No surprises.

Pay in Grains via USDC on Solana. No monthly fees, no lock-in. Top up when you need it — 1 USDC = 1,000 Grains.

Starter
$29
30,000 Grains
~1,500 messages or 200 audits
  • All AI models included
  • Agentic task execution
  • Code review & generation
  • Multimodal vision
  • Community support
Get Started
Pro Hunter
$199
270,000 Grains
35% bonus · ~13,500 messages
  • Everything in Builder
  • Zero-cloud offline mode
  • Unlimited file workspace
  • Webhook automation
  • Dedicated support
Join Waitlist
Elite
$499
750,000 Grains
50% bonus · Bounty without limits
  • Everything in Pro Hunter
  • Max-context sessions
  • Auto-agent pipelines
  • Custom model routing
  • White-glove onboarding
Contact Us

Everything you need to know

Architecture, the Grains system, API reference, and quick-start guides — all in one place.

🏗 Architecture
💎 Grains System
⚡ API Reference
🚀 Quick Start

Architecture Overview

Luna Agent is a two-tier desktop application. The Electron frontend handles the UI and communicates with a local FastAPI backend that orchestrates AI models, manages the file workspace, and processes Solana payments.

System Diagram
🌙 Electron (React)
Chat UI / Workspace
File Tree / Editor
Solana Pay QR
IPC / HTTP localhost:8000
⚙ FastAPI (Python)
Agent Loop / LTM
Multi-model Router
Payment Service
Tech Stack
⚛ React + TypeScript 🔷 Electron 🐍 FastAPI (Python) 🤖 Claude API 🗄 Supabase (Postgres) ⛓ Solana Web3.js 🔐 Helius Webhooks ☁ Cloudflare Workers
Agent Loop
# Simplified agent execution flow while task_not_complete: thought = llm.think(task, context, tools) action = llm.choose_tool(thought) result = tools.execute(action) context = memory.update(result) done = llm.reflect(context) # self-check if done: yield final_answer(context)
Repository
luna-agent PUBLIC
Monorepo — Electron frontend + FastAPI backend — MIT License
⭐ Star →
Sponsor Luna
Support development via GitHub Sponsors, Gitcoin or Solana
❤️ Sponsor →

Grains Credit System

Grains are Luna's internal AI credits. They are purchased with USDC on the Solana blockchain via Solana Pay — no credit cards, no subscriptions. Every AI operation deducts a small number of Grains proportional to its computational cost.

Exchange Rate
PackageUSDGrainsBonusRate
Starter$2930,0001,034 /USDC
Builder$7995,000+20%1,202 /USDC
Pro Hunter$199270,000+35%1,357 /USDC
Elite$499750,000+50%1,503 /USDC
Base rate: 1,000 Grains per USDC — volume bonuses applied automatically
Grain Cost per Operation
OperationApprox. CostNotes
Chat message (short)~18 GrainsClaude Haiku
Chat message (long)~35–80 GrainsClaude Sonnet
Smart contract audit~150–500 GrainsMulti-pass analysis
Vision / screenshot~40–120 GrainsDepends on image size
Agent task (complex)~200–800 GrainsMulti-step execution
Payment Flow
1

QR Code generated

Luna creates a Solana Pay URL with a unique reference UUID. QR expires in 15 minutes.

2

User sends USDC on Solana

Scan with Phantom, Backpack, or any Solana Pay-compatible wallet. USDC mint: EPjFWdd5Auqq...

3

Helius webhook confirms

The backend validates the tx signature, checks the reference memo, and atomically credits Grains to your account via a Postgres RPC.

4

Retry guarantee

If a credit fails due to a network issue, the retry job re-runs every 60 seconds for up to 10 attempts — you will never lose Grains.

Security
🔑 HMAC-SHA256 webhook auth 🛡 Anti-replay (UNIQUE tx_signature) ⚛ Atomic Postgres RPC 🔄 60s retry loop

API Reference

The FastAPI backend runs on http://localhost:8000 when Luna is running. All endpoints require a valid session token passed as Authorization: Bearer <token>.

Agent
POST
/api/agent/chat
Send a message to Luna. Returns a streaming SSE response with agent thoughts and tool outputs.
POST
/api/agent/stop
Abort the current agent task. Drains remaining streamed output.
GET
/api/agent/history
Retrieve conversation history for the current session.
Payments
POST
/api/payments/session
Create a Solana Pay payment session. Returns QR URL, reference UUID, and expiry timestamp.
GET
/api/payments/status/{reference}
Poll payment status: pending | finalized | expired
GET
/api/payments/balance
Returns the current Grains balance for the authenticated user.
POST
/api/payments/webhook
Helius webhook receiver. Validates HMAC signature, processes USDC transfers, credits Grains.
Workspace
GET
/api/workspace/tree
Returns the file tree of the current workspace directory.
GET
/api/workspace/file
Read file contents. Query param: ?path=relative/path
Example — Create Payment Session
// POST /api/payments/session const res = await fetch('/api/payments/session', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ usdc_amount: 29 }) }); const { reference, solana_pay_url, expires_at, grains } = await res.json(); // grains = 30000 (29 USDC × 1000 + volume bonus) // solana_pay_url → render as QR code

Quick Start

Get Luna running locally in under 5 minutes. You'll need Node.js 18+, Python 3.11+, and an Anthropic API key.

1 — Clone & Install
# Clone the monorepo git clone https://github.com/Prestes16/luna-agent cd luna-agent # Install Python dependencies python -m venv venv && venv\Scripts\activate pip install -r requirements.txt # Install frontend dependencies cd luna-desktop && npm install
2 — Configure Environment
# Copy and edit .env cp .env.example .env # Required keys (at least one LLM) ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... # Optional — Solana payments LUNA_RECEIVER_WALLET=HfcPmtJEMABW... GRAINS_PER_USDC=1000
3 — Launch (Windows one-click)
# Double-click or run: start-luna.bat # Opens backend + Electron automatically # Backend: http://localhost:8000/docs
4 — Manual start (Linux / macOS)
# Terminal 1 — backend uvicorn app.main:app --reload --port 8000 # Terminal 2 — frontend cd luna-desktop && npm run dev
5 — Run Supabase Migrations
# In Supabase SQL Editor, run in order: # migrations/001_users.sql # migrations/002_payment_history.sql # migrations/003_pending_credits.sql # migrations/004_memory.sql # migrations/005_atomic_deduct_grains.sql ← critical
⚠ Run 005 before accepting live payments
Need Help?
Open an issue on GitHub, DM us on @agent_luna16, or email lunaagent@bagsshield.org.

Be first to use Luna.

Join the waitlist and get early access + 500 free Grains to start your first session.

✅ You're on the list! We'll reach out soon.
D
R
M
A
Join developers & security researchers on the waitlist