Confirm Python scripts · Hooks for Cursor | Prompt Studio
    1. Cursor
    2. Hooks
    3. Confirm Python scripts
    Cursor · HooksFlujo de trabajo

    Confirm Python scripts

    Asks for your approval before running Python scripts.

    by Prompt Studio

    hooksbeforeShellExecution

    License: MITView original

    Contents

    Where it goes: .cursor/hooks.json

    {
      "version": 1,
      "hooks": {
        "beforeShellExecution": [
          {
            "command": "bash -c 'jq -r .command | grep -Eiq -e \"(^|[;&|[:space:]])python3? [a-z_/.-]+[.]py\" && echo \"{\\\"permission\\\":\\\"ask\\\",\\\"userMessage\\\":\\\"Confirma antes de ejecutar scripts de Python\\\",\\\"agentMessage\\\":\\\"Confirma antes de ejecutar scripts de Python\\\"}\" || echo \"{\\\"permission\\\":\\\"allow\\\"}\"'"
          }
        ]
      }
    }
    

    More in Hooks

    • Block dangerous commands

      Stops rm -rf, git push --force and similar before they run.

    • Protect .env

      Prevents the agent from reading files with secrets.

    • Format on edit

      Runs Prettier on every file the agent edits.

    • Lint on stop

      Runs the linter when the agent finishes its turn.

    • Notify when done

      Desktop notification when the agent finishes (macOS).

    • Command log

      Saves every agent command to .cursor/audit.log.

    See all in Hooks (506) →

    Your ultimate collection of AI prompts. Gather inspiration, explore examples, and create with AI.

    Main hubs

    • Prompts
    • Images
    • Videos
    • Generate Videos
    • Templates
    • Animations
    • Prices
    • About
    • Affiliate

    Browse by type

    • Component kits
    • Image Tags
    • Video Tags
    • Webs

    Popular topics

    • Music
    • Portfolio
    • Gaming
    • Travel
    • Nano Banana Pro

    Legal

    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Licenses Policy
    • Refund Policy
    • Affiliate Program Terms
    • Crowdfunding Terms

    Magzin LLC, 800 Third Avenue Associates, New York, NY, 10022, United States

    © 2026 Prompt Studio by Magzin. All rights reserved.