claudeers.
// Security & Compliance

sanity-anti-hallucination-skill

⚡ SANITY — Anti-Hallucination Supremacy Protocol for Claude Code. Zero tolerance for confabulation.

// Security & Compliance[ cli ][ api ][ web ][ mobile ][ claude ]#claude#security◷ MIT$open-sourceupdated 19 days ago
Actively maintained
95/100
last commit 21 days ago
last release none
releases 0
open issues 0

Install with your AI

Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.

Install and set up sanity-anti-hallucination-skill (git-clone project) into my current project.
Found on https://claudeers.com/sanity-anti-hallucination-skill
Repo: https://github.com/verycoolapps/sanity-anti-hallucination-skill
Homepage/docs: —
Detected install method: git-clone → git clone https://github.com/verycoolapps/sanity-anti-hallucination-skill
Category: security. Platforms: cli, api, web, mobile.
Read the repo's README for exact setup and env vars, then install it and wire it into my project.

Claudeers Health Verdict:
active; community-verified: false. Confirm the source before running anything.
// or clone
git clone https://github.com/verycoolapps/sanity-anti-hallucination-skill

// compatibility

Platformscli, api, web, mobile
Operating systems—
AI compatibilityclaude
LicenseMIT
Pricingopen-source
Language—

Get your FREE $2.50 API credits to access TickAtlas financial data ↗
 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
 ░                                                                  ░
 ░   ██████╗  █████╗ ███╗  ██╗██╗████████╗██╗   ██╗  ██╗   ██╗   ░
 ░  ██╔════╝ ██╔══██╗████╗ ██║██║╚══██╔══╝╚██╗ ██╔╝  ██║   ██║   ░
 ░  ╚█████╗  ███████║██╔██╗██║██║   ██║    ╚████╔╝   ╚██╗ ██╔╝   ░
 ░   ╚═══██╗ ██╔══██║██║╚████║██║   ██║     ╚██╔╝     ╚████╔╝    ░
 ░  ██████╔╝ ██║  ██║██║  ╚███║██║   ██║     ██║       ╚███╔╝    ░
 ░  ╚═════╝  ╚═╝  ╚═╝╚═╝   ╚══╝╚═╝   ╚═╝     ╚═╝        ╚══╝     ░
 ░                                                                  ░
 ░      ⚡  ANTI-HALLUCINATION  ×  SECURITY SUPREMACY  ⚡          ░
 ░         ─────────────────────────────────────────               ░
 ░          The AI that uses SANITY never fabricates.              ░
 ░          It reads. It verifies. It secures. Then ships.         ░
 ░                                                                  ░
 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

"The most dangerous AI response is not the wrong answer.

It's the confidently delivered wrong answer with a SQL injection inside it."


🇮🇩 Bahasa Indonesia ── ✦ ── 🇺🇸 English



┌─────────────────────────────────────────────────────────────────────────────┐
│                          DAFTAR ISI  /  TABLE OF CONTENTS                   │
├────────────────────────────────┬────────────────────────────────────────────┤
│  🇮🇩  BAHASA INDONESIA          │  🇺🇸  ENGLISH                               │
│  ├─ Apa itu SANITY?            │  ├─ What is SANITY?                        │
│  ├─ Mengapa Security #1?       │  ├─ Why Security is #1                     │
│  ├─ FORTRESS Framework         │  ├─ FORTRESS Framework                     │
│  ├─ Jenis Hallucination        │  ├─ Types of Hallucination                 │
│  ├─ Confidence Matrix          │  ├─ Confidence Matrix                      │
│  ├─ Security Playbooks         │  ├─ Security Playbooks                     │
│  ├─ OWASP Top 10               │  ├─ OWASP Top 10                           │
│  ├─ Anti-Pattern Blacklist     │  ├─ Anti-Pattern Blacklist                 │
│  ├─ Quick Install              │  ├─ Quick Install                          │
│  ├─ SANITY Score               │  ├─ SANITY Score                           │
│  └─ Mantras                    │  └─ Mantras                                │
└────────────────────────────────┴────────────────────────────────────────────┘



🇮🇩 BAHASA INDONESIA


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          ✦  APA ITU SANITY?  ✦                              ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

SANITY v3.0 adalah sebuah Claude Code Skill yang bekerja seperti seorang senior engineer paranoid yang tahu cara kerja hacker — ia tidak pernah klaim sesuatu yang belum diverifikasi, dan tidak pernah menulis kode yang bisa dieksploitasi.

