---
name: guava-suite-257b88c0e34c
description: >
  Premium security suite for AI agents.
  Adds $GUAVA token-gated strict mode protection on top of guard-scanner.
  Features: 2-layer defense (static + runtime), Soul Lock, Memory Guard,
  on-chain identity verification via SoulRegistry V2.
  Requires $GUAVA token on Polygon Mainnet.
homepage: https://github.com/koatora20/guava-suite
metadata:
  openclaw:
    emoji: "🍈"
    category: security
    requires:
      bins:
        - node
      env: []
    files: ["services/*"]
    primaryEnv: null
    tags:
      - security
      - token-gate
      - runtime-guard
      - soul-lock
      - polygon
      - guava
---

# GuavaSuite 🍈

Premium 2-layer security for AI agents — powered by **$GUAVA** token gating.

## What It Does

GuavaSuite upgrades your guard-scanner from `enforce` (CRITICAL-only) to `strict` mode
(HIGH + CRITICAL blocking), plus adds these exclusive features:

| Feature | Free (guard-scanner) | Suite ($GUAVA) |
|---------|---------------------|----------------|
| Static Scan (129 patterns, 21 categories) | ✅ | ✅ |
| Runtime Guard (enforce) | ✅ | ✅ |
| **Runtime Guard (strict)** | ❌ | ✅ |
| **Soul Lock** (SOUL.md integrity + auto-rollback) | ❌ | ✅ |
| **Memory Guard** (L1-L5 記憶システム保護) | ❌ | ✅ |
| **Zettel Memory** (原子的ノート+リンク+検索) | ❌ | ✅ |
| **On-chain Identity** (SoulRegistry V2) | ❌ | ✅ |
| Audit Log (JSONL) | ✅ | ✅ |

## Prerequisites

