Noma Security - Claude Code Hooks Plugin
Runtime Protection for Claude Code Agents
Noma Security provides active runtime protection for Claude Code by sitting between your AI agents and their intended actions. This plugin enables you to evaluate, allow, or block high-risk activities in real-time.
For more details, visit noma.security.
What We Protect
With Claude Code Hooks enabled, Noma acts as a security gatekeeper for the following high-risk agent actions:
- Shell execution: Prevent unauthorized terminal commands or malicious script injections
- MCP tool execution: Governs Model Context Protocol interactions and unauthorized tool use
- File reads: Protects sensitive local data (e.g.,
.env files, SSH keys) from being indexed or sent to the LLM
- User prompt submission: Scans and filters sensitive data, PCI, PII, PHI before it leaves your local environment
Prerequisites
- Claude Code v2.0.12+: Ensure you are running a supported version of the CLI
- Noma API Key: Request an API Key for this plugin from your Noma Technical Account manager (Note: This is not an API Key that you create within the Noma Console)
- Supported OS: macOS, Linux, or Windows
- macOS / Linux: requires
bash and curl (both preinstalled on macOS; available by default on most Linux distributions)
- Windows: requires Windows PowerShell 5.1 or later (preinstalled on Windows 10 / 11)
Installation
Step 1: Add the Noma Marketplace
Add the Noma marketplace to your Claude Code instance:
claude plugin marketplace add https://github.com/Noma-Security/claude-marketplace
Step 2: Install the Guardrails Plugin for Your OS
The Noma marketplace ships two plugins — choose the one matching your operating system. Do not install both on the same machine; they would double-fire every hook event and produce duplicate inferences in the Noma Console.
| Plugin | OS | Runtime | Hook Script |
|---|
guardrails | macOS, Linux | bash + curl | hook-curl.sh |
guardrails-windows | Windows | PowerShell 5.1+ | hook-curl.ps1 |
macOS / Linux
claude plugin install guardrails@noma-marketplace
Windows
claude plugin install guardrails-windows@noma-marketplace
Both plugins implement the same protection model and connect to the same Noma API endpoints — only the runtime and credential-storage mechanism differ.
Configuration
To connect Claude Code to your Noma instance, you need to configure the NOMA_API_KEY.
Option A: Managed Settings (Recommended for Teams)
If your organization manages Claude Code usage via a centralized settings.json, your administrator can push these configurations directly:
- Navigate to your organization's Claude management console
- In the Managed settings section, update the
settings.json to include the Noma environment variables
Option B: Local Environment
For individual setups, instead of exporting variables in your shell profile, Claude Code reads configurations from a local JSON file. This mirrors the structure used in the Managed Settings method.
To configure your local environment, add your Noma credentials to the following path: ~/.claude/settings.json
Example settings.json structure:
{
"NOMA_API_KEY": "your-secret-api-key"
}
Option C: Operating System Credential Store (Most Secure Local)
If NOMA_API_KEY is not set via env var or settings.json, the hook scripts will look it up from your operating system's built-in credential store. The key is encrypted at rest by the OS and bound to your user account.
macOS — Keychain
Store the key once:
security add-generic-password -s "noma-guardrails" -a "$USER" -w "your-secret-api-key"
The guardrails plugin retrieves it via security find-generic-password at hook fire time.
Linux — libsecret / GNOME Keyring
Requires secret-tool (package libsecret-tools on Debian/Ubuntu, libsecret on Fedora):
secret-tool store --label="Noma Guardrails" service noma-guardrails username "$USER"
# secret-tool will prompt for the API key
The guardrails plugin retrieves it via secret-tool lookup at hook fire time.
Windows — Credential Manager
Store the key via cmdkey (run from PowerShell so $env:USERNAME expands to your Windows login):
cmdkey /generic:noma-guardrails /user:$env:USERNAME /pass:your-secret-api-key
Or via the GUI (Control Panel → User Accounts → Credential Manager → Windows Credentials → Add a generic credential):
- Internet or network address:
noma-guardrails
- User name: your Windows username (the script doesn't filter by this field — only the password is read — but using your real login keeps the entry recognizable in the Credential Manager UI)
- Password: your Noma API key