NEWPowered by Ollama · 100% 로컬 실행→

스마트 컨트랙트 감사,
curl 한 줄이면 충분합니다

SolAudit AI는 Solidity 보안 감사에 특화된 오픈 LLM 모델 모음입니다. Ollama 위에서 내 컴퓨터로만 실행되어 코드가 외부로 나가지 않고, 재진입·접근 제어·오라클 조작 같은 취약점을 JSON 리포트로 돌려줍니다.

Solidity 다이아몬드를 검사하는 Ollama 라마
~/contracts — zsh

❯ curl -s -X POST https://solauditai.dev/api/audit -H "Content-Type: text/plain" --data-binary @Vault.sol | jq .report

⠿ solaudit-coder:7b 분석 중… 212 lines · 2.8s

CRITICAL Reentrancy in withdraw() SWC-107 · L16

HIGH     tx.origin used for authorization SWC-115 · L22

LOW      Missing events for state changes L10, L18

risk_score: 94 / 100

감사 특화 모델
4
취약점 유형 (SWC)
20+
외부로 전송되는 코드
0 byte
컨텍스트 토큰
32K
Solidity ^0.8OllamaEthereum / EVMFoundryHardhatOpenZeppelinSWC RegistryQwen2.5-CoderDeepSeek-R1Llama 3.2JSON ReportGitHub ActionsSolidity ^0.8OllamaEthereum / EVMFoundryHardhatOpenZeppelinSWC RegistryQwen2.5-CoderDeepSeek-R1Llama 3.2JSON ReportGitHub Actions

Models

용도에 맞게 고르는 4가지 감사 모델

모든 모델은 검증된 오픈소스 코드 LLM 위에 Solidity 감사용 시스템 프롬프트와 파라미터를 입힌 Ollama Modelfile로 제공됩니다.

7B
추천

solaudit-coder:7b

속도와 정확도의 균형

일상적인 PR 리뷰와 CI 파이프라인에 적합한 기본 모델. 코드 특화 베이스로 Solidity 문법 이해도가 높습니다.

Base
qwen2.5-coder:7b
크기
4.7 GB
Context
32K
권장 사양
RAM 8GB · GPU 선택
정확도78
속도88
ollama create solaudit-coder:7b
14B
Reasoning

solaudit-deep:14b

단계별 추론 기반 심층 분석

호출 흐름과 상태 변화를 단계적으로 추론해 재진입·가격 조작 같은 복합 취약점을 찾아냅니다.

Base
deepseek-r1:14b
크기
9.0 GB
Context
32K
권장 사양
RAM 16GB · VRAM 10GB+
정확도86
속도58
ollama create solaudit-deep:14b
32B
최고 정확도

solaudit-pro:32b

메인넷 배포 전 최종 점검용

대형 프로토콜, 다중 컨트랙트 코드베이스를 위한 플래그십 모델. 가장 낮은 오탐률을 제공합니다.

Base
qwen2.5-coder:32b
크기
20 GB
Context
32K
권장 사양
RAM 32GB · VRAM 24GB+
정확도92
속도34
ollama create solaudit-pro:32b
3B
경량

solaudit-lite:3b

노트북에서도 가볍게

빠른 1차 스캔과 교육용으로 적합한 경량 모델. 에디터 저장 시 즉시 검사하는 용도로 쓰기 좋습니다.

Base
llama3.2:3b
크기
2.0 GB
Context
16K
권장 사양
RAM 4GB · CPU 전용 가능
정확도64
속도97
ollama create solaudit-lite:3b

* 정확도/속도는 모델 간 상대 비교를 위한 참고 지표이며, 실제 성능은 하드웨어와 코드베이스에 따라 달라집니다.

How it works

코드는 내 컴퓨터를 떠나지 않습니다

클라우드 API 키도, 사용량 과금도 없습니다. 터미널 → Ollama → 보안 리포트, 세 단계가 전부입니다.

