Inferensys

Prompt

Network Segmentation Analysis Prompt for Architects

A practical prompt playbook for using Network Segmentation Analysis Prompt for Architects in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the job-to-be-done, the ideal user, and the design-review context where this prompt adds value before infrastructure hits production.

Infrastructure architects and security engineers use this prompt during design review gates to audit network segmentation before deployment. The prompt takes a description of VPCs, subnets, security groups, NACLs, and firewall rules—whether from a design document, a diagram described in text, or an infrastructure-as-code plan—and produces a structured segmentation audit. The audit identifies overly permissive rules, missing isolation between tiers, and blast-radius risks that violate least-privilege network access. This is a reasoning prompt, not a runtime configuration scanner. It works on design intent, not live state.

Use this prompt before Terraform apply, as part of a security architecture review board, or when evaluating a proposed network change. The prompt expects a detailed textual description of the network design, including CIDR ranges, security group rules, NACL entries, routing tables, and the intended communication paths between application tiers. It does not replace a cloud security posture management tool or a runtime policy engine. Instead, it helps architects catch design-level segmentation flaws—such as a database subnet that accepts traffic from a public load balancer or a management plane that trusts all VPC CIDRs—before those flaws become deployed infrastructure.

Do not use this prompt for real-time configuration auditing, compliance scanning, or incident response. It is not designed to parse live AWS Config output, CloudTrail logs, or firewall flow logs. The prompt reasons over the design as described; if the description is incomplete or inaccurate, the audit will be incomplete or inaccurate. Human review is required for every finding before it becomes a remediation ticket. The prompt can surface risks and suggest hardening steps, but an architect must validate each finding against the actual design intent, business requirements, and operational constraints. When the design is complex, break it into smaller scoped reviews—one per trust zone or one per application tier—to keep the analysis focused and actionable.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to decide if the Network Segmentation Analysis Prompt is the right tool for your current review.

01

Good Fit: Design Document Review

Use when: You have a concrete network design document, Terraform plan, or architecture diagram describing VPCs, subnets, security groups, and firewall rules. Guardrail: The prompt requires structured input—ad-hoc verbal descriptions produce unreliable results. Attach the actual design artifact.

02

Bad Fit: Live Network Scanning

Avoid when: You need real-time analysis of running network configurations or active traffic flows. Guardrail: This prompt analyzes documented designs, not live environments. Pair with infrastructure-as-code scanning tools for runtime validation.

03

Required Inputs

What you need: A network topology description including CIDR ranges, security group rules, routing tables, and intended traffic flows. Guardrail: Missing inputs cause hallucinated rules. Validate that all required sections are present before running the prompt.

04

Operational Risk: Overly Permissive Defaults

What to watch: The model may flag legitimate broad rules as violations without understanding operational context. Guardrail: Always have a human architect review findings before acting. The prompt identifies candidates for review, not definitive violations.

05

Operational Risk: Missing Implicit Trust Zones

What to watch: Designs often assume trust between services in the same VPC without documenting it. The prompt may miss these implicit trust relationships. Guardrail: Explicitly document all trust assumptions in the input. If absent, flag them as review gaps.

06

Scale Limit: Complex Multi-Cloud Topologies

What to watch: Very large designs spanning multiple cloud providers and hundreds of rules may exceed context windows or produce incomplete analysis. Guardrail: Break large designs into bounded segments (by environment, region, or trust zone) and analyze each independently.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders for conducting a structured network segmentation analysis from architecture documents.

This prompt template is designed to be pasted directly into your AI harness or orchestration layer. It accepts a system architecture description and a set of constraints, then produces a structured segmentation audit. Every placeholder is enclosed in square brackets. Replace each one with real design data before execution. The prompt instructs the model to act as an infrastructure security architect, systematically evaluating isolation, rule scoping, and blast-radius risks against a least-privilege network access standard.

text
You are an infrastructure security architect reviewing a network segmentation design. Your task is to produce a structured audit that identifies overly permissive rules, missing isolation boundaries, and blast-radius risks. Ground every finding in the provided design description. Do not invent components, CIDR ranges, or rules that are not present in the input.

## INPUT DESIGN
[DESIGN_DESCRIPTION]

