Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Claude Code Permissions Hardening: Safe Defaults

    1

    Loose tool permissions in Claude Code often lead to accidental secret leaks or destructive command execution.

    Free

    1 useSecurity scanned
    Claude Code Permissions Hardening: Safe Defaults

    Claude Code Permissions Hardening: Safe Defaults

    Example session with this skill installed

    Audit my current Claude Code settings and give me a hardened configuration for a Node.js project that uses .env files and AWS.

    • Read your context and instructions
    • Compiled the claude code permissions

    I have audited your environment and detected broad permissions. Your current config allows general Bash(*) access, which puts your .env and ~/.aws/ credentials at risk.

    Security Audit Findings

    RiskLocationRecommended Fix
    Credential Leak.env, ~/.aws/**Add explicit deny rules for these paths.
    Broad Bash AccessBash(*)Replace with specific allow/ask rules for npm and git.
    External FetchWebFetchMove to ask or deny to prevent data exfiltration.

    Hardened settings.json

    {
      "permissions": {
        "allow": [
          "Bash(npm run test:*)",
          "Bash(npm run lint:*)",
          "Bash(git status)",
          "Bash(git diff:*)"
        ],
        "ask": [
          "Bash(git push:*)",
          "Bash(npm install:*)",
          "Bash(aws s3 sync:*)"
        ],
        "deny": [
          "Read(./.env)",
          "Read(./.env.*)",
          "Read(./secrets/**)",
          "Read(~/.ssh/**)",
          "Read(~/.aws/**)",
          "Bash(rm -rf:*)",
          "Bash(curl:*)",
          "Bash(wget:*)",
          "Bash(sudo:*)"
        ]
      },
      "defaultMode": "architect"
    }
    

    Next steps

    1. Copy the JSON above into your .claude/settings.json for team-wide rules.
    2. Run claude path/to/your/env to confirm the Read(./.env) request is blocked.
    3. Test your npm run test command to verify authorized workflows remain uninterrupted.
    Hardened settings.json

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Loose tool permissions in Claude Code often lead to accidental secret leaks or destructive command execution. This skill audits your configuration and generates a hardened settings.json to enforce strict security boundaries.

    What it does

    • Permission Auditing identifies overly broad allow rules for Bash and WebFetch across local and global settings.
    • Secret Protection generates explicit deny rules for .env files, SSH keys, AWS credentials, and sensitive directories.
    • Mode Optimization configures the defaultMode and restricts file access to specific project directories.
    • Destructive Command Blocking prevents dangerous operations like sudo, rm -rf, or unauthorized curl/wget requests.
    • Hook Review analyzes MCP servers and PreToolUse hooks for potential insecure code execution.

    How it works

    1. Audit phase reads your global and project-level settings to find high-risk configurations.
    2. Baseline generation creates a tailored permissions object with allow, ask, and deny arrays.
    3. Defense strategy suggests PreToolUse hooks and sandbox isolation settings for filesystem and network.
    4. Verification provides a test plan to confirm blocked actions without breaking common development workflows.

    Frameworks & tools

    This skill targets Claude Code CLI environments and works with standard JSON configuration files (settings.json and settings.local.json).

    Why this beats prompting it yourself

    Manual configuration is prone to syntax errors and overlooked paths like hidden environment files. This skill uses a systematic audit-first approach to ensure your security posture covers deep-nested secrets and command-specific wildcards that general prompts often miss.

    Use cases

    • Secure a new project repository before sharing it with a team.
    • Prevent Claude from reading sensitive developer credentials in home directories.
    • Restrict Bash execution to a whitelist of npm or git subcommands.
    • Audit third-party MCP servers for excessive scopes or token access.

    Known limitations

    Requires manual application of generated JSON to local settings files. Filesystem sandboxing suggestions depend on underlying OS support.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Requires manual file updates. Sandboxing capabilities vary by OS. Only audits Claude Code specific settings.json files.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    • Free with an Agensi account

    Permissions

    Network Access
    Listed4 days ago
    Updated1 day ago

    What's inside

    Frequently Asked Questions

    This skill audits your Claude Code configuration and generates a hardened settings.json file that explicitly blocks access to sensitive files (like .env or SSH keys) and prevents destructive CLI commands.

    It is specifically designed for the Claude Code CLI and works by analyzing and optimizing the global and project-level settings.json configuration files.

    The skill generates a comprehensive security baseline, a tailored permissions object with 'deny' rules, and a verification test plan to ensure your new settings work as expected.

    No, the skill performs a read-only audit and provides the hardened JSON code for you to review; you will then manually apply the changes to your local settings files to maintain full control.

    Yes, the skill includes a specific 'Hook Review' phase that analyzes MCP server configurations for excessive scopes or potential token leaks before they are executed.

    The audit logic is updated to reflect the latest Claude Code CLI releases and emerging security patterns, such as new flags or changes in how PreToolUse hooks are handled.

    New in Security

    Free