defense-in-depth

Enforce five-layer data validation across API boundaries and processing checkpoints.

2|Updated Sep 30, 2025
One-click install
npx skills add https://github.com/krzemienski/shannon-framework --skill defense-in-depth-krzemienski
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defense-in-depth
Source: https://github.com/krzemienski/shannon-framework/tree/main/skills/defense-in-depth
Command: npx skills add https://github.com/krzemienski/shannon-framework --skill defense-in-depth-krzemienski

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defense-in-depth ensures data validity across multiple system layers by applying Shannon validation gates at each stage of data flow.

Core Features & Use Cases

  • Layered validation at entry, business logic, environment, and gates
  • Debug instrumentation for forensics
  • End-to-end safeguards against data corruption

Quick Start

Implement multi-layer validation for a critical feature, then measure gate pass rates.

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 data across multiple layers in my API?

Multi-layer validation checks data at entry points, business logic, environment guards, and critical checkpoints. Defense-in-depth applies validation gates sequentially across these layers to catch invalid data before it propagates, preventing bugs and data corruption throughout your system.

What's the best way to prevent invalid data from causing failures in production?

Implement validation gates at five functional levels: entry point intake, business logic processing, environment boundary guards, Shannon validation checkpoints, and debug instrumentation. Each layer independently verifies data integrity, ensuring failures are caught early and traced for forensics.

How do I set up structured failure handling for data validation?

Defense-in-depth enforces functional validation requirements with no-mocks policy, traceability logs, and structured failure responses at each gate. This approach creates end-to-end safeguards that document exactly where and why data failed validation across your system.

When should I apply validation gates across different parts of my system?

Validation gates belong at API boundaries where untrusted input enters, within business logic during processing, at environment transitions, and at critical checkpoints in data flows. Distributing validation across layers stops invalid data at the earliest detection point.

Can I measure whether my validation layers are working effectively?

Yes. Debug instrumentation captures validation outcomes at each gate, allowing you to measure pass rates and trace data flows end-to-end. This visibility reveals which gates are catching failures and where data corruption risks remain highest.

What's the difference between entry-point validation and business-logic validation?

Entry-point validation rejects malformed or unsafe input immediately at API boundaries. Business-logic validation enforces domain rules during processing. Both are necessary: entry validation stops obvious attacks; business validation catches semantic violations that pass syntactic checks.