## CONSTRAINTS
- Compliance framework: [COMPLIANCE_STANDARD]
- Trust zone definitions: [TRUST_ZONE_MAP]
- Data classification levels in scope: [DATA_CLASSIFICATIONS]
- Maximum acceptable blast radius (number of systems per segment): [BLAST_RADIUS_LIMIT]

## OUTPUT SCHEMA
Return a single JSON object with the following structure:
{
  "summary": "<One-paragraph executive summary of segmentation posture>",
  "findings": [
    {
      "id": "<F-001, F-002, ...>",
      "severity": "<CRITICAL | HIGH | MEDIUM | LOW>",
      "category": "<OVERLY_PERMISSIVE_RULE | MISSING_ISOLATION | BLAST_RADIUS | TRUST_ZONE_VIOLATION | COMPLIANCE_GAP>",
      "source_component": "<Component or CIDR from the design>",
      "destination_component": "<Component or CIDR from the design>",
      "rule_or_boundary": "<Specific rule, security group, firewall entry, or subnet boundary>",
      "finding": "<Clear description of the issue>",
      "risk": "<What an attacker or failure could achieve>",
      "recommendation": "<Specific, actionable remediation step>",
      "least_privilege_alternative": "<The minimum required access if the rule cannot be removed>"
    }
  ],
  "trust_zone_boundary_assessment": [
    {
      "zone_pair": "<Source Zone> -> <Destination Zone>",
      "intended_isolation": "<YES | NO>",
      "actual_isolation": "<YES | NO | PARTIAL>",
      "violations": ["<List of rule IDs or descriptions that breach this boundary>"]
    }
  ],
  "blast_radius_analysis": [
    {
      "segment": "<Segment name or CIDR>",
      "reachable_systems_count": <integer>,
      "exceeds_limit": <true | false>,
      "lateral_movement_paths": ["<Description of paths an attacker could take from this segment>"]
    }
  ],
  "compliance_gaps": [
    {
      "requirement": "<Specific control requirement from the compliance framework>",
      "status": "<MET | PARTIALLY_MET | NOT_MET>",
      "evidence": "<What in the design supports or contradicts compliance>"
    }
  ],
  "overall_risk_rating": "<CRITICAL | HIGH | MEDIUM | LOW>",
  "top_priority_actions": ["<Ordered list of the 3-5 most important remediations>"]
}

## RULES
1. Every finding must reference a specific component, rule, or boundary from [DESIGN_DESCRIPTION].
2. If a trust zone boundary is not defined in [TRUST_ZONE_MAP], flag it as a MISSING_ISOLATION finding.
3. For any rule that allows access broader than a single port and source, classify it as OVERLY_PERMISSIVE_RULE.
4. If the design does not contain enough information to assess a category, set its array to empty and note the gap in the summary.
5. Do not recommend removing a rule without providing a least_privilege_alternative.
6. If [COMPLIANCE_STANDARD] is provided, map every compliance_gap to a specific control ID or requirement text.

After pasting this template, replace each placeholder with concrete data from your architecture review. The [DESIGN_DESCRIPTION] should include VPC layouts, subnet CIDRs, security group rules, firewall policies, NACLs, and any peering or transit gateway configurations. The [TRUST_ZONE_MAP] must explicitly label which subnets or CIDRs belong to which trust tier (e.g., public, DMZ, application, data, management). If your compliance framework does not apply, set [COMPLIANCE_STANDARD] to "none" and the model will skip compliance-gap analysis. Always run the output through a JSON schema validator before ingesting it into your downstream systems. For high-risk production environments, route CRITICAL and HIGH severity findings to a human security architect for review before accepting remediation recommendations.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Network Segmentation Analysis Prompt. Each variable must be populated before execution to ensure a reliable, least-privilege audit.

PlaceholderPurposeExampleValidation Notes

[NETWORK_DESIGN_DOC]

Full text of the VPC, subnet, security group, and firewall design to be audited.

VPC 'prod-us-east' with subnets: public-dmz (10.1.0.0/24), private-app (10.1.1.0/24), private-data (10.1.2.0/24). Security groups: sg-web (inbound 443 from 0.0.0.0/0), sg-app (inbound 8080 from sg-web), sg-db (inbound 5432 from sg-app).