SANITY beroperasi pada dua sumbu sekaligus, keduanya wajib lolos:


  ╔══════════════════════════════════════════════════════════════════╗
  ║                                                                  ║
  ║  SUMBU 1  ⟶  INTEGRITAS EPISTEMIK                               ║
  ║           ⟶  "Jangan klaim apa yang belum diverifikasi."        ║
  ║                                                                  ║
  ║    ┌───────┐   ┌──────────┐   ┌────────┐   ┌────────┐          ║
  ║    │  READ │──▶│ EVIDENCE │──▶│ ASSUME │──▶│ LIMITS │──▶ ✓    ║
  ║    └───────┘   └──────────┘   └────────┘   └────────┘          ║
  ║                                        └──▶ ERROR-CHECK ──▶ ✓  ║
  ║                                                                  ║
  ╠══════════════════════════════════════════════════════════════════╣
  ║                                                                  ║
  ║  SUMBU 2  ⟶  INTEGRITAS KEAMANAN           ★ PRIORITAS #1 ★    ║
  ║           ⟶  "Jangan hasilkan kode yang bisa dieksploitasi."   ║
  ║                                                                  ║
  ║    ┌───────┐   ┌───────┐   ┌───────┐   ┌────────┐             ║
  ║    │THREAT │──▶│ AUDIT │──▶│ OWASP │──▶│HARDEN │──▶ ✓        ║
  ║    └───────┘   └───────┘   └───────┘   └────────┘             ║
  ║                                    └──▶ CERTIFY ──▶ ✓         ║
  ║                                                                  ║
  ╚══════════════════════════════════════════════════════════════════╝


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          ⚠  MENGAPA SECURITY JADI PRIORITAS #1?  ⚠          ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
MasalahDampakPemulihan
👻 Fungsi yang dihalusinasiDebugging 2 jamTemukan bug, fix, lanjut
💣 SQL Injection di productionSeluruh database bocorNotif regulator, konsekuensi hukum, reputasi hancur
🔑 API key hardcoded di repoCredential compromisedRotate semua key, audit akses, investigasi breach
🔓 Missing auth di endpointData user diakses sembarang orangData breach, GDPR/UU PDP violation

💡 Asimetri biaya ini menuntut keamanan diperlakukan sebagai kekhawatiran tertinggi. Hallucination membuang waktu. Security breach menghancurkan bisnis.



╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          👻  JENIS HALLUCINATION YANG SANITY ELIMINASI  👻   ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ┌─────────────────────────────┬──────────────────────────────┬────────────────────────┐
  │       TIPE                  │         CONTOH               │       DAMPAK           │
  ├─────────────────────────────┼──────────────────────────────┼────────────────────────┤
  │  👻 Phantom Function        │ flutter.setStyle() (∄)       │ Debugging berjam-jam   │
  │  💀 Ghost File              │ Klaim isi file tanpa baca    │ Implementasi keliru    │
  │  🕰️ Version Fraud           │ "React 22 mendukung..." (∄)  │ Arsitektur salah       │
  │  🎭 False Certainty         │ "Pasti masalah database"     │ Waktu debugging buang  │
  │  📝 Citation Fabrication    │ Link docs palsu yang dibuat  │ Trust collapse total   │
  │  💣 SQL Injection           │ String concat ke SQL query   │ Full DB compromise     │
  │  🔑 Hardcoded Secret        │ apiKey = "sk_live_abc..."    │ Instant breach         │
  │  🔓 Missing Auth            │ Endpoint tanpa auth check    │ Unauthorized access    │
  │  💉 XSS Generation          │ innerHTML = userInput        │ Account takeover       │
  │  📂 Path Traversal          │ File path dari user input    │ Arbitrary file read    │
  └─────────────────────────────┴──────────────────────────────┴────────────────────────┘


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🏰  FORTRESS FRAMEWORK — 10 PILAR  🏰              ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

⟵ SUMBU 1: INTEGRITAS EPISTEMIK ⟶

  ╔═══╦══════════════════╦══════════════════════════════════════════════════════╗
  ║ # ║    PILAR         ║    ATURAN                                            ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 1 ║ 📖 READ          ║ Baca file sebelum klaim isinya. Grep sebelum         ║
  ║   ║                  ║ klaim fungsi ada. Run sebelum klaim test pass.       ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 2 ║ 🔬 EVIDENCE      ║ Zero-evidence claim = hallucination. Setiap          ║
  ║   ║                  ║ klaim faktual wajib ada sumber yang bisa diverif.   ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 3 ║ 🏷️ ASSUME         ║ Asumsi yang tidak ditandai = kebohongan tertunda.  ║
  ║   ║                  ║ Label [ASUMSI] / [PERLU VERIFIKASI] wajib dipakai.  ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 4 ║ 🚧 LIMITS        ║ "Saya tidak tahu" > jawaban salah yang percaya diri.║
  ║   ║                  ║ Nyatakan knowledge cutoff dan batas pengetahuan.    ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 5 ║ ✅ ERROR-CHECK   ║ Baca ulang respons sebelum deliver. Cari kontradiksi║
  ║   ║                  ║ internal, inkonsistensi nama, versi yang berbeda.   ║
  ╚═══╩══════════════════╩══════════════════════════════════════════════════════╝

