security-patterns
Use when an agent writes, reviews, or audits code that handles authentication, authorization, user input, or sensitive data
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when an agent writes, reviews, or audits code that handles authentication, authorization, user input, or sensitive data
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | security-patterns |
| description | Use when an agent writes, reviews, or audits code that handles authentication, authorization, user input, or sensitive data |
# Token structure
{
"sub": "user_id",
"exp": timestamp, # short-lived: 15 min
"iat": timestamp,
"type": "access" # distinguish from refresh
}
# Refresh token: long-lived (7-30 days), stored as HTTP-only cookie
# Access token: short-lived, returned in response body
Rules:
HS256 (symmetric) or RS256 (asymmetric for multi-service)# Use bcrypt or argon2 — NEVER md5/sha1/sha256 for passwords
import bcrypt
hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt(rounds=12))
Always validate at system boundaries (API endpoints, file uploads, webhooks):
# Use Pydantic for schema enforcement
class UserCreate(BaseModel):
email: EmailStr # validates format
password: str = Field(min_length=8, max_length=128)
username: str = Field(regex=r'^[a-zA-Z0-9_]+$') # no special chars
Rules:
# ALWAYS use parameterized queries
# WRONG
query = f"SELECT * FROM users WHERE email = '{email}'"
# CORRECT (SQLAlchemy)
result = await db.execute(select(User).where(User.email == email))
# Check ownership before returning data
async def get_document(doc_id: UUID, current_user: User, db: AsyncSession):
doc = await db.get(Document, doc_id)
if doc.owner_id != current_user.id:
raise HTTPException(status_code=403) # not 404 — 404 leaks existence
return doc
Rules:
Apply on all public endpoints, stricter on auth endpoints:
# Auth endpoints: 5 req/min per IP
# Public API: 100 req/min per token
# Expensive ops (file upload, search): 10 req/min
SECRET_KEY = os.environ["SECRET_KEY"] # raises KeyError if missing — good
# WRONG — leaks implementation details
raise HTTPException(detail=f"User {email} not found in table users")
# CORRECT — generic, safe
raise HTTPException(status_code=401, detail="Invalid credentials")
Before marking code complete:
Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when AI agents perform most implementation work and humans enforce quality and risk controls.
REST API design patterns including resource naming, status codes, pagination, filtering, error responses, versioning, and rate limiting for production APIs.
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.
Use when generating or validating the ExecutionPlan JSON that the orchestrator must produce before spawning any agents
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Systematizes the "search for existing solutions before implementing" approach. Use when starting new features or adding functionality.