본문으로 건너뛰기
Skillpedia
에이전트48k · #3701

ai-coding-agent-guardrails

하는 일

이 도구는 AI 어시스턴트가 할 수 있는 일과 할 수 없는 일에 명확한 규칙을 정해 코딩 팀을 보호하도록 돕습니다. 민감한 정보에 접근하거나, 위험한 명령을 실행하거나, 허락 없이 중요한 코드를 바꾸는 것을 막습니다.

사용하는 경우

  • ✓팀 코딩에 AI 어시스턴트를 쓸 때.
  • ✓AI가 비밀번호나 비밀 키를 유출하지 않게 막고 싶을 때.
  • ✓AI가 중요한 데이터를 삭제하거나 승인 없이 변경하지 않도록 하는 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ai-coding-agent-guardrails/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ai-coding-agent-guardrails/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“AI 어시스턴트가 .env 파일에 접근하지 않고 삭제 명령을 실행하지 않도록 설정해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI가 읽고 수정할 수 있는 파일, 실행할 수 있는 명령, 무시해야 할 민감한 정보를 설정 파일에 규칙으로 정합니다. 이렇게 하면 안전한 작업 환경이 만들어집니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

AI Coding Agent Guardrails

Secure the use of AI coding agents across engineering teams. This skill covers permission boundaries, secret protection, sandbox isolation, code review gates, and audit trails for Claude Code, Cursor, Copilot, and Codex.


Permission Boundaries

CLAUDE.md Configuration

Create a CLAUDE.md at the repository root to restrict Claude Code behavior:

# CLAUDE.md

## Restrictions

- NEVER read or output contents of .env, .env.*, secrets.yaml, or any file matching *.pem, *.key
- NEVER execute `rm -rf`, `DROP TABLE`, `kubectl delete`, or `terraform destroy` commands
- NEVER push directly to main or master branches
- NEVER modify files in the infrastructure/, terraform/, or .github/workflows/ directories without explicit user approval
- NEVER install new dependencies without listing them first for review
- NEVER access or display API keys, tokens, passwords, or connection strings

## Allowed Operations

- Read and modify application source code in src/, lib/, and tests/
- Run test suites with `npm test`, `pytest`, `go test`
- Run linters with `eslint`, `ruff`, `golangci-lint`
- Create new branches with prefix `ai/` or `agent/`
- Create and modify files in docs/ directory

## Code Standards

- All new functions must include docstrings or JSDoc comments
- All new code must have corresponding unit tests
- Follow existing code style and patterns in the repository
- Maximum file length: 500 lines. Suggest splitting if exceeded.

Command Allowlists

For agents that execute shell commands, define an explicit allowlist:

# .agent-permissions.yaml
agent_permissions:
  allowed_commands:
    - "npm test"
    - "npm run lint"
    - "npm run build"
    - "pytest"
    - "ruff check"
    - "go test ./..."
    - "git status"
    - "git diff"
    - "git log"
    - "git checkout -b"
    - "git add"
    - "git commit"
    - "ls"
    - "cat"
    - "head"
    - "tail"

  blocked_commands:
    - "rm -rf"
    - "curl"
    - "wget"
    - "ssh"
    - "scp"
    - "kubectl"
    - "terraform"
    - "aws"
    - "gcloud"
    - "az"
    - "docker push"
    - "npm publish"

  blocked_paths:
    - ".env*"
    - "**/*.pem"
    - "**/*.key"
    - "**/secrets/**"
    - "infrastructure/**"
    - ".github/workflows/**"

  allowed_paths:
    - "src/**"
    - "lib/**"
    - "tests/**"
    - "docs/**"
    - "package.json"
    - "pyproject.toml"

File System Access Controls

Use filesystem permissions to enforce boundaries at the OS level:

#!/bin/bash
# setup-agent-workspace.sh
# Create a restricted workspace for agent execution

AGENT_USER="ai-agent"
REPO_DIR="/workspace/repo"

# Create agent user with limited permissions
useradd --system --shell /bin/bash --no-create-home "$AGENT_USER"

# Set ownership: developers own everything, agent gets read on most
chown -R root:developers "$REPO_DIR"
chmod -R 750 "$REPO_DIR"

# Grant agent write access only to safe directories
setfacl -R -m u:${AGENT_USER}:rwx "${REPO_DIR}/src"
setfacl -R -m u:${AGENT_USER}:rwx "${REPO_DIR}/tests"
setfacl -R -m u:${AGENT_USER}:rwx "${REPO_DIR}/docs"

# Deny agent access to sensitive files
setfacl -m u:${AGENT_USER}:--- "${REPO_DIR}/.env"
setfacl -R -m u:${AGENT_USER}:--- "${REPO_DIR}/infrastructure"
setfacl -R -m u:${AGENT_USER}:--- "${REPO_DIR}/.github/workflows"

echo "Agent workspace permissions configured."

Secret Protection

Pre-commit Hooks with git-secrets

#!/bin/bash
# install-secret-scanning.sh

# Install git-secrets
git clone https://github.com/awslabs/git-secrets.git /tmp/git-secrets
cd /tmp/git-secrets && make install

# Initialize in repository
cd /path/to/repo
git secrets --install

# Register common secret patterns
git secrets --register-aws

# Add custom patterns for common credential formats
git secrets --add '-----BEGIN (RSA |EC |DSA )?PRIVATE KEY-----'
git secrets --add 'AKIA[0-9A-Z]{16}'
git secrets --add 'ghp_[a-zA-Z0-9]{36}'
git secrets --add 'sk-[a-zA-Z0-9]{48}'
git secrets --add 'xox[baprs]-[0-9a-zA-Z-]{10,}'
git secrets --add 'password\s*[:=]\s*["\x27][^\s]{8,}'
git secrets --add 'api[_-]?key\s*[:=]\s*["\x27][^\s]{8,}'

# Add allowed patterns (false positive exclusions)
git secrets --add --allowed 'EXAMPLE_KEY'
git secrets --add --allowed 'your-api-key-here'

Agent Output Scanning

Scan agent-generated output before it reaches version control:

#!/usr/bin/env python3
"""scan_agent_output.py - Scan AI agent output for leaked secrets."""


…
자주 묻는 질문

'권한 경계'란 무엇인가요?

특정 파일에 접근하거나 특정 명령을 실행하는 것처럼 AI 어시스턴트가 할 수 있는 행동을 제한하는 정해진 한계입니다.

AI가 비밀에 접근하지 못하게 어떻게 하나요?

비밀번호, API 키, 그 밖의 민감한 데이터를 절대 읽거나 표시하지 말라고 지시하는 규칙과, 저장되기 전에 코드를 검사하는 도구를 통해서입니다.

AI가 모든 파일을 수정하도록 허용할 수 있나요?

아니요, AI가 변경할 수 있는 폴더와 파일을 정확히 지정할 수 있습니다. 예를 들어 주요 소스 코드나 문서는 허용하고, 민감한 영역은 접근을 제한할 수 있습니다.

상세 정보

작성자의 원본 설명

Secure AI coding agents (Claude Code, Cursor, Codex, Copilot) with permission boundaries, secret protection, code review gates, and safe sandbox configurations for team environments.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#3701
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