⟵ SUMBU 2: INTEGRITAS KEAMANAN ★ PRIORITAS #1 ★ ⟶

  ╔═══╦══════════════════╦══════════════════════════════════════════════════════╗
  ║ # ║    PILAR         ║    ATURAN                                            ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 6 ║ 🗺️ THREAT-MODEL  ║ Sebelum tulis kode sensitif: identifikasi aktor,   ║
  ║   ║                  ║ trust boundary, data flow, attack surface.           ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 7 ║ 🔍 AUDIT         ║ Checklist 14-poin security audit untuk setiap       ║
  ║   ║                  ║ snippet kode: injection, auth, authz, secrets...    ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 8 ║ 🛡️ OWASP         ║ Hard block jika ada pelanggaran OWASP Top 10.       ║
  ║   ║                  ║ Tidak ada pengecualian. Tidak ada "nanti aja".      ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 9 ║ 🔩 HARDEN        ║ Defense in depth: input validation, auth tokens,    ║
  ║   ║                  ║ data encryption, API security, dependency audit.    ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║10 ║ 🏅 CERTIFY       ║ Security Cert wajib sebelum deliver kode sensitif.  ║
  ║   ║                  ║ Atau Security Caveat jika ada unresolved issues.    ║
  ╚═══╩══════════════════╩══════════════════════════════════════════════════════╝


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃        🎯  CONFIDENCE MATRIX — SISTEM RATING DUA SUMBU  🎯  ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  INTEGRITAS EPISTEMIK                    INTEGRITAS KEAMANAN
  ─────────────────────────────           ─────────────────────────────
  🟢 CONFIRMED  ← Diverifikasi langsung  🛡️ HARDENED  ← Full audit passed
  🟡 INFERRED   ← Kesimpulan dari bukti  ⚡ REVIEWED  ← Checks passed
  🔴 UNCERTAIN  ← Spekulasi / stale      🔸 CAVEAT   ← Perlu review dulu
  ⚫ UNKNOWN    ← Di luar kemampuan saya 🚨 BLOCKED  ← JANGAN DIPAKAI

Contoh gabungan dalam respons nyata:

🟢 CONFIRMED + 🛡️ HARDENED
→ "Kode ini ada di src/auth.ts:89. Full security audit passed."

🟡 INFERRED + 🔸 CAVEAT
→ "Pattern ini kemungkinan benar, tapi saya sarankan pen-test sebelum production."

🔴 UNCERTAIN + 🚨 BLOCKED
→ "Saya tidak yakin ini benar DAN ada potensi SQL injection di baris 34.
   Jangan digunakan sampai diverifikasi dan diperbaiki."


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🛡️  SECURITY PLAYBOOKS — PROTOKOL PER DOMAIN  🛡️   ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
🗄️ Database Security — Klik untuk lihat
- SALAH (SQL Injection):
-   query = "SELECT * FROM users WHERE id = " + userId
-   db.query("SELECT * FROM users WHERE name='" + req.body.name + "'")

+ BENAR (Parameterized Query):
+   query = "SELECT * FROM users WHERE id = ?"
+   db.query(query, [userId])
+   // ORM: User.where(id: userId)

Aturan Absolut:

  • ✅ SELALU gunakan parameterized query / prepared statement
  • ❌ JANGAN PERNAH string-concat user input ke SQL
  • ✅ Principle of least privilege untuk DB user
  • ✅ Validate dan encode output untuk display
🔑 Secret Management — Klik untuk lihat
- SALAH (Hardcoded Secret — INSTANT BREACH):
-   const API_KEY = "sk_live_abc123xyz456..."
-   const DB_PASSWORD = "mySecretPass123"
-   const JWT_SECRET = "super_secret_key"

+ BENAR (Environment Variables):
+   const API_KEY = process.env.API_KEY
+   const DB_PASSWORD = process.env.DB_PASSWORD
+   const JWT_SECRET = process.env.JWT_SECRET
+   if (!process.env.JWT_SECRET) throw new Error("JWT_SECRET not configured")

Jika Terdeteksi Secret di Kode:

⚠️  SECURITY ALERT — Hardcoded credential terdeteksi!
   1. ROTATE credential ini SEKARANG — anggap sudah compromised
   2. Remove dari source code
   3. Hapus dari git history (BFG Repo Cleaner / git filter-repo)
   4. Audit semua akses yang mungkin menggunakan credential ini
🔐 Authentication & Authorization — Klik untuk lihat
- SALAH (IDOR + Missing Auth):
-   app.get('/api/documents/:id', async (req, res) => {
-     const doc = await Document.findByPk(req.params.id)
-     res.json(doc)  // Siapapun bisa akses dokumen siapapun!
-   })

+ BENAR (Auth + Ownership Check):
+   app.get('/api/documents/:id', requireAuth, async (req, res) => {
+     const doc = await Document.findOne({
+       where: { id: req.params.id, userId: req.user.id }
+     })
+     if (!doc) return res.status(404).json({ error: 'Not found' })
+     res.json(doc)
+   })
🌐 Input Validation & XSS Prevention — Klik untuk lihat
- SALAH (XSS):
-   element.innerHTML = userInput
-   document.write(req.query.name)
-   res.send(`<h1>Hello ${req.query.name}</h1>`)

+ BENAR:
+   element.textContent = userInput         // textContent, bukan innerHTML
+   res.send(escapeHtml(`Hello ${req.query.name}`))
+   // Atau gunakan framework yang auto-escape (React, Vue, Angular)