Must contain non-empty text. Parse check for IP ranges, CIDR blocks, or security group identifiers. Reject if only natural language without network identifiers.

[SEGMENTATION_STANDARD]

The reference framework or policy against which the design is evaluated.

NIST SP 800-53 AC-4, PCI DSS 1.2-1.3, or internal zero-trust policy v2.1.

Must be a non-empty string. If null, default to 'least-privilege and zero-trust principles'. Validate against known standard list if available.

[COMPLIANCE_CONTEXT]

Specific regulatory or audit requirements that constrain segmentation decisions.

PCI DSS 4.0 requires CDE isolation; HIPAA requires technical safeguards for ePHI data flows.

Null allowed if no specific compliance regime applies. If provided, must be a non-empty string. Schema check for known compliance tags.

[BLAST_RADIUS_CONCERN]

The specific asset or data class whose compromise impact must be minimized.

Payment processing service, customer PII database, or CI/CD pipeline secrets.

Must be a non-empty string. If null, default to 'all critical data stores and control planes'. Validate that the concern maps to at least one asset in [NETWORK_DESIGN_DOC].

[OUTPUT_FORMAT]

Desired structure for the audit report.

JSON with 'findings' array, 'risk_level' enum, and 'remediation' text; or Markdown report with executive summary.

Must be one of: 'json', 'markdown', 'text'. Default to 'json' if not specified. Enum check required.

[SEVERITY_THRESHOLD]

Minimum severity level to include in the report.

HIGH, MEDIUM, or LOW.

Must be one of: 'CRITICAL', 'HIGH', 'MEDIUM', 'LOW'. Default to 'MEDIUM'. Enum check required. Findings below threshold are suppressed.

[ALLOWED_PROTOCOLS]

List of permitted protocols and ports for the environment.

TCP:443, TCP:8080, TCP:5432; UDP:53.

Must be a parseable list of protocol:port pairs. If null, evaluate against standard best practices. Schema check for valid protocol names and port ranges.

[EXISTING_CONTROLS]

Description of compensating controls already in place.

AWS WAF on public subnets, GuardDuty enabled, VPC Flow Logs to SIEM.

Null allowed. If provided, must be a non-empty string. Used to avoid flagging risks already mitigated by documented controls.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Network Segmentation Analysis Prompt into an automated architecture review pipeline with validation, retries, and human approval gates.

This prompt is designed to operate as a stateless analysis step within a broader security review workflow. It expects a structured architectural description as input and returns a structured audit report. The implementation harness must enforce input schema validation before the prompt is called, validate the output schema after the model responds, and route findings to the appropriate review queue based on severity. Because network segmentation errors can create direct paths to production data, the harness should never automatically apply remediation suggestions—only flag them for human review.

Input Validation: Before calling the model, validate that the [NETWORK_DESIGN] input conforms to a minimum schema. At a minimum, require a list of security groups or firewall rules with source, destination, port, and protocol fields. Reject inputs that are purely narrative without structured rule data. Model Selection: Use a model with strong reasoning capabilities and large context windows (e.g., Claude 3.5 Sonnet, GPT-4o) because the analysis requires holding many rules in memory and reasoning about transitive access paths. Avoid smaller or older models that will hallucinate rule relationships. Output Validation: Parse the model's JSON output and validate that every finding includes a rule_reference field that maps back to a specific input rule. If a finding lacks a source reference, discard it or flag it for human review as ungrounded. Retry Logic: If the model returns malformed JSON, retry once with a simplified instruction that asks for valid JSON only. If the second attempt fails, log the raw output and escalate to a human reviewer rather than retrying indefinitely.

