anth-security-basics

Featured

Apply Anthropic Claude API security best practices for key management, input validation, and prompt injection defense. Use when securing API keys, validating user inputs before sending to Claude, or implementing content safety guardrails. Trigger with phrases like "anthropic security", "claude api key security", "secure anthropic", "prompt injection defense".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic Security Basics ## Overview Security practices for Claude API integrations: API key management, input sanitization, prompt injection defense, and output validation. ## API Key Security ### Environment-Based Key Management ```bash # .env (NEVER commit) ANTHROPIC_API_KEY=sk-ant-api03-... # .gitignore .env .env.* !.env.example # .env.example (commit this) ANTHROPIC_API_KEY=sk-ant-api03-your-key-here ``` ### Key Rotation Procedure ```bash # 1. Generate new key at console.anthropic.com/settings/keys # 2. Deploy new key (zero-downtime: set both temporarily) export ANTHROPIC_API_KEY_NEW="sk-ant-api03-new..." # 3. Verify new key works python3 -c " import anthropic client = anthropic.Anthropic(api_key='$ANTHROPIC_API_KEY_NEW') msg = client.messages.create(model='claude-haiku-4-20250514', max_tokens=8, messages=[{'role':'user','content':'hi'}]) print('New key works:', msg.id) " # 4. Swap to new key export ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY_NEW" # 5. Revoke old key in Console ``` ### Workspace Key Isolation Use Anthropic Workspaces to isolate keys per team/environment: | Workspace | Purpose | Key Prefix | |-----------|---------|------------| | `dev` | Development/testing | `sk-ant-api03-dev-...` | | `staging` | Pre-production | `sk-ant-api03-stg-...` | | `production` | Live traffic | `sk-ant-api03-prd-...` | ## Prompt Injection Defense ```python import anthropic def safe_user_query(user_input: str, system_prompt: str) -> str: """Separate system instr...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

clade-security-basics

Secure your Anthropic integration — API key management, input validation, Use when working with security-basics patterns. prompt injection defense, and data privacy. Trigger with "anthropic security", "claude api key security", "anthropic prompt injection", "secure claude integration".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-policy-guardrails

Implement content policy guardrails, input/output validation, and usage governance for Claude API integrations. Trigger with phrases like "anthropic guardrails", "claude content policy", "claude input validation", "anthropic safety rules".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-install-auth

Install and configure Anthropic Claude SDK authentication for Python and TypeScript. Use when setting up a new Claude API integration, configuring API keys, or initializing the Anthropic SDK in your project. Trigger with phrases like "install anthropic", "setup claude api", "anthropic auth", "configure anthropic API key", "claude sdk setup".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-install-auth

Install and configure the Anthropic SDK for Claude API access. Use when setting up Claude integration, configuring API keys, or initializing the Anthropic client in your project. Trigger with phrases like "install anthropic", "setup claude api", "anthropic auth", "configure anthropic API key".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-policy-guardrails

Implement content safety guardrails for Claude — input filtering, Use when working with policy-guardrails patterns. output validation, usage policies, and prompt injection defense. Trigger with "anthropic content policy", "claude safety", "claude guardrails", "anthropic prompt injection", "claude content filtering".

2,266 Updated today
jeremylongshore