🛡️ Nadhi Audit Official Documentation

Developer & Security Documentation

Minimal, practical guides for local installation, Claude Code and Cursor MCP integration, compliance frameworks, and automated AST code fixes.

⚡

Installation & Quick Start

Download and run Nadhi Audit locally on your Mac with Apple Silicon or Intel chips.

macOS 12+

1. Download and Install

Download the notarized macOS disk image (.dmg) and drag Nadhi Audit into your Applications folder.

Terminal / Code Snippet
# Available production builds for macOS 12+ • Apple Silicon (arm64): NadhiAudit-Mac-2.1.56-arm64.dmg • Intel Mac (x64): NadhiAudit-Mac-2.1.56-x64.dmg

2. Launch and License Activation

Open Nadhi Audit. On first launch, enter your license key. You can purchase or manage your commercial license key from your dashboard.

Terminal / Code Snippet
Key Format: CVAI-XXXX-XXXX-XXXX-XXXX

3. Local Model Verification

Nadhi Audit bundles the fine-tuned local model (Nadhi_Audit_FT.gguf) and starts llama-server automatically on Apple Silicon Metal GPU. Zero configuration required.

🤖

Commands, MCP Tools & Workflows

Drive compliance audits, code fixes, and pull requests from the Desktop app, Claude Code or Cursor. Everything runs on your machine.

Slash Commands & MCP

1. Primary Slash Commands (Chat & Terminal)

You can run these commands directly in the Nadhi Audit chat window or pass them via coding agents:

Command or ToolDescription
/audit [path|url] [regime]Run on-device audit directly on a local directory or remote GitHub repository URL.
/audit_fix [path|url]Audit, filter false positives, and commit verified fixes on branch nadhi without pushing to remote.
/full_audit [path|url]All-in-one pipeline: audit code, commit fixes on branch nadhi, verify build, and push PR to GitHub.
/fix [path]Apply automated AST-verified fixes for findings from the most recent audit.
/push-pr [path]Push the verified nadhi remediation branch to GitHub with DCO sign-off.

2. Cursor IDE Setup (Local Daemon)

In Cursor, go to Cursor Settings -> Features -> MCP -> Add New MCP Server, or write the config file yourself. Use ~/.cursor/mcp.json so Nadhi Audit is available in every project. A .cursor/mcp.json in a project root works too, but only inside that one project.

Terminal / Code Snippet
// ~/.cursor/mcp.json (every project) // or .cursor/mcp.json (this project only) { "mcpServers": { "nadhi-audit": { "url": "http://127.0.0.1:8765/mcp" } } }

3. Claude Code CLI Setup (Local Daemon)

Run this once to connect Claude Code to your local Nadhi Audit daemon. Note the --scope user flag: without it Claude Code registers the server for the current folder only, and a session opened anywhere else will not list the Nadhi tools at all.

Terminal / Code Snippet
claude mcp add --scope user --transport http nadhi-audit http://127.0.0.1:8765/mcp
  • ✓Already added it without --scope user? Run the command above again from any folder. The user-scope entry then applies everywhere, and the old per-folder entry is harmless.
  • ✓Scope changes take effect in new sessions. Claude Code reads its MCP config at startup, so restart it before looking for the tools.
  • ✓No token is needed on 127.0.0.1. The daemon only demands a bearer token when it is bound to a non-loopback address.
  • ✓The Nadhi Audit app must be running. It is the MCP server. If the tools are listed but every call fails, the app is closed or the daemon is off in Settings.
  • ✓Check what a session can see with the /mcp command inside Claude Code, or claude mcp list in a terminal.

4. Why there is no cloud connection

Nadhi Audit only accepts MCP connections on 127.0.0.1, from agents running on the same machine. There is no cloud relay, so a cloud IDE such as Replit or Lovable cannot reach it, and your code never passes through a server of ours on the way to being audited.

5. Available MCP Tool Suite

Nadhi Audit exposes these tools to local MCP clients:

Command or ToolDescription
audit_repositoryRun compliance and security audit over the active repository or file dictionary.
audit_changesFast incremental audit checking only modified files and diffs.
audit_refAudit a remote Git commit or branch without cloning source to disk (for CI).
fix_findingApply automated AST-verified fixes on an isolated git branch.
validate_fixRe-audit changed scope and verify that compiler syntax gates pass.
full_auditAll-in-one: Audits code, evaluates false positives, fixes bugs, and validates.
create_prPush the remediation branch to GitHub and create a Pull Request.
explain_findingIn-depth security explanation and suggested AST code repair for a CWE.
get_last_reportRetrieve the last markdown report and findings summary.

6. Example Prompts in Cursor & Claude Code

You can prompt your editor agent naturally with tool calling:

Terminal / Code Snippet
• "Audit this repository for OWASP Top 10:2025 security vulnerabilities." • "Run /audit_fix to apply and commit verified code fixes on branch nadhi without pushing." • "Run /full_audit to audit, repair, test, and create a Pull Request on GitHub."
🐙

GitHub Authentication & CLI Setup

Configure GitHub CLI and Personal Access Tokens for private repository auditing and 1-click PR creation.

Remote VCS

1. GitHub CLI Setup (Recommended)

Install and authenticate the official GitHub CLI to allow Nadhi Audit to create forks and pull requests automatically:

Terminal / Code Snippet
# 1. Install GitHub CLI brew install gh # 2. Authenticate with GitHub gh auth login # 3. Verify authentication status gh auth status

2. Connecting Private Repositories via PAT

If you do not use GitHub CLI, generate a Read-Only Personal Access Token (repo scope) and authenticate via chat or Settings:

Terminal / Code Snippet
# In Nadhi Audit Chat or Terminal: run(command="vcs auth github ghp_yourPersonalAccessTokenHere")
🛡️

Compliance Frameworks & Toggles

Switch between global software security standards and regional privacy compliance mandates in one click.

4 Regimes

1. Security Audit — OWASP Top 10:2025 / CWE

Against the OWASP list finalised in January 2026. Covers the classic vulnerability set — SQL injection (CWE-89), OS command injection (CWE-78), XSS (CWE-79), path traversal (CWE-22), disabled TLS verification (CWE-295), hardcoded credentials (CWE-798) — and adds the classes that dominate AI-generated code, where the defect is usually a control that is ABSENT rather than a line that is wrong. Four lanes run over one tree: source patterns; row-level security replayed from your migrations (tables served with no access policy); the dependency tree matched against a bundled advisory database and checked for names that never resolved; and, if you enable it, a read-only check of what your deployed backend actually enforces. Findings that combine across lanes are reported as a single chain. Note the 2025 renumbering: SSRF is no longer its own category (CWE-918 now sits in A01 Broken Access Control), A03 is Software Supply Chain Failures rather than Injection, and A10 Mishandling of Exceptional Conditions is new.

The dependency lane, in detail

Every version your lockfile actually resolved is compared against a bundled OSV export — the whole tree, not only what the manifest names, because most published advisories land on a transitive dependency nobody chose. A declared range is never checked, since a range does not say what is installed. The database ships with the app and the date it was built is printed beside every finding, so the audit runs with the network cable out and tells you exactly how stale it is. A package that resolves to several versions is checked at each of them: a tree can carry two copies of the same library and only one of them patched. Lockfiles read today: package-lock.json, yarn.lock, pnpm-lock.yaml and bun.lock for npm; uv.lock, poetry.lock, Pipfile.lock and pinned requirements for PyPI; composer.lock for Packagist. NuGet, Go modules, Maven and RubyGems are not read yet — where an ecosystem is unread the Coverage section says so rather than reporting a clean result. Separately, a dependency named in the manifest but absent from its own registry lockfile is reported: it has never resolved on any machine that produced the repository, which is the state both of a package added by hand and never installed and of a name that does not exist.

What a clean report does and does not mean