Tool Integration: For production use, wire this prompt into a pipeline that first extracts network rules from infrastructure-as-code (Terraform, CloudFormation, Pulumi) or cloud API exports. Do not rely on architects manually typing rules into the prompt. A pre-processing step should normalize rule formats into the expected [NETWORK_DESIGN] schema. Logging and Audit Trail: Log every prompt invocation with the input hash, model version, output hash, and reviewer decision. This creates an audit trail for compliance reviews and allows regression testing when the prompt or model changes. Human Approval Gate: Route findings with severity: critical or blast_radius: high to a mandatory human review queue. Findings with severity: low and a clear remediation suggestion can be auto-filed as tickets. Never auto-close findings without human acknowledgment. Eval Harness: Before deploying a new prompt version, run it against a golden dataset of known network designs with labeled vulnerabilities. Measure precision (did it flag real issues?), recall (did it miss known issues?), and hallucination rate (did it invent rules not present in the input?). Gate deployment on recall >= 0.90 and hallucination rate <= 0.05.

IMPLEMENTATION TABLE

Expected Output Contract

Define the exact fields, types, and validation rules your application should expect from the Network Segmentation Analysis prompt. Use this contract to build a parser, validator, or retry loop before the output reaches a downstream system or human reviewer.

Field or ElementType or FormatRequiredValidation Rule

segmentation_audit_id

string (UUID v4)

Must parse as a valid UUID v4. Reject if missing or malformed.

analysis_timestamp

string (ISO 8601)

Must parse as a valid ISO 8601 datetime string. Reject if in the future.

overall_risk_rating

string (enum)

Must be one of: 'critical', 'high', 'medium', 'low', 'informational'. Case-sensitive.

findings

array of objects

Must be a non-empty array. Reject if null, empty, or not an array.

findings[].rule_id

string

Must match the pattern 'NET-SEG-\d{3}'. Reject if missing or pattern mismatch.

findings[].severity

string (enum)

Must be one of: 'critical', 'high', 'medium', 'low'. Case-sensitive.

findings[].affected_resource

string (CIDR or ARN)

Must be a valid CIDR block or AWS ARN. Reject if format is unrecognizable.

findings[].blast_radius_description

string

Must be a non-empty string with at least 20 characters. Reject if null or too short.

PRACTICAL GUARDRAILS

Common Failure Modes

Network segmentation prompts fail in predictable ways. Here are the most common failure modes and how to guard against them before they reach production.

01

Hallucinated CIDR Ranges and Subnets

What to watch: The model invents plausible-looking IP ranges, subnet masks, or CIDR blocks that don't exist in your actual infrastructure. This happens when the prompt lacks explicit network topology data or when the model fills gaps with syntactically correct but fictional addresses. Guardrail: Always provide a structured inventory of actual VPCs, subnets, and CIDR allocations as input. Add an eval check that verifies every CIDR mentioned in the output exists in the source inventory. Flag any address not present in the input for human review.

02

Overly Permissive Rule Acceptance

What to watch: The model treats broad rules like 0.0.0.0/0 or wide port ranges as acceptable without flagging them as violations of least-privilege principles. This is especially dangerous when the prompt doesn't explicitly define what constitutes an overly permissive rule. Guardrail: Include explicit thresholds in the prompt for what counts as overly permissive (e.g., any rule with /0 destination, any port range wider than 100 ports, any rule allowing all protocols). Add a post-processing validator that rejects outputs where critical findings are missing when broad rules are present in the input.

03

Missing Cross-Account or Cross-VPC Blast Radius Analysis

What to watch: The model analyzes segmentation within a single VPC or account but fails to identify lateral movement paths across peered VPCs, transit gateways, or shared services. The output looks thorough but misses the most dangerous attack paths. Guardrail: Structure the prompt to require explicit enumeration of all peering connections, transit gateway attachments, and cross-account trust relationships before analysis begins. Include an eval criterion that checks whether every peering link in the input appears in the blast-radius section of the output.

04

Security Group Rule Ordering and Shadowing Confusion

What to watch: The model misunderstands how security group rules interact—especially when deny rules shadow allow rules, or when rule ordering changes effective policy. This produces incorrect assessments of what traffic is actually permitted. Guardrail: Include a constraint in the prompt that requires the model to evaluate the effective policy after all rule ordering and shadowing is resolved, not just list individual rules. Add a test case with known shadowed rules to verify the model correctly identifies the effective allow/deny outcome before trusting production outputs.

05

Ignoring Egress and Outbound Traffic Risks