터미널에서 로컬 LLM을 거쳐 보안 리포트로 이어지는 파이프라인
  1. 01

    컨트랙트 전송

    curl로 .sol 파일을 그대로 보냅니다. 로컬 Ollama API(:11434) 또는 이 사이트의 /api/audit 프록시 모두 지원합니다.

    curl --data-binary @Vault.sol
  2. 02

    로컬 LLM 추론

    Ollama가 내 GPU/CPU에서 감사 모델을 실행합니다. 시스템 프롬프트가 SWC 레지스트리 기반 체크리스트로 코드를 분석합니다.

    ollama · temperature 0.1
  3. 03

    JSON 리포트

    심각도·위치·SWC ID·수정 방법이 담긴 구조화된 JSON을 반환해 jq, CI, 대시보드에 바로 연결할 수 있습니다.

    format: "json"
돋보기로 Solidity 코드를 검사하는 라마

Why local AI

감사관 라마가
24시간 코드를 지킵니다

SolAudit AI는 전문 감사 전 단계에서 흔한 실수를 빠르게 걸러내는 1차 방어선입니다. 개발 루프 안에서 즉시 피드백을 받으세요.

완전한 프라이버시

미공개 프로토콜 코드도 안심하고 분석하세요. 모든 추론은 로컬 Ollama 런타임에서만 일어납니다.

무료 · 무제한

토큰 과금이 없으니 커밋마다, 파일마다 원하는 만큼 감사를 돌려도 비용이 들지 않습니다.

구조화된 출력

Ollama의 JSON 모드로 항상 같은 스키마의 리포트를 받습니다. 파싱 에러 걱정 없이 자동화하세요.

CI/CD 친화적

curl과 jq만 있으면 GitHub Actions, GitLab CI에서 critical 발견 시 빌드를 실패시킬 수 있습니다.

Quick start · curl

터미널에서 5분 만에 첫 감사까지

모델과 운영체제를 고르면 아래 명령어가 자동으로 바뀝니다. 복사해서 순서대로 붙여넣기만 하세요.

  1. 1

    Ollama 설치

    로컬 LLM 런타임인 Ollama를 설치합니다. 설치 후 백그라운드에서 :11434 포트로 서버가 자동 실행됩니다.

    install.sh
    bash
    curl -fsSL https://ollama.com/install.sh | sh
    
    # 설치 확인 (서버가 꺼져 있다면: ollama serve)
    ollama --version
    curl http://localhost:11434/api/version
  2. 2

    베이스 모델 다운로드

    solaudit-coder:7b 모델은 qwen2.5-coder:7b (4.7 GB) 위에 만들어집니다.

    pull.sh
    bash
    ollama pull qwen2.5-coder:7b
  3. 3

    Modelfile 받기 & 감사 모델 생성

    curl로 Modelfile(감사 시스템 프롬프트 + 파라미터)을 내려받아 Ollama 모델로 등록합니다.

    create.sh
    bash
    curl -fsSL https://solauditai.dev/api/modelfile/solaudit-coder-7b -o solaudit-coder-7b.Modelfile
    ollama create solaudit-coder:7b -f solaudit-coder-7b.Modelfile
    
    ollama list | grep solaudit
  4. 4

    빠르게 테스트

    Ollama의 /api/generate에 코드 조각을 직접 넣어 봅니다. format: "json"이 구조화된 리포트를 보장합니다.

    quick-test.sh
    bash
    curl http://localhost:11434/api/generate -d '{
      "model": "solaudit-coder:7b",
      "prompt": "contract A { function kill() public { selfdestruct(payable(msg.sender)); } }",
      "format": "json",
      "stream": false
    }' | jq -r '.response | fromjson'
  5. 5

    .sol 파일 전체 감사

    jq -Rs로 파일 내용을 안전하게 JSON 문자열로 감싸 /api/chat에 파이프합니다.

    audit.sh
    bash
    jq -Rs '{
      model: "solaudit-coder:7b",
      stream: false,
      format: "json",
      messages: [{ role: "user", content: . }]
    }' Vault.sol \
      | curl -s http://localhost:11434/api/chat -d @- \
      | jq -r '.message.content | fromjson'
  6. 6

    SolAudit 프록시 API 사용

    이 사이트를 npm run dev로 띄우면 /api/audit가 Ollama를 대신 호출합니다. JSON 이스케이프 없이 .sol 파일을 그대로 보내세요.

    proxy.sh
    bash
    curl -s -X POST "https://solauditai.dev/api/audit?model=solaudit-coder:7b" \
      -H "Content-Type: text/plain" \
      --data-binary @Vault.sol | jq .
    
    # 실시간 스트리밍 (NDJSON)
    curl -N -X POST "https://solauditai.dev/api/audit?model=solaudit-coder:7b&stream=true" \
      -H "Content-Type: text/plain" \
      --data-binary @Vault.sol

