This prompt is designed for security architects and platform engineers who need to evaluate whether a system design applies security controls at every layer—network, host, application, and data. The primary job-to-be-done is identifying single points of security failure where the compromise of one layer exposes the entire system. Use it during architecture review, threat modeling, or pre-deployment security gate checks when you have a concrete system design document, architecture diagram, or detailed component description as input. The prompt assumes you are working in the design phase, before implementation commits to a specific control topology, and that you need a structured control-gap matrix rather than a narrative opinion.
Prompt
Defense-in-Depth Architecture Review Prompt

When to Use This Prompt
Defines the ideal use case, required inputs, and boundaries for the defense-in-depth architecture review prompt.
The ideal input is a complete or near-complete design artifact that describes component interactions, data flows, trust boundaries, and existing security controls. This could be a formal architecture decision record, a cloud infrastructure diagram with accompanying notes, a service mesh configuration proposal, or a detailed system specification. The prompt works best when the input explicitly names technologies, protocols, and control mechanisms—for example, 'TLS 1.3 between service A and service B' rather than 'encrypted communication.' Vague inputs produce vague gap analyses. If your design document lacks this level of detail, run a design completeness review first or supplement the input with a component inventory before invoking this prompt.
Do not use this prompt for runtime incident response, code-level vulnerability scanning, or penetration test planning. It is not designed to analyze live systems, evaluate exploitability, or recommend specific vendor products. It also should not replace a formal threat model using STRIDE or attack trees, though it can serve as a precursor that identifies areas requiring deeper threat modeling. The output is a control-gap matrix—a structured artifact that maps layers to controls and flags gaps—not a risk rating or compliance report. If you need a risk register with likelihood and impact scores, pair this prompt with the Architecture Risk Assessment Prompt Template in the same content group.
Use Case Fit
Where the Defense-in-Depth Architecture Review Prompt delivers value and where it should be replaced with a different tool or human-led process.
Good Fit: Layered Control Validation
Use when: you have a complete system design document and need to verify that security controls exist at every layer—network, host, application, and data. Guardrail: The prompt works best when the design explicitly describes each tier. If the design is incomplete, the output will contain false negatives.
Bad Fit: Live Penetration Testing
Avoid when: you need to test a running system for exploitable vulnerabilities. Risk: This prompt reviews design documents, not live infrastructure. It cannot discover runtime misconfigurations, zero-days, or implementation bugs. Use a penetration testing tool or red-team exercise instead.
Required Input: Complete Architecture Artifact
What to watch: The prompt requires a detailed system design document including network diagrams, data flow descriptions, component responsibilities, and existing security controls. Guardrail: If the input is a rough sketch or verbal description, the control-gap matrix will be speculative. Gate the prompt on artifact completeness before execution.
Operational Risk: Single Points of Failure
What to watch: The prompt identifies where one compromised control exposes the entire system. Guardrail: Treat every identified single point of failure as a P0 architecture finding. Require a compensating control or redesign before the review is considered closed. Do not let the matrix become a checklist that is filed without action.
Boundary Risk: Compliance Scope Creep
Avoid when: you need a formal compliance audit against SOC 2, PCI DSS, or HIPAA. Risk: The prompt identifies control gaps but does not map them to specific regulatory control families or produce auditor-ready evidence. Use a compliance-specific review prompt or qualified human auditor for attestation.
Human-in-the-Loop: Compensating Control Design
What to watch: The prompt identifies missing controls but cannot design novel compensating controls for highly constrained environments. Guardrail: When the matrix flags a gap that cannot be closed with standard controls, escalate to a senior security architect. The prompt output is a starting point for human design work, not the final answer.
Copy-Ready Prompt Template
A copy-ready prompt template for conducting a defense-in-depth architecture review, ready to paste into your AI harness.
This prompt template is designed to be dropped directly into your AI orchestration layer. It instructs the model to act as a security architect and systematically evaluate a system design for layered controls across network, host, application, and data tiers. The output is a structured control-gap matrix that identifies single points of security failure and recommends compensating controls.
textYou are a principal security architect conducting a defense-in-depth review of the following system design. Your task is to evaluate whether security controls are layered across four tiers: Network, Host, Application, and Data. For each tier, identify existing controls, missing controls, and any single points of security failure where one compromised control exposes the entire tier. ## INPUT System Design Document: [SYSTEM_DESIGN] Data Classification: [DATA_CLASSIFICATION] Compliance Requirements (if any): [COMPLIANCE_REQUIREMENTS] Threat Model Summary (if available): [THREAT_MODEL] ## OUTPUT SCHEMA Return a JSON object with the following structure: { "review_summary": "string (executive summary of findings)", "control_matrix": [ { "tier": "Network | Host | Application | Data", "existing_controls": ["string"], "missing_controls": ["string"], "single_points_of_failure": [ { "control": "string (the control that, if bypassed, exposes the tier)", "failure_scenario": "string (what happens when it fails)", "blast_radius": "string (scope of impact)", "severity": "Critical | High | Medium | Low" } ], "compensating_control_recommendations": ["string"] } ], "cross_tier_analysis": { "defense_gaps": ["string (gaps that span multiple tiers)"], "overlapping_controls": ["string (controls that redundantly protect the same asset)"], "assumption_violations": ["string (implicit trust assumptions that break layered defense)"] }, "prioritized_remediation_plan": [ { "priority": 1, "finding": "string", "rationale": "string", "effort_estimate": "Low | Medium | High" } ] } ## CONSTRAINTS - Do not invent controls that are not described in the system design. Mark missing controls explicitly. - If the system design lacks detail for a tier, note it as "Insufficient information to assess" rather than assuming controls exist. - For each single point of failure, explain why it is a single point and what compensating controls could reduce the risk. - Flag any control that relies on a shared mechanism (e.g., a single identity provider, a single firewall rule set) as a potential single point of failure. - If compliance requirements are provided, map missing controls to specific compliance gaps. - Do not recommend specific vendor products. Recommend control types and patterns. ## RISK_LEVEL [RISK_LEVEL] ## EXAMPLES [EXAMPLES]
To adapt this template, replace each square-bracket placeholder with your system's specific details. The [SYSTEM_DESCRIPTION] should include architecture diagrams, component descriptions, data flow narratives, or infrastructure-as-code excerpts. The [DATA_CLASSIFICATION] field should specify the sensitivity levels of data flowing through the system (e.g., PII, PCI, PHI, internal, public). If you have a formal threat model, include it in [THREAT_MODEL] to ground the review in known threats. The [RISK_LEVEL] field should be set to Critical, High, Medium, or Low to calibrate the depth and urgency of the analysis. The [EXAMPLES] field can contain one or two example control-gap entries to demonstrate the expected format and level of detail. Before deploying this prompt in a production review pipeline, validate the output against the schema using a JSON validator, and ensure a human security architect reviews the findings before they become the basis for remediation work. For regulated environments, always require human sign-off on the final control-gap matrix.
Prompt Variables
Each placeholder must be populated for the prompt to produce a reliable control-gap matrix.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SYSTEM_ARCHITECTURE_DOC] | Full text of the system design document, architecture diagram descriptions, or infrastructure-as-code specs to review | A markdown ADR describing a microservices deployment on AWS EKS with an API Gateway, service mesh, and RDS backend | Must be non-empty string. Minimum 200 characters to ensure sufficient context. Reject if only a URL or file path is provided. |
[SECURITY_TIER_DEFINITIONS] | Explicit list of the security tiers to evaluate against, overriding the default network/host/app/data model if needed | Network Perimeter, Compute Layer, Orchestration Plane, Application Runtime, Data Store, Identity Boundary | Must be a valid JSON array of strings. If null, the default four-tier model is used. Each tier name must be unique. |
[COMPLIANCE_STANDARDS] | Specific regulatory or compliance frameworks to map controls against during the gap analysis | ["PCI-DSS 4.0", "SOC 2 Type II", "HIPAA Security Rule"] | Must be a valid JSON array of strings. If empty array, compliance mapping is skipped. Warn if a standard name is unrecognized. |
[THREAT_MODEL_CONTEXT] | Known threats, prior penetration test findings, or organizational risk priorities to weight during the review | Insider threat from compromised CI/CD pipeline; Previous finding: overly permissive security group rules in staging | Optional string. If provided, the model must reference these threats explicitly in the output. Null allowed. |
[OUTPUT_SCHEMA] | The exact JSON schema the control-gap matrix must conform to, including required fields for each finding | See playbook output-contract table for the full schema definition | Must be a valid JSON Schema object. Validate with a schema validator before passing to the model. Reject if missing required 'findings' array. |
[CONSTRAINTS] | Hard boundaries on the review scope, such as excluded components, assumed controls, or depth limits | Exclude CI/CD pipeline from scope; Assume all data-at-rest is encrypted with AES-256; Maximum 3 findings per tier | Must be a valid JSON object with keys like 'excluded_components', 'assumed_controls', 'max_findings_per_tier'. Validate key presence. |
[EVIDENCE_REQUIREMENT_LEVEL] | Controls whether the model must cite exact source passages, summarize evidence, or state assumptions | exact-citation | Must be one of: 'exact-citation', 'summary', 'assumption-allowed'. Default to 'exact-citation' for audit use cases. Reject invalid values. |
Implementation Harness Notes
How to wire the Defense-in-Depth Architecture Review Prompt into a security review pipeline or architecture governance workflow.
This prompt is designed to be a gate in a formal architecture review process, not a standalone chat interaction. The implementation harness must enforce structured input, validate the output schema, and route findings to the correct downstream systems. The prompt expects a system design document as [DESIGN_DOC] and a list of expected controls as [CONTROL_CATALOG]. The harness is responsible for assembling these inputs, invoking the model, and ensuring the resulting control-gap matrix is machine-readable before it enters any ticketing or risk register system.
Start by building a pre-processing step that validates the [DESIGN_DOC] input. Reject submissions that are under 500 words, lack a clear system boundary description, or contain no mention of data flow. For the [CONTROL_CATALOG], maintain a canonical list of expected controls per tier (network, host, application, data) in a JSON file that is versioned alongside the prompt. At invocation time, inject this catalog into the prompt's [CONTROL_CATALOG] placeholder. Use a model with strong JSON mode and low temperature (0.1–0.2) to minimize structural drift. After the model returns the output, run a strict schema validator against the expected control_gap_matrix structure: it must be a JSON array of objects, each containing tier, control_id, control_name, status (one of present, missing, partial), evidence_from_design, gap_description, and compensating_controls. Any output that fails this validation should trigger a single retry with the validation error message appended to the prompt as a correction instruction. If the retry also fails, log the raw output and escalate to a human reviewer via the architecture review queue.
For production integration, wrap the prompt invocation in a function that can be called from your architecture governance platform (e.g., a CI/CD pipeline for design docs, a Confluence plugin, or a custom review portal). Log every invocation with a unique review_id, the prompt version, model version, input hashes, and the validated output. This audit trail is critical for demonstrating review coverage to compliance teams. Route missing and partial findings to your risk register or backlog system as actionable tickets, tagging them with the review_id for traceability. Do not auto-close findings without a subsequent design update and re-review. The harness should also compare new review results against previous reviews of the same system to detect regressions—a control that was present in a prior review and is now missing is a high-priority alert. Avoid the temptation to let the model propose remediation designs directly; its job is to identify gaps against the control catalog, while remediation design remains a human architect's responsibility with the model used in a separate, scoped design-review prompt.
Expected Output Contract
Fields, data types, and validation rules for the JSON response from the Defense-in-Depth Architecture Review Prompt. Use this contract to validate the model's output before integrating it into downstream systems or reports.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
review_id | string (UUID v4) | Must parse as a valid UUID v4. Reject if missing or malformed. | |
review_timestamp | string (ISO 8601) | Must parse as a valid ISO 8601 datetime string. Reject if in the future or unparseable. | |
control_layers | array of objects | Must be a non-empty array. Each object must contain 'layer_name' (string), 'controls' (array of strings), and 'coverage_assessment' (string). | |
control_gap_matrix | array of objects | Must be an array. Each object requires 'threat_category' (string), 'affected_layers' (array of strings), 'single_point_of_failure' (boolean), and 'compensating_controls' (array of strings). | |
single_points_of_failure | array of objects | Must be an array. Each object requires 'vulnerability' (string), 'layer' (string), 'impact' (string), and 'recommended_mitigation' (string). | |
overall_risk_rating | string | Must be one of the enum values: 'Critical', 'High', 'Medium', 'Low', 'Informational'. Reject any other value. | |
executive_summary | string | Must be a non-empty string between 50 and 500 characters. Reject if outside this length constraint. | |
review_methodology | string | If present, must be a non-empty string. Null is allowed. If provided, check for placeholder text like 'lorem ipsum' and reject. |
Common Failure Modes
What breaks first when this prompt runs in production and how to guard against it.
False Negatives in Control Gaps
What to watch: The model misses a missing control layer because the design document implies coverage without stating it explicitly. The prompt assumes absence of evidence is evidence of absence. Guardrail: Add a pre-processing step that extracts explicit control statements per layer before gap analysis. Require the model to flag 'implied but not documented' controls separately.
Over-Indexing on Named Patterns
What to watch: The model flags missing controls because it expects specific named patterns (e.g., 'AWS WAF') and ignores equivalent compensating controls described differently (e.g., 'custom request validation service'). Guardrail: Include a compensating-control mapping table in the prompt context. Instruct the model to match on capability, not product name.
Layer Confusion in Complex Topologies
What to watch: The model misclassifies controls across network, host, application, and data layers when services span boundaries (e.g., a sidecar proxy handling both network policy and application auth). Guardrail: Require the output to cite the specific evidence from the design doc for each layer assignment. Add a validation pass that checks for controls assigned to multiple layers without justification.
Single-Point-of-Failure Blindness
What to watch: The model identifies layered controls but fails to recognize that multiple layers depend on a single compromised component (e.g., one identity provider for both network and application auth). Guardrail: Add an explicit 'blast-radius analysis' step to the prompt. Require the output matrix to include a column for shared dependencies across layers.
Context Window Truncation on Large Designs
What to watch: For complex architectures, the design document exceeds the context window, causing the model to analyze an incomplete view and miss gaps in truncated sections. Guardrail: Chunk the design document by trust boundary or service. Run the prompt per-chunk and then run a synthesis pass that cross-references gap reports for consistency.
Hallucinated Control Recommendations
What to watch: The model confidently recommends a control that doesn't exist in the target environment or violates a documented constraint (e.g., suggesting a cloud-native service for an on-premises requirement). Guardrail: Constrain recommendations with an allowed-controls catalog and environment constraints block in the prompt. Add a post-generation validation step that checks every recommendation against the catalog.
Evaluation Rubric
Criteria for testing output quality before shipping the Defense-in-Depth Architecture Review Prompt into a production review pipeline. Each criterion maps to a specific failure mode of security architecture analysis.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Control Layer Coverage | Output identifies controls across all four layers: network, host, application, and data. No layer is omitted or summarized as 'covered by other controls'. | One or more layers missing from the control-gap matrix. Output states 'no controls at this layer' without evidence of review. | Parse output JSON. Assert that keys for network, host, application, and data layers are present and each contains at least one control or explicit 'none identified' entry with rationale. |
Single Point of Failure Identification | Output explicitly lists controls that, if bypassed or misconfigured, would leave an asset unprotected. Each SPOF includes the asset, the control, and the consequence of failure. | Output lists only generic risks without naming specific controls. SPOF analysis confuses layered controls with redundant controls. | Extract SPOF array from output. Assert each entry has non-empty asset, control, and consequence fields. Verify at least one SPOF is identified per layer unless the layer has zero controls. |
Compensating Control Mapping | For each identified control gap, output proposes at least one compensating control at an adjacent layer, or explicitly states that no compensating control exists. | Output identifies gaps but provides no compensating controls. Compensating controls are proposed at the same layer as the gap, defeating the defense-in-depth purpose. | For each gap in the control-gap matrix, assert that a compensating control field is present and references a different layer than the gap. Accept explicit 'none available' with justification. |
Threat-to-Control Traceability | Output maps each identified threat to at least one existing or proposed control. Threats without any control coverage are flagged as unmitigated. | Threats listed without control mapping. Controls listed without corresponding threats. Output reads as two disconnected lists. | Parse threat and control arrays. Assert that every threat has a controls field with at least one entry or an unmitigated flag set to true. Verify no orphan controls exist without threat references. |
Severity and Likelihood Scoring Consistency | Output assigns severity and likelihood ratings to gaps using a defined scale. Ratings are consistent: similar gaps receive similar scores. Rationale is provided for high-severity findings. | Scores are arbitrary, missing, or inconsistent. A missing network ACL and a missing WAF receive wildly different severity ratings without explanation. | Extract all gap severity scores. Assert they fall within the defined scale range. Spot-check two similar gaps for score consistency. Verify high-severity gaps include a rationale field. |
Remediation Prioritization | Output orders gaps by risk, not by layer or discovery order. Highest-risk gaps appear first with clear justification for the ordering. | Output lists gaps in document-order or layer-order without risk-based sorting. Critical gaps buried below informational findings. | Parse gap array. Assert that severity and likelihood fields are present. Verify that the array is sorted by a composite risk score or that a priority field exists and is non-decreasing in severity. |
Evidence Grounding | Every control assessment and gap finding references specific evidence from the input design document: a diagram label, a config snippet, a policy statement, or a documented absence. | Output makes assertions about controls without citing where in the design document the evidence was found. Findings read as generic security advice. | For each control and gap entry, assert that an evidence field is present and non-empty. Evidence must reference a document section, diagram element, or explicit 'not found in provided design' statement. |
Abstention on Insufficient Input | When the input design document lacks enough detail to assess a layer or control area, output explicitly flags the assessment as incomplete and lists the specific information needed to complete it. | Output fabricates control assessments for undocumented areas. Output confidently states 'no controls exist' when the design document simply omitted that layer. | Provide a deliberately incomplete design document as a test case. Assert that output contains at least one incomplete flag with a required-information field listing specific missing details. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single architecture document and lighter validation. Drop the control-gap matrix requirement and ask for a narrative list of missing layers instead. Accept plain-text output without strict schema enforcement.
codeReview [ARCHITECTURE_DOC] for defense-in-depth gaps. List any single points of security failure you find. Group findings by tier: network, host, application, data.
Watch for
- Missing schema checks on output structure
- Overly broad instructions that produce vague "add more controls" advice
- No compensating control identification when a primary control is absent

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us