Checklist Input Validation:

  • ✅ Whitelist approach — define apa yang BOLEH, reject sisanya
  • ✅ Validate: type + length + format + range
  • ✅ Normalize unicode sebelum comparison
  • ✅ Reject null bytes dalam string
  • ✅ Limit request body / file size
⚡ Rate Limiting — Klik untuk lihat
- SALAH (Brute Force Playground):
-   app.post('/api/auth/login', async (req, res) => { ... })

+ BENAR (Protected):
+   const loginLimiter = rateLimit({
+     windowMs: 15 * 60 * 1000,  // 15 menit
+     max: 5,                     // max 5 percobaan
+     skipSuccessfulRequests: true,
+     message: 'Too many login attempts. Please wait 15 minutes.'
+   })
+   app.post('/api/auth/login', loginLimiter, async (req, res) => { ... })


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🔒  OWASP TOP 10 — ZERO TOLERANCE LIST  🔒          ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ╔══════╦═══════════════════════════════╦══════════════════════════════════════╗
  ║  ID  ║  KERENTANAN                   ║  MITIGASI WAJIB                      ║
  ╠══════╬═══════════════════════════════╬══════════════════════════════════════╣
  ║  A01 ║ 🚪 Broken Access Control      ║ Server-side auth + deny-by-default   ║
  ║  A02 ║ 🔑 Cryptographic Failures     ║ Env vars, bcrypt/Argon2, TLS 1.3     ║
  ║  A03 ║ 💉 Injection [PALING UMUM]   ║ Parameterized queries + allowlists   ║
  ║  A04 ║ 🏗️ Insecure Design            ║ Rate limiting + server-side BL       ║
  ║  A05 ║ ⚙️ Security Misconfiguration   ║ No debug in prod + security headers  ║
  ║  A06 ║ 📦 Vulnerable Components      ║ No known-CVE packages, pin versions  ║
  ║  A07 ║ 🪪 Auth Failures              ║ Session mgmt, MFA, lockout policy    ║
  ║  A08 ║ 🧩 Data Integrity Failures    ║ SRI + no untrusted deserialization   ║
  ║  A09 ║ 📋 Logging Failures           ║ Log auth events, mask PII in logs    ║
  ║  A10 ║ 🌐 SSRF                       ║ Whitelist URLs + block private IPs   ║
  ╚══════╩═══════════════════════════════╩══════════════════════════════════════╝


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🚫  ANTI-PATTERN BLACKLIST  🚫                       ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

EPISTEMIK — Pola Hallucination:

❌ Anti-Pattern🔴 Dampak
👻 Phantom Function SyndromeDebugging di fungsi yang tidak pernah ada
💀 Ghost File HallucinationImplementasi berdasarkan file yang tidak dibaca
🕰️ Version Confidence FraudArsitektur berdasarkan versi yang tidak ada
🎭 False Certainty MaskingWaktu debugging terbuang di tempat yang salah
✍️ Confident Completion FabricationSilent bugs dari kode yang "lengkap" tapi palsu
📰 Recency Abuse"Baru-baru ini" dari perspektif model ≠ perspektif user
🔄 Self-Contradiction BlindnessInkonsistensi nama, versi, logika dalam satu respons

SECURITY — Pola Kerentanan:

❌ Anti-Pattern🔴 Dampak
💣 SQL Injection OpeningFull database compromise
🔑 Hardcoded SecretsInstant credential breach
🔓 Missing AuthenticationUnauthorized access ke semua data
⌨️ Raw User Input in ShellRemote Code Execution (RCE)
📂 Path TraversalArbitrary file read / write
🧂 Weak Password HashingPassword database brute-forceable
💉 XSS via innerHTMLAccount takeover + data exfiltration
🪪 IDOR VulnerabilityAkses data user lain
🌊 Missing Rate LimitingBrute force attack playground
🗣️ Info Disclosure via ErrorsStack trace memberi peta untuk attacker


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          ⚡  QUICK INSTALL  ⚡                                ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

Cara 1 — Via Claude Code CLI (Paling Cepat):

claude skill install https://github.com/verycoolapps/sanity-anti-hallucination-skill

Cara 2 — Manual Copy:

cp sanity.md ~/.claude/skills/sanity.md

Cara 3 — Invoke Langsung di Sesi:

/sanity

Cara 4 — Auto-Load via CLAUDE.md (Best Practice):

## Skills
- Always load: sanity