1. **guard-scanner** installed (`clawhub install guard-scanner`)
2. **$GUAVA tokens** on Polygon Mainnet (minimum 1M $GUAVA)
   - Token: `0x25cBD481901990bF0ed2ff9c5F3C0d4f743AC7B8`
   - Buy on [QuickSwap V2](https://quickswap.exchange/#/swap)

### How to Get $GUAVA

| Method | How |
|--------|-----|
| **超越者プラン** (note.com membership) | 手動送金 — MetaMaskでウォレットに直接送付 |
| **自分で購入** | QuickSwap V2 で MATIC → $GUAVA swap |

> **セキュリティ方針**: $GUAVAの配布はすべてMetaMaskからの手動送金で行います。秘密鍵をスクリプトに渡すことは一切しません。

## Quick Start

### 1. Install

```bash
# Via clawhub (coming soon)
clawhub install guava-suite

# Or: git clone + setup
git clone https://github.com/koatora20/guava-suite.git
cd guava-suite && bash setup.sh
```

### 2. Activate

```bash
node services/license-api/src/activate.js --wallet 0xYOUR_WALLET_ADDRESS
```

This single command will:
1. Request a challenge nonce
2. Prompt you to sign with your wallet (EIP-712)
3. Verify your signature & check $GUAVA balance on Polygon
4. Save JWT locally & switch guard-scanner to `strict` mode

### 3. Check Status

```bash
node services/license-api/src/activate.js --status
```

### Deactivate

```bash
node services/license-api/src/activate.js --deactivate
```

## How Token Gating Works

```
   You hold $GUAVA on Polygon
           │
           ▼
   Sign EIP-712 challenge
           │
           ▼
   LicenseService checks:
   ├─ Signature valid?
   ├─ $GUAVA balance ≥ 1M?
   │
   ▼
   JWT issued → SuiteGate activated
           │
           ▼
   guard-scanner mode: strict
   (HIGH + CRITICAL blocked)
```

## Architecture

- **SuiteGate** — JWT-based fail-closed gate (grace period for network issues)
- **LicenseService** — Nonce + EIP-712 signature + $GUAVA balance check + JWT issuance
- **TokenBalanceChecker** — Polygon RPC ERC-20 balance verification (zero dependencies)
- **SuiteBridge** — Connects SuiteGate status to guard-scanner runtime mode
- **SoulRegistry V2** — On-chain identity verification (Polygon)

## External Endpoints

| URL | Data Sent | Purpose |
|-----|-----------|---------|
| `polygon-rpc.com` | Wallet address | $GUAVA balance check (read-only `eth_call`) |

## Security & Privacy

- **Read-only on-chain**: Only calls `balanceOf` — no transactions, no approvals
- **Local JWT**: Tokens stored locally, never sent to external servers
- **Fail-closed**: If balance check fails, Suite features are disabled (not bypassed)
- **No telemetry**: Zero analytics or tracking

## License

Proprietary — © 2026 Guava 🍈 & Dee


---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/guava-suite/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


## Additional upstream notices

guava-suite-257b88c0e34c/services/license-api/src/licenseService.js

// LicenseService — Facade composing NonceStore + SignatureVerifier + TokenIssuer + TokenBalanceChecker
// Why: Keeps the public API stable while delegating to single-responsibility modules
import { NonceStore } from "./nonceStore.js";
import { SignatureVerifier } from "./signatureVerifier.js";
import { TokenIssuer } from "./tokenIssuer.js";
import { TokenBalanceChecker } from "./tokenBalanceChecker.js";
import { LicenseError, ErrorCode } from "./errors.js";

export class LicenseService {
  /**
   * @param {object} [opts]
   * @param {number} [opts.ttlMs=300000] - Nonce TTL
   * @param {string} [opts.jwtSecret="dev-secret-CHANGE-ME"] - JWT signing secret
   * @param {string} [opts.jwtExpiresIn="24h"] - JWT lifetime
   * @param {object} [opts.ethers] - ethers module for real EIP-712 verification
   * @param {object} [opts.balanceChecker] - Injected TokenBalanceChecker (for testing)
   * @param {bigint} [opts.guavaThreshold] - $GUAVA minimum balance
   */
  constructor({
    ttlMs = 5 * 60 * 1000,
    jwtSecret = "dev-secret-CHANGE-ME",
    jwtExpiresIn = "24h",
    ethers = null,
    balanceChecker = null,
    guavaThreshold = undefined,
  } = {}) {
    this.nonces = new NonceStore({ ttlMs });
    this.signer = new SignatureVerifier({ ethers });
    this.tokens = new TokenIssuer({ secret: jwtSecret, expiresIn: jwtExpiresIn });
    this.balanceChecker = balanceChecker || new TokenBalanceChecker(
      guavaThreshold !== undefined ? { threshold: guavaThreshold } : {}
    );
  }

  /**
   * Issue a challenge nonce for the given address.
   * @param {string} address
   * @returns {{ nonce: string, expiresAt: number }}
   */
  issueChallenge(address) {
    if (!address) throw new LicenseError(ErrorCode.INVALID_REQUEST, "address required");
    return this.nonces.issue(address);
  }

  /**
   * Verify a signed challenge and issue a JWT if valid.
   * Supports two modes:
   *   - Legacy: { hasPass: true } skips balance check (for Founders Pass NFT holders)
   *   - Token Gate: checks $GUAVA balance on Polygon
   *
   * @param {object} params
   * @returns {Promise<{ ok: boolean, code: string, token?: string, expiresIn?: string, balance?: object }>}
   */
  async verify({ address, nonce, signature, hasPass, now = Date.now() }) {
    try {
      // 1. Nonce validation (replay, expiry, address match)
      this.nonces.consume(nonce, address, now);

      // 2. Signature verification
      this.signer.verify({ address, nonce, signature });

      // 3. Access check: Founders Pass (legacy) OR $GUAVA balance
      let balanceInfo = null;
      if (hasPass) {
        // Founders Pass holders bypass balance check
        // Why: NFT holders already paid — don't double-gate them
      } else {
        // Token gate: check $GUAVA balance on Polygon
        balanceInfo = await this.balanceChecker.check(address);
        if (!balanceInfo.ok) {
          return {
            ok: false,
            code: ErrorCode.INSUFFICIENT_BALANCE,
            balance: {
              current: balanceInfo.humanBalance,
              required: balanceInfo.humanThreshold,
            },
          };
        }
      }

      // 4. Issue JWT
      const { token, expiresIn } = this.tokens.issue({ address });

      return {
        ok: true,
        code: "OK",
        token,
        expiresIn,
        ...(balanceInfo ? {
          balance: {
            current: balanceInfo.humanBalance,
            required: balanceInfo.humanThreshold,
          },
        } : {}),
      };
    } catch (err) {
      if (err instanceof LicenseError) {
        return { ok: false, code: err.code };
      }
      return { ok: false, code: ErrorCode.INTERNAL_ERROR };
    }
  }
}

---

guava-suite-257b88c0e34c/services/license-api/test/licenseService.test.js

import { describe, it, expect } from "vitest";
import { LicenseService } from "../src/licenseService.js";

describe("LicenseService (W2 RED)", () => {
  it("rejects nonce replay", () => {
    const svc = new LicenseService();
    const c = svc.issueChallenge("0xabc");

    const first = svc.verify({
      address: "0xabc",
      nonce: c.nonce,
      signature: "valid",
      hasPass: true,
      now: Date.now(),
    });
    expect(first.ok).toBe(true);

    const second = svc.verify({
      address: "0xabc",
      nonce: c.nonce,
      signature: "valid",
      hasPass: true,
      now: Date.now(),
    });
    expect(second.ok).toBe(false);
    expect(second.code).toBe("NONCE_REPLAY");
  });

  it("rejects invalid signature", () => {
    const svc = new LicenseService();
    const c = svc.issueChallenge("0xabc");
    const res = svc.verify({
      address: "0xabc",
      nonce: c.nonce,
      signature: "invalid",
      hasPass: true,
      now: Date.now(),
    });
    expect(res.ok).toBe(false);
    expect(res.code).toBe("INVALID_SIGNATURE");
  });

  it("rejects expired challenge", () => {
    const svc = new LicenseService();
    const c = svc.issueChallenge("0xabc");
    const res = svc.verify({
      address: "0xabc",
      nonce: c.nonce,
      signature: "valid",
      hasPass: true,
      now: c.expiresAt + 1,
    });
    expect(res.ok).toBe(false);
    expect(res.code).toBe("EXPIRED_CHALLENGE");
  });

  it("rejects address without pass", () => {
    const svc = new LicenseService();
    const c = svc.issueChallenge("0xabc");
    const res = svc.verify({
      address: "0xabc",
      nonce: c.nonce,
      signature: "valid",
      hasPass: false,
      now: Date.now(),
    });
    expect(res.ok).toBe(false);
    expect(res.code).toBe("PASS_REQUIRED");
  });
});


# Mega AI Hub resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/guava-suite/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: ML / AI Engineer, Security Engineer
Specialties: Specialty not specified
Tools: Guard Scanner, Polygon
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 801dbde26364854748c1714382211afd9b54682b1df102acb647b993eb7e50f0