Live example

취약한 컨트랙트를 넣으면 이런 리포트가 나옵니다

고전적인 재진입(Reentrancy)과 tx.origin 인증 버그가 숨어 있는 Vault 컨트랙트를 solaudit-coder:7b로 감사한 결과입니다.

Critical1High1Medium0Low1risk_score 94/100

입력 · Vault.sol

Vault.sol
solidity
1// SPDX-License-Identifier: MIT2pragma solidity ^0.8.20;34contract Vault {5    mapping(address => uint256) public balances;6    address public owner;78    constructor() { owner = msg.sender; }910    function deposit() external payable {11        balances[msg.sender] += msg.value;12    }1314    function withdraw() external {15        uint256 amount = balances[msg.sender];16        (bool ok, ) = msg.sender.call{value: amount}("");17        require(ok, "transfer failed");18        balances[msg.sender] = 0;19    }2021    function sweep(address to) external {22        require(tx.origin == owner, "not owner");23        payable(to).transfer(address(this).balance);24    }25}

출력 · POST /api/audit

response.json
json
{
  "model": "solaudit-coder:7b",
  "duration_ms": 2814,
  "report": {
    "summary": "Vault is exposed to reentrancy and phishing-based owner takeover. Funds can be fully drained.",
    "risk_score": 94,
    "findings": [
      {
        "id": "SA-001",
        "title": "Reentrancy in withdraw()",
        "severity": "critical",
        "swc": "SWC-107",
        "location": "withdraw() L16-18",
        "description": "External call is made before the balance is zeroed, allowing a malicious receiver to re-enter and withdraw repeatedly.",
        "recommendation": "Apply Checks-Effects-Interactions: set balances[msg.sender] = 0 before the call, or use ReentrancyGuard."
      },
      {
        "id": "SA-002",
        "title": "tx.origin used for authorization",
        "severity": "high",
        "swc": "SWC-115",
        "location": "sweep() L22",
        "description": "A contract called by the owner can invoke sweep() and pass the tx.origin check.",
        "recommendation": "Replace tx.origin with msg.sender and consider OpenZeppelin Ownable."
      },
      {
        "id": "SA-003",
        "title": "Missing events for state changes",
        "severity": "low",
        "swc": null,
        "location": "deposit() L10, withdraw() L18",
        "description": "Deposits and withdrawals emit no events, hindering off-chain monitoring.",
        "recommendation": "Emit Deposit and Withdraw events."
      }
    ],
    "gas_optimizations": ["Declare owner as immutable", "Use custom errors instead of revert strings"]
  }
}

Coverage

SWC 레지스트리 기반 취약점 탐지

고전적인 버그부터 DeFi 특화 공격 벡터, 가스 최적화 제안까지 한 번의 요청으로 점검합니다.

SWC-107critical

Reentrancy

외부 호출 후 상태 갱신으로 인한 반복 출금

SWC-105/106critical

Access Control

누락된 onlyOwner, 무방비 selfdestruct

SWC-112critical

Delegatecall Injection

신뢰할 수 없는 대상으로의 delegatecall

DeFicritical

Oracle Manipulation

스팟 가격 의존, 플래시론 가격 조작

SWC-115high

tx.origin Auth

피싱 컨트랙트를 통한 권한 탈취

SWC-104high

Unchecked Call Return

low-level call 실패 무시

SWC-101high

Integer Over/Underflow

unchecked 블록, <0.8 버전의 산술 연산

SWC-121high

Signature Replay

nonce·chainId 없는 서명 재사용

Proxyhigh

Storage Collision

업그레이드 프록시의 스토리지 레이아웃 충돌

SWC-114medium

Front-running

트랜잭션 순서 의존, 슬리피지 미설정

SWC-120medium

Weak Randomness

