defense-in-depth

Validate input data across four execution layers to prevent runtime failures.

6|Updated Dec 7, 2025
One-click install
npx skills add https://github.com/timequity/plugins --skill defense-in-depth-timequity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defense-in-depth
Source: https://github.com/timequity/plugins/tree/main/craft-coder/defense-in-depth
Command: npx skills add https://github.com/timequity/plugins --skill defense-in-depth-timequity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Single validation can be bypassed by different code paths or mocks. Defense-in-depth enforces validation at EVERY layer data passes through to make bugs structurally impossible.

Core Features & Use Cases

  • Layer 1 - Entry Point Validation: Block obviously invalid input at API boundaries.
  • Layer 2 - Business Logic Validation: Ensure data makes sense for operations.
  • Layer 3 - Environment Guards: Prevent dangerous ops in restricted contexts.
  • Layer 4 - Debug Instrumentation: Capture context for forensic analysis.

Quick Start

Add validations at entry points, business logic, environment guards, and debugging hooks in a new feature to make failures hard to bypass.

Frequently Asked Questions about defense-in-depth

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

FAQPage Schema
How do I validate input data across multiple layers to prevent runtime failures?

Layered validation enforces checks at entry points, business logic, environment guards, and debug instrumentation so invalid data cannot bypass security through alternate code paths. This makes bugs structurally impossible by catching failures at every layer data passes through.

What are the four validation layers in defense-in-depth?

Entry point validation blocks obviously invalid input at API boundaries; business logic validation ensures data makes sense for operations; environment guards prevent dangerous operations in restricted contexts; debug instrumentation captures context for forensic analysis.

Can I use layered validation to cover API requests and workspace initialization?

Yes. Layered validation applies to API endpoints, business logic, environment controls, and debugging instrumentation across data-flow scenarios including API requests, workspace/project initialization, and context-sensitive operations with data-flow tracing and checkpoint mapping.

Why is single-point validation insufficient for robustness?

Single validation can be bypassed by different code paths or mocks. Defense-in-depth validation at every layer makes bugs impossible to introduce because invalid data must pass through all four checkpoints to cause a runtime failure.

How do I test layered validation to ensure no bypass between layers?

Design comprehensive tests that verify data cannot bypass validation across entry, business logic, environment, and debug layers. Map checkpoints along the data flow and trace execution paths to confirm no alternate route avoids validation enforcement.

What's the best way to implement validation for a new feature?

Add validations at entry points, business logic, environment guards, and debugging hooks. This makes failures hard to bypass by enforcing checks at every layer the data passes through, requiring comprehensive test coverage to confirm no validation gap exists.