Install
Requires Node.js 20 or later.
# Node.js 20+ and pnpm 10+ $ git clone https://github.com/adamchemlelao-ai/test1.git nivoryn $ cd nivoryn && pnpm install && pnpm build:cli $ node packages/scanner/dist/cli.js scan --path ./my-agent-project # The npm package (npx nivoryn) is being prepared for publication.
Quick start
cd my-agent-project
nivoryn scan # terminal summary
nivoryn scan --verbose # with evidence and fixes
nivoryn scan --format html -o report.htmlEvery finding shows the rule ID, file, line number and JSON pointer it was derived from. Open the HTML report for the full explanation and remediation.
Commands and options
nivoryn scan | Scan the current directory (default command). |
--path <dir> | Scan another directory. |
--format terminal|json|html|pdf | Output format. JSON goes to stdout unless --output is set; HTML/PDF are written to a file. |
--output <file> | Write the report to a file. |
--include-user-config | Also read user-level configuration in your home directory (opt-in). |
--fail-on <severity> | Exit with code 1 if any finding is at or above critical|high|medium|low|info. |
--verbose | Show evidence snippets and remediation in the terminal. |
nivoryn report --scan s.json [--review r.json] | Render HTML/PDF/JSON from a saved scan, optionally merged with human review annotations. |
nivoryn rules [--json] | List rules and supported files. |
nivoryn version | Print the version. |
Supported files
The scanner reads only these paths. It never walks directories recursively, never follows references to other files and never executes anything it finds.
- Claude Code project:
.claude/settings.json,.claude/settings.local.json,.mcp.json,.claude/agents/*.md - Generic MCP:
mcp.json,.cursor/mcp.json,.vscode/mcp.json,.gemini/settings.json,.roo/mcp.json,.kiro/settings/mcp.json(comments and trailing commas allowed) - n8n: exported workflow JSON (single workflow or
export:workflow --allarray) in the project root,workflows/,n8n/or.n8n/, or any file passed with--file. Other JSON files are ignored. - Claude Desktop:
claude_desktop_config.jsonin the project; with--include-user-config, the OS location (macOS~/Library/Application Support/Claude/, Windows%APPDATA%\Claude\, Linux~/.config/Claude/) - User level (opt-in):
~/.claude/settings.json,~/.claude.json,~/.claude/agents/*.md,~/.cursor/mcp.json
Files larger than 5 MB, unreadable files and invalid JSON are reported as not evaluated and the scan is marked incomplete.
Rules
NIV-001 — Unrestricted shell execution
Default severity: CRITICAL · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-mcp, claude-code-user, claude-desktop, generic-mcp
The agent is pre-approved to run any shell command without asking a human first.
Risk. Unrestricted shell access is equivalent to giving the agent the operator's full user account. A single prompt injection (from a web page, issue, email or file the agent reads) can install software, exfiltrate files or credentials, or delete data.
Remediation. Replace the blanket Bash permission with narrowly scoped command prefixes, e.g. "Bash(npm run test:*)" or "Bash(git status)". Leave everything else on the default ask behaviour and add explicit deny rules for dangerous commands.
NIV-002 — Human approval disabled
Default severity: CRITICAL · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-mcp, claude-code-user, claude-desktop, generic-mcp
The agent's permission mode removes or weakens the human-in-the-loop approval step.
Risk. With permission prompts bypassed, every tool call (shell, file writes, network, MCP tools) runs immediately. Mistakes and injected instructions are executed before a human can intervene.
Remediation. Remove "defaultMode": "bypassPermissions" from shared settings. Use bypass mode only inside disposable sandboxes (containers or VMs without credentials). Consider setting "disableBypassPermissionsMode": "disable" in managed or project settings.
NIV-003 — Broad filesystem access
Default severity: HIGH · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-mcp, claude-desktop, generic-mcp
The agent or one of its MCP servers can read or modify an entire disk, system directory or home directory.
Risk. Home directories contain SSH keys, cloud credentials, browser profiles, password databases and other clients' projects. Broad access turns any prompt injection into a data-exfiltration or tampering incident well beyond the project.
Remediation. Restrict filesystem servers and additionalDirectories to the specific project folders the workflow needs (e.g. "/Users/me/clients/acme/workflow"). Never grant "/", "~" or a whole home directory.
NIV-004 — Access to sensitive credential paths
Default severity: HIGH · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-mcp, claude-desktop, generic-mcp
The configuration explicitly grants access to locations that normally hold credentials (.ssh, .aws, .env, key files, keychains).
Risk. Credentials read by an agent can be echoed into logs, model context, commits or outbound requests, and reused by an attacker to access production systems.
Remediation. Remove the credential path from allow rules and server arguments. Add deny rules (e.g. "Read(~/.ssh/**)", "Read(./.env)") and provide the agent scoped, short-lived tokens through a secret manager instead.
NIV-005 — Unrestricted network access
Default severity: MEDIUM · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-mcp, claude-desktop, generic-mcp
The agent can contact arbitrary hosts without approval, as far as can be determined from configuration.
Risk. Unrestricted outbound access is the exfiltration channel for most agent attacks, and every fetched page is a potential prompt-injection vector.
Remediation. Limit WebFetch to specific domains ("WebFetch(domain:docs.example.com)"), move curl/wget to the ask list, and configure domain allowlists on fetch/browser MCP servers or at a network proxy.
NIV-006 — Unpinned external package execution
Default severity: MEDIUM · Method: static · Inspects: claude-code-mcp, claude-code-user, claude-desktop, generic-mcp
An MCP server is started by downloading the latest version of a package or container image at launch time.
Risk. Every launch trusts whatever the registry serves at that moment. A compromised maintainer account, typosquat or malicious update runs immediately with the agent's privileges — a common supply-chain attack path for MCP servers.
Remediation. Pin exact versions ("@modelcontextprotocol/server-github@2025.4.8", "mcp-server-git==0.6.2") or container digests ("image@sha256:…"), review updates deliberately, and prefer packages from publishers you have vetted.
NIV-007 — Risky MCP server launch configuration
Default severity: HIGH · Method: static · Inspects: claude-code-mcp, claude-code-user, claude-desktop, generic-mcp
An MCP server is launched in a way that weakens isolation or executes code that cannot be reviewed in advance.
Risk. Remote-script execution, shell-wrapped launch strings and privileged containers each allow code outside the reviewed configuration to run with high privileges on the host.
Remediation. Invoke the server binary directly with an explicit argument list, install from a pinned, reviewed source, and run containers without --privileged, host networking, broad host mounts or the Docker socket.
NIV-008 — Missing tool restrictions
Default severity: MEDIUM · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-agent
Tools are enabled or approved in bulk instead of individually.
Risk. Bulk approval means new or unexpected tools become available to the agent without anyone deciding they should be. This is how least-privilege erodes over time.
Remediation. List the specific MCP servers to enable (enabledMcpjsonServers), approve individual tools rather than whole servers, and give each subagent an explicit tools: list.
NIV-009 — Sensitive actions run without human approval
Default severity: MEDIUM · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-mcp, claude-code-user, claude-desktop, generic-mcp
Actions that publish, deploy, merge, change cloud resources or contact external parties are pre-approved, so no human confirms them.
Risk. These actions are hard to reverse and affect systems outside the developer's machine (production infrastructure, package registries, customers). If the agent is misdirected, the damage is external before anyone notices.
Remediation. Move these rules from permissions.allow to permissions.ask so a human confirms each invocation, or remove them. Keep read-only variants (e.g. "Bash(kubectl get:*)") in allow if needed.
NIV-010 — Dangerous command permissions
Default severity: HIGH · Method: static · Inspects: claude-code-settings, claude-code-user
Commands that escalate privileges, destroy data, change permissions, or run arbitrary code through an interpreter are pre-approved.
Risk. Approving an interpreter with arbitrary arguments (e.g. "python:*" or "node -e:*") is equivalent to unrestricted shell access. Privilege escalation and destructive commands can cause irreversible damage to the host.
Remediation. Remove these entries from permissions.allow and add them to permissions.deny. If a specific script must run, allow that exact script path instead of the interpreter, e.g. "Bash(node scripts/build.mjs)".
NIV-011 — Potentially exposed secrets
Default severity: HIGH · Method: static · Inspects: claude-code-settings, claude-code-user, claude-code-mcp, claude-desktop, generic-mcp, claude-code-agent, n8n-workflow
A credential appears to be stored as a literal value in an agent configuration file.
Risk. Configuration files are copied between machines, shared with clients, committed to repositories and read by the agent itself. A literal credential in them should be treated as exposed.
Remediation. Rotate the credential now. Replace the literal with an environment variable reference (e.g. "${GITHUB_TOKEN}") or a secret-manager reference, and make sure the file is excluded from version control if it must hold secrets.
NIV-012 — Insecure remote transport and unverified authorization
Default severity: HIGH · Method: static · Inspects: claude-code-mcp, claude-code-user, claude-desktop, generic-mcp, n8n-workflow
A remote MCP server is reached over unencrypted HTTP, or its authorization scope cannot be determined from configuration.
Risk. Unencrypted transport exposes tool calls, results and tokens to anyone on the network path and allows responses to be modified. For HTTPS servers the risk depends on scopes granted at authorization time.
Remediation. Use https:// endpoints only. For each remote server, document which account it authorizes as, which scopes were granted, and revoke scopes the workflow does not need.
NIV-013 — Automatic hook commands
Default severity: INFO · Method: manual review · Inspects: claude-code-settings, claude-code-user
Claude Code hooks run shell commands automatically on agent events.
Risk. Hooks execute without a prompt and receive tool inputs and outputs. They are a legitimate control point, but also a persistence mechanism if someone can edit the settings file.
Remediation. Keep hook scripts in version control, review changes to them like code, avoid sending hook input to external services, and protect settings files from modification by the agent (deny Edit on .claude/settings*.json).
NIV-014 — Secret files are not explicitly denied
Default severity: LOW · Method: heuristic · Inspects: claude-code-settings
Project Claude Code settings exist, but none of them deny reading environment files such as .env.
Risk. Without a deny rule, the agent may read .env files during normal exploration and include secrets in its context, logs, or outbound requests. This is a missing defence-in-depth control rather than a confirmed exposure.
Remediation. Add deny rules such as "Read(./.env)", "Read(./.env.*)" and "Read(./secrets/**)" to .claude/settings.json so they apply to every collaborator.
NIV-015 — n8n command and code execution
Default severity: HIGH · Method: static · Inspects: n8n-workflow
An n8n workflow runs shell commands (Execute Command, SSH) or Code nodes with access to the host, environment or dynamic code evaluation.
Risk. These nodes run with the n8n server's privileges. When their input comes from webhooks, emails or an AI agent, an attacker can execute commands on the n8n host or read every credential the instance holds.
Remediation. Remove Execute Command/SSH nodes from agent-facing workflows, or move them behind a separate, authenticated workflow with fixed commands. In Code nodes avoid child_process, fs and $env; on self-hosted n8n set NODES_EXCLUDE to disable executeCommand and set N8N_BLOCK_ENV_ACCESS_IN_NODE=true.
NIV-016 — n8n unauthenticated trigger
Default severity: MEDIUM · Method: static · Inspects: n8n-workflow
A webhook, public chat or form trigger starts the workflow without authentication.
Risk. Unauthenticated triggers let anyone on the internet feed input into the workflow — including AI agents that act on it. Webhook URLs leak through logs, browser history and client code.
Remediation. Enable Header Auth, Basic Auth or JWT authentication on webhooks; require authentication on chat and form triggers; validate and limit input before it reaches an AI agent.
NIV-017 — n8n agent tools with side effects
Default severity: MEDIUM · Method: heuristic · Inspects: n8n-workflow
An n8n AI Agent can call tools that send messages, write data, call APIs or execute code, with no human approval step visible in the workflow.
Risk. The model decides when these tools run. A prompt injection in any input the agent reads can make it send email, change records or call external systems on the attacker's behalf.
Remediation. Give agents read-only tools where possible. Route state-changing actions through a human approval step (e.g. a Send-and-Wait node) or a separate workflow with strict input validation.
Reports and exit codes
- Severity: CRITICAL, HIGH, MEDIUM, LOW, INFO. Individual findings may be raised or lowered from the rule default (e.g. acceptEdits mode is LOW under NIV-002).
- Method: static (deterministic match), heuristic (inferred from names or patterns; may be a false positive), manual review (needs a human).
- Verification: automated, manually verified, false positive, unverified recommendation.
- No score. Nivoryn does not produce a numeric security score. Severity counts are shown, with the list of what was not checked.
- Exit codes: 0 = scan completed; 1 = a finding met
--fail-on; 2 = scan failed (bad path, invalid input).
The JSON report follows schema version 1.0 (schemaVersion). See the example report.
Review annotations
Reviewers turn an automated scan into a verified report with a small JSON file:
{
"reviewer": "Reviewer name",
"clientName": "Client Ltd",
"workflowName": "Support triage agent",
"executiveSummary": "Optional custom summary…",
"findings": {
"F-001": { "verification": "manually_verified", "note": "Confirmed with the agency." },
"F-014": { "verification": "false_positive", "note": "Only runs in a disposable sandbox." }
},
"additionalRecommendations": [{ "title": "Rotate the CRM token", "detail": "…" }],
"retest": { "status": "requested" }
}nivoryn report --scan scan.json --review review.json --format pdf -o report.pdfLimitations
- Static configuration review only. It cannot prove an agent or system is secure.
- MCP servers are never started, so the tools they actually expose are unknown.
- Server source code, OAuth scopes, network controls outside the config, managed policies and launch flags are not evaluated.
- Unsupported frameworks (LangChain, CrewAI, OpenAI Agents SDK) are not scanned automatically. For n8n, instance settings (N8N_* variables), stored credentials and community-node code are not evaluated.
- Secret detection uses known formats and key-name heuristics; it can miss secrets and does not check git history.