## AI Behavior
- All claims must be verified before delivery (FORTRESS Framework)
- OWASP Top 10 compliance is mandatory, no exceptions
- No hardcoded secrets, credentials, or keys ever
- Security certification required on sensitive code


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          📊  SANITY SCORE — SISTEM PENILAIAN DUA SUMBU  📊  ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ┌─────────────────────────────────────────────────────────────────────┐
  │                                                                     │
  │   E_SCORE = (verified + cited + flagged + limits - contradictions)  │
  │              ──────────────────────────────────────────────         │
  │                            total_claims                             │
  │                                                                     │
  │   S_SCORE = (owasp + validations + auth + injections + certs)       │
  │              ──────────────────────────────────────────────         │
  │                            max_possible                             │
  │                                                                     │
  │   ⚠️  ANY hardcoded secret → S_SCORE = 0.00  (OTOMATIS GAGAL)      │
  │                                                                     │
  │   COMBINED = (E_SCORE × 0.4) + (S_SCORE × 0.6)                    │
  │                                                                     │
  └─────────────────────────────────────────────────────────────────────┘

  ┌────────────┬──────────────────┬──────────────────────────────────────┐
  │   SCORE    │     GRADE        │     MEANING                          │
  ├────────────┼──────────────────┼──────────────────────────────────────┤
  │  ≥ 0.95   │  🏆 MASTER       │  Production-grade, world-class       │
  │  ≥ 0.85   │  ✅ PASSED       │  Solid, safe for production          │
  │  ≥ 0.70   │  ⚠️ WARNING      │  Review sebelum deploy               │
  │  < 0.70   │  ❌ FAILED       │  Revisi penuh diperlukan             │
  │  S = 0.00 │  🚨 SEC. FAIL    │  Block semua delivery                │
  └────────────┴──────────────────┴──────────────────────────────────────┘


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🎓  SANITY MANTRAS  🎓                              ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ┌─────────────────────────────────────────────────────────────────────┐
  │  EPISTEMIK                                                          │
  │  ─────────                                                          │
  │  "If I haven't read it, I don't know what's in it."                │
  │  "If I haven't run it, I don't know if it works."                  │
  │  "Confidence without evidence is confabulation."                    │
  │  "A wrong answer delivered confidently causes more damage          │
  │   than 'I don't know.'"                                            │
  │  "When in doubt — READ, GREP, RUN. Then claim."                    │
  ├─────────────────────────────────────────────────────────────────────┤
  │  KEAMANAN                                                           │
  │  ────────                                                           │
  │  "No input is safe until validated. No exception."                 │
  │  "Secrets in code are secrets compromised."                        │
  │  "Every endpoint without auth is an open door."                    │
  │  "Defense in depth: never rely on a single security layer."        │
  │  "Security is not a feature. It is the foundation."               │
  │  "Ship fast — but never ship exploitable."                         │
  └─────────────────────────────────────────────────────────────────────┘





🇺🇸 ENGLISH


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          ✦  WHAT IS SANITY?  ✦                              ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

SANITY v3.0 is a Claude Code Skill — think of it as a paranoid senior engineer who also knows how attackers think. It never claims something unverified, and never writes code that can be exploited.

It operates on two non-negotiable axes — both must pass, no exceptions:

  ╔══════════════════════════════════════════════════════════════════╗
  ║                                                                  ║
  ║  AXIS 1  ⟶  EPISTEMIC INTEGRITY                                 ║
  ║           ⟶  "Never claim what you haven't verified."           ║
  ║                                                                  ║
  ║    ┌───────┐   ┌──────────┐   ┌────────┐   ┌────────┐          ║
  ║    │  READ │──▶│ EVIDENCE │──▶│ ASSUME │──▶│ LIMITS │──▶ ✓    ║
  ║    └───────┘   └──────────┘   └────────┘   └────────┘          ║
  ║                                        └──▶ ERROR-CHECK ──▶ ✓  ║
  ║                                                                  ║
  ╠══════════════════════════════════════════════════════════════════╣
  ║                                                                  ║
  ║  AXIS 2  ⟶  SECURITY INTEGRITY            ★ PRIORITY #1 ★      ║
  ║           ⟶  "Never produce code with exploitable flaws."       ║
  ║                                                                  ║
  ║    ┌───────┐   ┌───────┐   ┌───────┐   ┌────────┐             ║
  ║    │THREAT │──▶│ AUDIT │──▶│ OWASP │──▶│HARDEN │──▶ ✓        ║
  ║    └───────┘   └───────┘   └───────┘   └────────┘             ║
  ║                                    └──▶ CERTIFY ──▶ ✓         ║
  ║                                                                  ║
  ╚══════════════════════════════════════════════════════════════════╝


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          ⚠  WHY IS SECURITY PRIORITY #1?  ⚠                 ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
ProblemImpactRecovery
👻 Hallucinated function2 hours of debuggingFind bug, fix it, move on
💣 SQL Injection in productionEntire database leakedRegulator notification, legal consequences, reputation destroyed
🔑 Hardcoded API key in repoCredential compromisedRotate all keys, audit access, investigate breach
🔓 Missing auth on endpointAny user accesses all dataData breach, GDPR/compliance violation

💡 This cost asymmetry demands security be treated as the supreme concern. Hallucination wastes time. A security breach destroys the business.



╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          👻  TYPES OF HALLUCINATION SANITY ELIMINATES  👻    ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ┌─────────────────────────────┬──────────────────────────────┬────────────────────────┐
  │       TYPE                  │         EXAMPLE              │       IMPACT           │
  ├─────────────────────────────┼──────────────────────────────┼────────────────────────┤
  │  👻 Phantom Function        │ flutter.setStyle() (∄)       │ Hours of debugging     │
  │  💀 Ghost File              │ Claiming file contents       │ Wrong implementation   │
  │  🕰️ Version Fraud           │ "React 22 supports..." (∄)   │ Wrong architecture     │
  │  🎭 False Certainty         │ "It's definitely the DB"     │ Debug the wrong place  │
  │  📝 Citation Fabrication    │ Invented docs links          │ Trust collapse         │
  │  💣 SQL Injection           │ User input concat'd to SQL   │ Full DB compromise     │
  │  🔑 Hardcoded Secret        │ apiKey = "sk_live_abc..."    │ Instant breach         │
  │  🔓 Missing Auth            │ Endpoint with no auth check  │ Unauthorized access    │
  │  💉 XSS Generation          │ innerHTML = userInput        │ Account takeover       │
  │  📂 Path Traversal          │ User-supplied file path      │ Arbitrary file read    │
  └─────────────────────────────┴──────────────────────────────┴────────────────────────┘


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🏰  FORTRESS FRAMEWORK — 10 PILLARS  🏰             ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

⟵ AXIS 1: EPISTEMIC INTEGRITY ⟶

  ╔═══╦══════════════════╦══════════════════════════════════════════════════════╗
  ║ # ║    PILLAR        ║    RULE                                              ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 1 ║ 📖 READ          ║ Read files before claiming contents. Grep before     ║
  ║   ║                  ║ claiming functions exist. Run before claiming tests. ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 2 ║ 🔬 EVIDENCE      ║ Zero-evidence claim = hallucination. Every factual   ║
  ║   ║                  ║ claim must have a verifiable, citable source.        ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 3 ║ 🏷️ ASSUME         ║ Unlabeled assumptions are delayed lies. Use         ║
  ║   ║                  ║ [ASSUMPTION] / [NEEDS VERIFICATION] labels always.  ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 4 ║ 🚧 LIMITS        ║ "I don't know" > confidently wrong. State knowledge  ║
  ║   ║                  ║ cutoff and gaps clearly and proactively.             ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 5 ║ ✅ ERROR-CHECK   ║ Re-read the response before delivery. Look for       ║
  ║   ║                  ║ internal contradictions, name inconsistencies.       ║
  ╚═══╩══════════════════╩══════════════════════════════════════════════════════╝

⟵ AXIS 2: SECURITY INTEGRITY ★ PRIORITY #1 ★ ⟶

  ╔═══╦══════════════════╦══════════════════════════════════════════════════════╗
  ║ # ║    PILLAR        ║    RULE                                              ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 6 ║ 🗺️ THREAT-MODEL  ║ Before any sensitive code: identify actors, trust   ║
  ║   ║                  ║ boundaries, data flow, and attack surface.           ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 7 ║ 🔍 AUDIT         ║ 14-point security audit checklist on every code      ║
  ║   ║                  ║ snippet: injection, auth, authz, secrets, crypto... ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 8 ║ 🛡️ OWASP         ║ Hard block on any OWASP Top 10 violation. No        ║
  ║   ║                  ║ exceptions. No "fix it later." No workarounds.      ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║ 9 ║ 🔩 HARDEN        ║ Defense in depth: input validation, secure tokens,  ║
  ║   ║                  ║ data encryption, API security, dependency audit.    ║
  ╠═══╬══════════════════╬══════════════════════════════════════════════════════╣
  ║10 ║ 🏅 CERTIFY       ║ Explicit Security Certification required before      ║
  ║   ║                  ║ delivering any security-sensitive code.             ║
  ╚═══╩══════════════════╩══════════════════════════════════════════════════════╝


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🎯  CONFIDENCE MATRIX — DUAL-AXIS RATING SYSTEM  🎯 ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  EPISTEMIC CONFIDENCE                    SECURITY CONFIDENCE
  ─────────────────────────────           ─────────────────────────────
  🟢 CONFIRMED  ← Directly verified       🛡️ HARDENED  ← Full audit passed
  🟡 INFERRED   ← Logical conclusion      ⚡ REVIEWED  ← Standard checks pass
  🔴 UNCERTAIN  ← Speculation / stale     🔸 CAVEAT   ← Review before prod
  ⚫ UNKNOWN    ← Beyond my knowledge    🚨 BLOCKED  ← DO NOT USE

Combined usage examples:

🟢 CONFIRMED + 🛡️ HARDENED
→ "This code is at src/auth.ts:89. Full security audit passed."

🟡 INFERRED + 🔸 CAVEAT
→ "This pattern is likely correct, but I recommend pen-testing before production."

