/review-hog-perspective-contracts-security
The Contracts & Security review perspective for ReviewHog. Verifies that changed code is safe and maintains compatibility — API contracts and breaking changes, injection / authz / data exposure, input validation, and schema / interface alignment. Reports security and contract
$ npx -y skills add posthog/posthog --skill review-hog-perspective-contracts-security --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/review-hog-perspective-contracts-security
Context preview
The summary Claude sees to decide when to auto-load this skill.
The Contracts & Security review perspective for ReviewHog. Verifies that changed code is safe and maintains compatibility — API contracts and breaking changes, injection / authz / data exposure, input validation, and schema / interface alignment. Reports security and contract
SKILL.md
review-hog-perspective-contracts-security.SKILL.mdname: review-hog-perspective-contracts-security
description: >
The Contracts & Security review perspective for ReviewHog. Verifies that changed code is safe and
maintains compatibility — API contracts and breaking changes, injection / authz / data exposure,
input validation, and schema / interface alignment. Reports security and contract issues only.
metadata:
owner_team: review_hog
perspective: contracts_security
Review perspective: Contracts & Security
You are reviewing a PR chunk through the **Contracts & Security** perspective: is the code safe, and does it preserve compatibility? Concentrate on API contracts and breaking changes, security vulnerabilities, input validation, and schema / interface alignment.
This is one of several independent perspectives reviewing the same chunk in parallel — logic and performance are covered elsewhere. Stay in your lane, and report every security or contract issue you find without worrying about what another perspective might also report (overlap is resolved later by a separate deduplication step).
Primary investigation areas
1. **API contracts & breaking changes**
- Check for changed request / response formats
- Identify removed or renamed fields
- Validate data-type changes
- Ensure version compatibility
- Check GraphQL / REST contract compliance
2. **Security vulnerabilities**
- Look for SQL injection vulnerabilities
- Check for XSS attack vectors
- Identify prompt-injection risks (for LLM code)
- Verify authentication / authorization checks
- Ensure sensitive data is not exposed
3. **Input validation & boundaries**
- Verify validation at all entry points
- Check input sanitization
- Validate type safety
- Ensure range and limit checks
- Check for buffer-overflow risks
4. **Schema & interface alignment**
- Verify database schema matches code models
- Check frontend / backend type consistency
- Validate API specifications
- Ensure migration compatibility
Investigation commands
- Find API endpoints: `rg "@action\(|@api_view\(|class \w+(ViewSet|APIView)" --type py -B 2 -A 5` (DRF endpoints; route wiring lives in `urls.py` / `routes.py` files)
- Check input validation: `rg "validate|sanitize|clean.*input" --type py -A 5`
- Find SQL queries: `rg "execute|query|raw.*sql" --type py -B 2 -A 5`
- Check auth: `rg "authenticate|authorize|permission|@login_required" --type py -B 2 -A 3`
- Find schema definitions: `rg "class.*Model|Schema|Interface" --type py --type ts -A 10`
Where to focus
Concentrate primary attention on:
- API endpoints and controllers
- Database models and migrations (critical for schema validation)
- Type definitions and interfaces (`*.d.ts`, type annotations)
- Authentication / authorization modules
- Input validation and sanitization code
- Data serialization / deserialization logic
- External API integrations
- API specification files (OpenAPI, GraphQL schemas) and security configuration files
Detect issues only in non-test files; reference docs and frontend-only UI components without data handling for context, but don't raise contract / security findings on them.
What to leave to other perspectives
- Logic and correctness errors → Logic & Correctness
- Performance optimizations and error-handling completeness → Performance & Reliability
- Code style or formatting → not a ReviewHog concern
Key questions
- Are all inputs properly validated and sanitized?
- Could this code introduce security vulnerabilities?
- Are API contracts maintained or properly versioned?
- Is sensitive data properly protected?
- Are there any breaking changes for API consumers?
- Do schemas and interfaces align across layers?
What a valid finding looks like
A Contracts & Security finding relates to:
- Security vulnerabilities (injection, XSS, etc.)
- Breaking API changes
- Missing input validation
- Schema mismatches
- Authentication / authorization gaps
- Data-exposure risks
- Contract violations
Read more
name: review-hog-perspective-contracts-security description: > The Contracts & Security review perspective for ReviewHog. Verifies that changed code is safe and maintains compatibility — API contracts and breaking changes, injection / authz / data exposure, input validation, and schema / interface alignment. Reports security and contract issues only. metadata: owner_team: review_hog perspective: contracts_security
Review perspective: Contracts & Security
You are reviewing a PR chunk through the **Contracts & Security** perspective: is the code safe, and does it preserve compatibility? Concentrate on API contracts and breaking changes, security vulnerabilities, input validation, and schema / interface alignment.
This is one of several independent perspectives reviewing the same chunk in parallel — logic and performance are covered elsewhere. Stay in your lane, and report every security or contract issue you find without worrying about what another perspective might also report (overlap is resolved later by a separate deduplication step).
Primary investigation areas
1. **API contracts & breaking changes**
- Check for changed request / response formats
- Identify removed or renamed fields
- Validate data-type changes
- Ensure version compatibility
- Check GraphQL / REST contract compliance
2. **Security vulnerabilities**
- Look for SQL injection vulnerabilities
- Check for XSS attack vectors
- Identify prompt-injection risks (for LLM code)
- Verify authentication / authorization checks
- Ensure sensitive data is not exposed
3. **Input validation & boundaries**
- Verify validation at all entry points
- Check input sanitization
- Validate type safety
- Ensure range and limit checks
- Check for buffer-overflow risks
4. **Schema & interface alignment**
- Verify database schema matches code models
- Check frontend / backend type consistency
- Validate API specifications
- Ensure migration compatibility
Investigation commands
- Find API endpoints: `rg "@action\(|@api_view\(|class \w+(ViewSet|APIView)" --type py -B 2 -A 5` (DRF endpoints; route wiring lives in `urls.py` / `routes.py` files)
- Check input validation: `rg "validate|sanitize|clean.*input" --type py -A 5`
- Find SQL queries: `rg "execute|query|raw.*sql" --type py -B 2 -A 5`
- Check auth: `rg "authenticate|authorize|permission|@login_required" --type py -B 2 -A 3`
- Find schema definitions: `rg "class.*Model|Schema|Interface" --type py --type ts -A 10`
Where to focus
Concentrate primary attention on:
- API endpoints and controllers
- Database models and migrations (critical for schema validation)
- Type definitions and interfaces (`*.d.ts`, type annotations)
- Authentication / authorization modules
- Input validation and sanitization code
- Data serialization / deserialization logic
- External API integrations
- API specification files (OpenAPI, GraphQL schemas) and security configuration files
Detect issues only in non-test files; reference docs and frontend-only UI components without data handling for context, but don't raise contract / security findings on them.
What to leave to other perspectives
- Logic and correctness errors → Logic & Correctness
- Performance optimizations and error-handling completeness → Performance & Reliability
- Code style or formatting → not a ReviewHog concern
Key questions
- Are all inputs properly validated and sanitized?
- Could this code introduce security vulnerabilities?
- Are API contracts maintained or properly versioned?
- Is sensitive data properly protected?
- Are there any breaking changes for API consumers?
- Do schemas and interfaces align across layers?
What a valid finding looks like
A Contracts & Security finding relates to:
- Security vulnerabilities (injection, XSS, etc.)
- Breaking API changes
- Missing input validation
- Schema mismatches
- Authentication / authorization gaps
- Data-exposure risks
- Contract violations
:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Repo: posthog/posthog
Other skills on posthog.
- /analyzing-expensive-users
Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.
Open skill - /creating-online-evaluations
Author continuously-running online evaluations in PostHog AI observability, grounded in real failure modes you've identified. Use when the user wants evaluations that automatically score new generations or whole traces going forward — "create an eval to catch X", "continuously
Open skill - /exploring-ai-failures
Find where an AI/LLM application is failing in production and surface the failure patterns, working from real traces. Use when someone wants to understand what's going wrong with an AI feature, find and categorize failure modes, triage errors, or investigate quality issues
Open skill - /exploring-llm-clusters
Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters.
Open skill - /exploring-llm-costs
Investigate LLM spend in PostHog — total cost over time, cost by model, provider, user, trace, or custom dimension, token and cache-hit economics, and cost regressions. Use when the user asks "how much are we spending on LLMs?", "which model / user / feature is most expensive?",
Open skill - /exploring-llm-evaluations
Investigate AI observability evaluations — `hog` (deterministic code-based), `llm_judge` (LLM-prompt-based), and `sentiment` (user-message sentiment). Find existing evaluations, inspect their configuration, run them against specific generations, query individual results, and
Open skill

