defense-in-depth

Validate data inputs across API boundaries, business logic, and environments.

13|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/pbdeuchler/llm-plugins --skill defense-in-depth-pbdeuchler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defense-in-depth
Source: https://github.com/pbdeuchler/llm-plugins/tree/main/plugins/house-style/skills/defense-in-depth
Command: npx skills add https://github.com/pbdeuchler/llm-plugins --skill defense-in-depth-pbdeuchler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When invalid data causes failures deep in the call stack, validating at a single point is not enough; defense-in-depth ensures data is validated at every layer to make bugs structurally impossible.

Core Features & Use Cases

  • Entry Point Validation: Rejects invalid input at API/system boundaries to stop bad data at the door.
  • Business Logic Validation: Ensures data conforms to domain rules within core operations.
  • Environment Guards: Prevent dangerous operations in unsafe or test contexts.
  • Debug Instrumentation: Logs context to aid forensics when validation fails.

Quick Start

Enact defense-in-depth by validating input at entry, enforcing business rules, adding environment guards, and enabling debug instrumentation.

Frequently Asked Questions about defense-in-depth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is multi-layer data validation in software engineering?

Multi-layer data validation enforces input checks across API boundaries, business logic, environment contexts, and testing scenarios to prevent bugs by ensuring invalid data is caught at every layer.

How do I stop invalid input from causing failures deep in the call stack?

To stop invalid input from causing deep call stack failures, apply defense-in-depth validation by rejecting bad data at entry points, enforcing business rules, adding environment guards, and enabling debug instrumentation.

When do I need to validate data at every layer instead of a single entry point?

You need multi-layer validation when data traverses multiple code paths and a single validation point is insufficient to structurally prevent bugs caused by invalid data reaching core operations.

How do I add environment guards to prevent dangerous operations in test contexts?

Add environment guards by implementing validation checks that identify unsafe or test contexts and block dangerous operations, while using debug instrumentation to log context for forensic analysis when validation fails.

Does defense-in-depth validation work with existing API boundaries and business logic?

Yes, defense-in-depth validation applies directly to API boundaries and business logic by enforcing entry-point validation to reject invalid input and business-logic checks to ensure data conforms to domain rules.

What is the best way to enforce data validation across multiple code paths?

The best way to enforce data validation across multiple code paths is implementing a multi-layer strategy that covers entry-point validation, business-logic checks, environment guards, and debug instrumentation.