Every report carries a Coverage section naming which lanes ran, how many candidates each raised, and where the evidence cap bit — when it did, absence of a finding reflects the sample rather than the tree. Candidates removed before any model read them are listed under Filtered Before Review with the check that removed them, and candidates a theme review raised and then rejected are listed under Withdrawn in Triage with the reason. "No findings" and "heavily filtered" are different results and only those sections tell them apart. Recall is not measured: absence of a finding is not proof of absence of risk.

2. India DPDP Act 2023 & Rules 2025 (Default)

Audits data fiduciary obligations: Section 8(5) reasonable security safeguards, Rule 6 security log retention (minimum 1 year), personal data in logs (CWE-532), and data principal rights.

3. US HIPAA Health Compliance

Audits protected health information (PHI) safeguards: Section 164.312 transmission encryption, access control, audit logging, and cleartext medical identifiers.

4. European Union GDPR

Audits Article 32 security of processing, Article 30 records, and Chapter V cross-border transfer controls.

How to Switch Frameworks

Select your active framework in Nadhi Audit Settings, or pass the framework name directly when running an audit:

Terminal / Code Snippet
# In Chat or MCP (DPDP when no framework is named): /audit /path/to/project dpdp /audit /path/to/project security /audit /path/to/project hipaa /audit /path/to/project gdpr
🛠️

Automated AST-Verified Code Fixing

How Nadhi Audit fixes vulnerabilities safely on an isolated branch with compiler and judge verification.

Multi-Strategy Repair

Multi-Strategy Remediation Loop

When you run /fix or full_audit, Nadhi Audit executes a LangGraph state machine with 3 progressive repair strategies:

  • ✓Pre-Fix False Positive Filter: Local model evaluates finding context. Skips test fixtures, mocks, and protocol requirements.
  • ✓Strategy 1 (Direct Find/Replace): Precise line replacement with line-prefix normalization.
  • ✓Strategy 2 (Contextual Block Repair): Expands context window and injects compiler feedback to prevent repeating syntax mistakes.
  • ✓Strategy 3 (AST / ReAct Graph): Scoped function-level AST transformation.

Compiler & AST Syntax Gate

Before any code edit is kept, Nadhi Audit re-parses and tests the patched file using language interpreters in check-only mode:

Terminal / Code Snippet
• JavaScript / TypeScript: node --check • Python: python3 -m py_compile • PHP: php -l • Ruby: ruby -c • JSON: JSON.parse validation

LLM-as-a-Judge Review

The local model compares the original and patched diff. It validates that the vulnerability is removed, program semantics are preserved, and no undefined variables were introduced. Clean edits are committed to the isolated nadhi branch with DCO sign-offs.

📄

Executive Audit Reports (PDF)

Generate formal compliance reports with findings, evidence lines, and methodology.

Auditor-Ready

Report Structure

Every audit generates a markdown summary in the workspace and an executive PDF document containing:

  • ✓Report ID and timestamp for audit reproducibility.
  • ✓Target repository path and exact files scanned.
  • ✓Severity breakdown: Critical, High, Medium, Low.
  • ✓Citable clause mappings (e.g. OWASP A01:2025, DPDP Sec 8(5), HIPAA Section 164.312).
  • ✓Evidence quotes citing exact file and line numbers.
  • ✓Assessor review and approval sign-off block.

Report File Location

Reports are stored in your selected workspace folder under: ~/Desktop/Nadhi-Audit/<repo-name>/security-audit-report-*.pdf

🌐

Self-Hosted Ollama Support

Route inference to a central GPU workstation or private server on your local network.

LAN Server

Connecting to a LAN Ollama Server

To use a central server instead of your Mac local model, open Settings in Nadhi Audit and configure:

Terminal / Code Snippet
1. Enable "Self-Hosted Ollama Server" 2. Ollama Server URL: http://192.168.1.100:11434 3. Model Name: llama3.3:70b or gemma2:27b

Airgapped Integrity

In Ollama mode, network egress remains strictly blocked from public internet. Traffic only flows over private RFC1918 loopback and local network addresses.