Agent Security Hooks banner
suchithnarayan suchithnarayan

Agent Security Hooks

Security community

Description

Security hooks for AI coding assistants (Claude Code, Cursor, Gemini CLI) - block dangerous commands, protect files, audit logsSecurity hooks for AI coding assistants (Claude Code, Cursor, Gemini CLI) - block dangerous commands, protect files, audit logs

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Agent Security Hooks

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

A Python-based security monitoring system that integrates with AI coding assistant hooks to validate commands against blacklists, block dangerous operations, and log all activities for compliance auditing.

**Designed for Safety**: Built with a "fail-closed" architecture, security-conscious defaults, and sensitive data redaction to prevent accidental operations or data leaks by AI agents.

Table of Contents

Supported Platforms

Platform Config File Documentation
Claude Code .claude/settings.json code.claude.com/docs/en/hooks
Cursor .cursor/hooks.json cursor.com/docs/agent/hooks
Gemini CLI .gemini/settings.json geminicli.com/docs/hooks

Features

  • Command Validation - Block dangerous shell commands (rm -rf, kubectl delete cluster, etc.)
  • File Protection - Prevent access to sensitive files (.env, secrets/, *.pem, etc.)
  • Confirmation Prompts - Require approval for risky operations (kubectl apply, git push, etc.)
  • Audit Logging - JSON Lines logs for compliance and forensics
  • Multi-Platform - Single tool works