block.timestamp / blockhash 기반 난수

SWC-128medium

DoS with Gas Limit

무제한 루프, 외부 호출 revert로 인한 정지

API reference

두 개의 엔드포인트, 하나의 스키마

Ollama(http://localhost:11434)를 직접 호출하거나, SolAudit 프록시(https://solauditai.dev)로 더 간단하게 호출하세요.

Endpoints
  • POST/api/auditSolidity 소스를 받아 Ollama로 감사 후 JSON 리포트 반환SolAudit
  • GET/api/models제공 모델 목록과 Modelfile 다운로드 URLSolAudit
  • GET/api/modelfile/:slugollama create 에 사용할 Modelfile (text/plain)SolAudit
  • POST/api/chat대화형 요청 — messages 배열로 컨트랙트 전달Ollama
  • POST/api/generate단일 프롬프트 요청 — 짧은 코드 조각 테스트용Ollama
POST /api/audit 파라미터
이름타입위치설명
codestringJSON bodySolidity 소스 코드 (text/plain 요청이면 본문 전체)
modelstringbody · query사용할 모델. 기본값 solaudit-coder:7b
streambooleanbody · querytrue면 Ollama NDJSON 스트림을 그대로 전달

JSON 본문으로 요청

json-request.sh
bash
curl -s https://solauditai.dev/api/audit \
  -H "Content-Type: application/json" \
  -d '{
    "model": "solaudit-pro:32b",
    "code": "pragma solidity ^0.8.20; contract T { function f() external { selfdestruct(payable(msg.sender)); } }"
  }'

CI 파이프라인 게이트

ci-audit.sh
bash
# critical / high 취약점이 있으면 CI 실패 (exit 1)
for f in contracts/*.sol; do
  curl -s -X POST "https://solauditai.dev/api/audit" \
    -H "Content-Type: text/plain" --data-binary @"$f" \
  | jq -e '[.report.findings[] | select(.severity=="critical" or .severity=="high")] | length == 0' \
  || { echo "❌ $f"; exit 1; }
done

FAQ

자주 묻는 질문

AI 감사로 전문 보안 감사를 대체할 수 있나요?+

아니요. SolAudit AI는 개발 단계에서 흔한 실수를 빠르게 걸러내는 1차 도구입니다. LLM은 오탐과 미탐이 있을 수 있으므로, 실제 자금을 다루는 컨트랙트는 반드시 Slither·Foundry 퍼징 같은 정적/동적 분석과 전문 감사 업체의 리뷰를 함께 거치세요.

코드가 외부 서버로 전송되나요?+

Ollama(localhost:11434)를 직접 호출하면 코드가 내 컴퓨터를 벗어나지 않습니다. /api/audit 프록시를 쓸 때도 이 Next.js 서버와 OLLAMA_HOST로 지정한 Ollama 서버 사이에서만 오갑니다.

GPU가 없어도 실행되나요?+

네. Ollama는 CPU만으로도 동작합니다. 다만 속도가 느려지므로 GPU가 없다면 solaudit-lite:3b 또는 solaudit-coder:7b를 권장합니다. Apple Silicon Mac은 Metal 가속이 자동으로 적용됩니다.

리포트를 한국어로 받을 수 있나요?+

가능합니다. 요청 메시지에 "Write description and recommendation in Korean" 같은 문장을 추가하거나, Modelfile의 SYSTEM 프롬프트 마지막에 한국어 출력 규칙을 넣고 ollama create 로 다시 생성하세요.

큰 프로젝트(여러 컨트랙트)는 어떻게 감사하나요?+

모델의 컨텍스트(16K–32K 토큰)에 맞게 파일 단위로 나눠 보내는 것이 가장 정확합니다. API 섹션의 CI 스크립트처럼 contracts/*.sol을 반복 처리하거나, forge flatten 결과를 solaudit-pro:32b에 보내세요.

원격 서버의 Ollama를 사용하려면?+

.env.local에 OLLAMA_HOST=http://<서버 IP>:11434 를 설정하고 서버에서는 OLLAMA_HOST=0.0.0.0 ollama serve 로 실행하세요. 외부에 노출할 때는 리버스 프록시와 인증을 반드시 추가하세요.