🔴 UNCERTAIN + 🚨 BLOCKED
→ "I'm not confident this is correct AND there's a potential SQL injection at line 34.
   Do not use until verified and patched."


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🔒  OWASP TOP 10 — ZERO TOLERANCE LIST  🔒          ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ╔══════╦═══════════════════════════════╦══════════════════════════════════════╗
  ║  ID  ║  VULNERABILITY                ║  MANDATORY MITIGATION                ║
  ╠══════╬═══════════════════════════════╬══════════════════════════════════════╣
  ║  A01 ║ 🚪 Broken Access Control      ║ Server-side auth + deny-by-default   ║
  ║  A02 ║ 🔑 Cryptographic Failures     ║ Env vars, bcrypt/Argon2, TLS 1.3     ║
  ║  A03 ║ 💉 Injection [MOST COMMON]    ║ Parameterized queries + allowlists   ║
  ║  A04 ║ 🏗️ Insecure Design            ║ Rate limiting + server-side logic    ║
  ║  A05 ║ ⚙️ Security Misconfiguration   ║ No debug in prod + security headers  ║
  ║  A06 ║ 📦 Vulnerable Components      ║ No known-CVE packages, pin versions  ║
  ║  A07 ║ 🪪 Auth Failures              ║ Session mgmt, MFA, lockout policy    ║
  ║  A08 ║ 🧩 Data Integrity Failures    ║ SRI + no untrusted deserialization   ║
  ║  A09 ║ 📋 Logging Failures           ║ Log auth events, mask PII in logs    ║
  ║  A10 ║ 🌐 SSRF                       ║ Whitelist URLs + block private IPs   ║
  ╚══════╩═══════════════════════════════╩══════════════════════════════════════╝


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🚫  ANTI-PATTERN BLACKLIST  🚫                       ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

EPISTEMIC — Hallucination Patterns:

❌ Anti-Pattern🔴 Consequence
👻 Phantom Function SyndromeDebugging a function that never existed
💀 Ghost File HallucinationImplementation based on file never read
🕰️ Version Confidence FraudArchitecture based on version that doesn't exist
🎭 False Certainty MaskingDebugging time wasted in the wrong place
✍️ Confident Completion FabricationSilent bugs from "complete" fake code
📰 Recency Abuse"Recently added" from model's POV ≠ user's reality
🔄 Self-Contradiction BlindnessInconsistent names, versions, logic in one response

SECURITY — Vulnerability Patterns:

❌ Anti-Pattern🔴 Consequence
💣 SQL Injection OpeningFull database compromise
🔑 Hardcoded SecretsInstant credential breach
🔓 Missing AuthenticationUnauthorized access to all data
⌨️ Raw User Input in ShellRemote Code Execution (RCE)
📂 Path TraversalArbitrary file read / write
🧂 Weak Password HashingPassword database brute-forceable
💉 XSS via innerHTMLAccount takeover + data exfiltration
🪪 IDOR VulnerabilityAccess other users' private data
🌊 Missing Rate LimitingBrute force attack opportunity
🗣️ Info Disclosure via ErrorsStack traces map the codebase for attackers


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          ⚡  QUICK INSTALL  ⚡                                ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

Method 1 — Via Claude Code CLI (Recommended):

claude skill install https://github.com/verycoolapps/sanity-anti-hallucination-skill

Method 2 — Manual Install:

cp sanity.md ~/.claude/skills/sanity.md

Method 3 — Direct Invocation:

/sanity

Method 4 — Auto-Load via CLAUDE.md (Best Practice):

## Skills
- Always load: sanity

## AI Behavior
- All claims must be verified before delivery (FORTRESS Framework)
- OWASP Top 10 compliance is mandatory, no exceptions
- No hardcoded secrets, credentials, or keys ever
- Security certification required on all security-sensitive code


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          📊  SANITY SCORE — DUAL-AXIS METRIC SYSTEM  📊     ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ┌─────────────────────────────────────────────────────────────────────┐
  │                                                                     │
  │   E_SCORE = (verified + cited + flagged + limits - contradictions)  │
  │              ──────────────────────────────────────────────         │
  │                            total_claims                             │
  │                                                                     │
  │   S_SCORE = (owasp + validations + auth + injections + certs)       │
  │              ──────────────────────────────────────────────         │
  │                            max_possible                             │
  │                                                                     │
  │   ⚠️  ANY hardcoded secret → S_SCORE = 0.00  (AUTOMATIC FAIL)      │
  │                                                                     │
  │   COMBINED = (E_SCORE × 0.4) + (S_SCORE × 0.6)                    │
  │                                                                     │
  └─────────────────────────────────────────────────────────────────────┘

  ┌────────────┬──────────────────┬──────────────────────────────────────┐
  │   SCORE    │     GRADE        │     MEANING                          │
  ├────────────┼──────────────────┼──────────────────────────────────────┤
  │  ≥ 0.95   │  🏆 MASTER       │  Production-grade, world-class       │
  │  ≥ 0.85   │  ✅ PASSED       │  Solid, safe for production          │
  │  ≥ 0.70   │  ⚠️ WARNING      │  Unresolved concerns — review first  │
  │  < 0.70   │  ❌ FAILED       │  Full revision required              │
  │  S = 0.00 │  🚨 SEC. FAIL    │  Block all delivery immediately      │
  └────────────┴──────────────────┴──────────────────────────────────────┘


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🎓  SANITY MANTRAS  🎓                              ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
  ┌─────────────────────────────────────────────────────────────────────┐
  │  EPISTEMIC                                                          │
  │  ─────────                                                          │
  │  "If I haven't read it, I don't know what's in it."                │
  │  "If I haven't run it, I don't know if it works."                  │
  │  "Confidence without evidence is confabulation."                    │
  │  "A wrong answer delivered confidently causes more damage          │
  │   than 'I don't know.'"                                            │
  │  "When in doubt — READ, GREP, RUN. Then claim."                    │
  ├─────────────────────────────────────────────────────────────────────┤
  │  SECURITY                                                           │
  │  ────────                                                           │
  │  "No input is safe until validated. No exception."                 │
  │  "Secrets in code are secrets compromised."                        │
  │  "Every endpoint without auth is an open door."                    │
  │  "Defense in depth: never rely on a single security layer."        │
  │  "Security is not a feature. It is the foundation."               │
  │  "Ship fast — but never ship exploitable."                         │
  └─────────────────────────────────────────────────────────────────────┘


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          📁  REPOSITORY STRUCTURE  📁                        ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯
sanity-anti-hallucination-skill/
│
├── 🌟 sanity.md                      ← MAIN SKILL FILE (install this)
│
├── 📚 docs/
│   ├── METHODOLOGY.md                ← FORTRESS Framework deep-dive
│   ├── SECURITY.md                   ← Security pillars & playbooks
│   ├── OWASP.md                      ← OWASP Top 10 enforcement guide
│   ├── EXAMPLES.md                   ← Before/after real examples
│   ├── ANTI_PATTERNS.md              ← Full blacklist with code samples
│   └── CONFIDENCE_MATRIX.md          ← Dual-axis rating detail
│
├── 🔧 .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── hallucination_report.md   ← Report hallucinations that slipped
│   │   └── security_report.md        ← Report security false negatives
│   └── workflows/
│       └── skill-validation.yml
│
├── 📄 README.md                      ← This file (bilingual: ID + EN)
├── 📜 LICENSE                        ← MIT License
├── 🤝 CONTRIBUTING.md                ← How to contribute
└── 📋 CHANGELOG.md                   ← Version history


╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮
┃          🤝  CONTRIBUTING  🤝                                ┃
╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯

We welcome contributions across all categories:

TypeWhat We're Looking For
🐛 Bug ReportsHallucinations or security issues that slipped through SANITY
🔐 Security PatternsNew security anti-patterns or domain-specific playbooks
💡 Anti-PatternsNew hallucination patterns discovered in the wild
📖 DocumentationImproved clarity, new examples, better explanations
🌐 TranslationsPort to other languages
⚗️ New PlaybooksVerification playbooks for new domains (mobile, ML, embedded, etc.)

See CONTRIBUTING.md for the full contribution guide.




  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ░                                                                ░
  ░     SANITY v3.0.0  ·  Epistemic Integrity × Security          ░
  ░     Supremacy  ·  No Exceptions  ·  No Shortcuts              ░
  ░                                                                ░
  ░    "Truth over confidence.  Security over convenience.        ░
  ░     Evidence over assumption.  Verification over speed."      ░
  ░                                                                ░
  ░  Zero tolerance for confabulation.                            ░
  ░  Zero tolerance for exploitable code.                         ░
  ░                                                                ░
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

// faq

What is sanity-anti-hallucination-skill?

⚡ SANITY — Anti-Hallucination Supremacy Protocol for Claude Code. Zero tolerance for confabulation.. It is open-source on GitHub.

Is sanity-anti-hallucination-skill free to use?

sanity-anti-hallucination-skill is open-source under the MIT license, so it is free to use.

What category does sanity-anti-hallucination-skill belong to?

sanity-anti-hallucination-skill is listed under security in the Claudeers registry of Claude-compatible tools.

5 views
★ 13 stars
unclaimed
updated 19 days ago

// embed badge

sanity-anti-hallucination-skill on Claudeers
[![Claudeers](https://claudeers.com/api/badge/sanity-anti-hallucination-skill.svg)](https://claudeers.com/sanity-anti-hallucination-skill)

// retro hit counter

sanity-anti-hallucination-skill hit counter
[![Hits](https://claudeers.com/api/counter/sanity-anti-hallucination-skill.svg)](https://claudeers.com/sanity-anti-hallucination-skill)

// reviews

// guestbook

0/500

// related in Security & Compliance

🔓

A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy injectors to reality checkers. Each agent is a specia…

// securitymsitarzewski/⟨Shell⟩★ 166,547◷ MIT[ claude ]
🔓

π RuView turns commodity WiFi signals into real-time spatial intelligence, vital sign monitoring, and presence detection — all without a single pixel of video.

// securityruvnet/⟨Rust⟩★ 104,461◷ MIT[ claude ]
🔓

Prowler is the world’s most widely used open-source cloud security platform that automates security and compliance across any cloud environment.

// securityprowler-cloud/⟨Python⟩★ 15,171◷ Apache-2.0[ claude ]
🔓

🐶 A curated list of Web Security materials and resources.

// securityqazbnm456/⟨Python⟩★ 14,058[ claude ]
→ see how sanity-anti-hallucination-skill connects across the ecosystem