What to watch: The model focuses exclusively on inbound rules and neglects egress analysis—missing data exfiltration paths, command-and-control channels, and unauthorized outbound connections that bypass network controls. Guardrail: Require the prompt to produce separate inbound and outbound analysis sections with equal depth. Add an eval check that counts egress findings and flags outputs where outbound analysis is fewer than 20% of total findings. Include explicit egress risk categories in the output schema.

06

Protocol-Level Blind Spots in Layer 4 Analysis

What to watch: The model treats all TCP traffic as equivalent without considering application-layer protocols. It may flag port 443 as secure without noting that HTTPS can carry API calls, file transfers, or tunneling traffic that violates segmentation intent. Guardrail: Include protocol context in the input data (e.g., what services run on each port, what data they expose). Add a prompt instruction to evaluate segmentation at both Layer 4 and Layer 7 where protocol context is available. Flag outputs that make security judgments based solely on port numbers without protocol context.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the quality of a network segmentation analysis output before it is accepted or shipped. Use these checks in an automated eval harness or manual review gate.

CriterionPass StandardFailure SignalTest Method

Rule-to-Service Mapping Completeness

Every security group, firewall rule, or ACL referenced in the input is accounted for in the analysis output

Output references a rule ID or service not present in the input; rule count in output is less than input count

Parse output JSON; extract all rule IDs; compare set against input rule IDs; assert set equality

Overly Permissive Rule Detection

At least one rule with 0.0.0.0/0 source and non-standard port is flagged as HIGH risk with a specific remediation suggestion

No 0.0.0.0/0 rules are flagged or all are dismissed as acceptable without justification

Regex scan output for '0.0.0.0/0' and check that each occurrence has an associated risk rating of HIGH or CRITICAL

Blast-Radius Analysis Present

Output includes a blast-radius section that identifies at least one tier boundary and quantifies the number of services reachable if that boundary is breached

Blast-radius section is missing, empty, or contains only qualitative statements without service counts

Check for 'blast_radius' key in output JSON; assert it contains a non-empty array with 'boundary' and 'reachable_service_count' fields

Least-Privilege Violation Identification

Output flags at least one rule where the port range or protocol is broader than required by the documented service communication pattern

All rules are marked as compliant without analysis of port specificity; output claims 'all rules follow least privilege' when broad port ranges exist

Parse output for 'least_privilege_violations' array; assert length > 0 if input contains rules with port ranges wider than a single port or sequential pair

Missing Isolation Detection

Output identifies any tier or environment that lacks explicit deny rules or segmentation controls between it and other tiers

Output states 'no missing isolation found' when input contains flat network designs with no tier separation

Check for 'missing_isolation' key; assert it contains entries if input has fewer than 2 distinct security groups or subnet tiers

Remediation Priority Ordering

Findings are ordered by risk severity (CRITICAL > HIGH > MEDIUM > LOW) with CRITICAL findings listed first

Findings appear in arbitrary order; a LOW finding appears before a CRITICAL finding

Extract finding list from output; verify severity values are in non-increasing order (CRITICAL=4, HIGH=3, MEDIUM=2, LOW=1)

Actionable Remediation Text

Each finding includes a specific remediation step referencing the exact rule ID, port, and protocol to modify

Remediation text is generic (e.g., 'restrict access') without referencing specific rule identifiers or configuration changes

For each finding, assert 'remediation' field contains a rule ID or resource name from the input and a specific port or CIDR change

No Hallucinated Resources

Output does not reference any security group, VPC, subnet, or rule ID that was not present in the input

Output mentions a resource name or ID not found in the input document

Extract all resource identifiers from output; diff against input resource identifiers; assert diff is empty

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single VPC or subnet design document. Use plain-text input without strict schema enforcement. Focus on getting a readable audit narrative before adding structured output requirements.

Replace the [OUTPUT_SCHEMA] placeholder with a simple markdown structure:

code
## Findings
- [Finding 1]
- [Finding 2]

## Risk Summary
[Paragraph]

Watch for

  • The model may produce vague findings like "review security groups" without specifying which rules are problematic
  • Missing CIDR range or port number specifics in the output
  • Overly broad recommendations that don't reference the actual design document
Prasad Kumkar

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.