Skip to navigation

Claude Code NetworkPolicy: Blast Radius Reviews

In short: Check CNI enforcement, additive allow rules and both traffic directions before Claude Code changes Kubernetes network policy.

Published 16 min read
On this page

Direct answer and practical verdict

Review a NetworkPolicy change by three questions before it reaches the cluster: whether the cluster actually enforces policies, which pods the selectors pull in, and how the change interacts with both ingress and egress. Official (F016): creating a NetworkPolicy has no effect unless a networking solution supports enforcement, so the manifest alone proves nothing about traffic behavior. The win is a review that catches a policy that looks correct on disk and still does nothing at runtime. The loss is that blast radius is an estimate, not a measured result, until you observe real traffic in the cluster. Do not treat a green kubectl apply as evidence that the policy changed anything.

Evidence map connecting Kubernetes selectors, NetworkPolicy allow rules, and the CNI enforcement layer
Editorial evidence map based on official Kubernetes NetworkPolicy facts F016 through F018. It separates what the manifest declares from what the cluster actually enforces.

Why NetworkPolicy changes reach further than they look

A NetworkPolicy is a Kubernetes resource, and a small edit to a selector or an allow rule can change traffic for every pod that matches it. The blast radius question is not only whether the policy is correct. It is how many workloads the change touches and which of them stop talking to each other when it applies.

The practical cost of skipping this review is a silent outage. A policy that selects the wrong pods, or that assumes enforcement the cluster does not provide, can pass review and still break a dependency. The failure surfaces later as a connectivity incident, and the on-call has to reconstruct which change caused it. Reviewing the blast radius before apply is cheaper than diagnosing it after.

The review is also cheap relative to the change it protects. Reading the selectors against live labels, checking both traffic directions, and confirming enforcement is an hour of work in most cases. A connectivity incident caused by a mis-scoped policy is a different order of magnitude, because it reaches every pod the selector touched and often surfaces outside the team that made the change.

This article frames the review as a set of checks an engineer can run and record. Claude Code can draft the manifest, propose the selectors, and summarize the diff. The engineer owns the decision about what the change permits and which pods it reaches.

Where the review sits in the change process

A NetworkPolicy review is a pre-apply gate, and its value depends on where it runs. A review that happens after the change is merged is a diagnosis. A review that happens before apply, on the proposed bytes, is a control. The difference is the same one that separates a plan review from a post-incident read of a diff.

Claude Code can draft the manifest and assemble the evidence packet, but the reviewer decides whether the blast radius is acceptable. That split matters because a policy that permits the right traffic for one team can isolate a second team in the same namespace. The change process needs to route the review to whoever owns the affected services, not just to whoever wrote the policy.

The review also has a natural stop condition. When the selectors match only pods the change owns, when both directions are checked, and when enforcement is confirmed, the review is done. Widening the analysis past those checks produces diminishing returns. Narrowing the change when the estimate is uncertain is the better move.

NetworkPolicy enforcement prerequisites

Official (F016): NetworkPolicy enforcement requires a networking solution that supports it. A cluster that runs a plugin without policy support will accept the resource and do nothing with it. The manifest is then a document, not a control.

Record the enforcement evidence from the cluster and the CNI, not from the YAML. A check that only reads the manifest cannot tell you whether the policy is live. The table below keeps enforcement evidence and residual risk separate.

CNI capability Enforcement evidence to record Residual risk
Policy support present Cluster and CNI version confirmed by an admin Plugin-specific behavior differences remain
Policy support absent No enforcing controller found Policy is inert; traffic unaffected
Support unknown Nothing recorded yet Cannot claim the policy does anything

A policy that is inert is not harmless by default. It creates a false sense of control for whoever reads the repo later. Recording the enforcement evidence in the pull request is what keeps that gap visible.

Default pod isolation

Policies are additive by design, which means the default state matters. A pod with no matching policy is typically reachable. Adding one policy changes which pods become isolated and how.

The review needs to answer two questions about isolation. First, which pods currently have no policy and are therefore open. Second, which pods the new policy will isolate by matching its selector. The selector-to-service table is the record that answers both.

Policy selector Affected pods Owning service
app: api in namespace prod API deployment pods Public API
app: worker in namespace prod Background worker pods Queue consumer
role: db in namespace data Database pods Managed data layer

Keep the owning service column filled in. A selector without an owner is a guess, and a guessed blast radius is worse than no analysis because it reads as an answer.

A pod that gains isolation can also lose a dependency it did not know it had. Health checks, DNS resolution, and service mesh sidecars all count as traffic. A policy that permits only the application port can break readiness probes, which then restart the pod and turn a network scoping decision into a restart loop. Checking for those implicit dependencies is part of the isolation review, not a separate one.

Node and control-plane traffic exceptions

Policies govern pod traffic, not node-level or control-plane traffic. The documentation describes exceptions for node traffic, and a reviewer who assumes every path is governed by the policy will reach a wrong estimate. A node-local path, a host-network pod, or a control-plane component may not behave the way the policy implies.

Record those exceptions in the blast radius estimate rather than assuming them away. A policy that looks complete in the manifest can leave a node-level path open, or it can break a path that was never intended to be governed. The enforcement-evidence table is where this belongs, because it is the same cluster-level question as CNI support.

A worked blast radius example

Consider a change that adds an egress policy to a set of API pods in a shared namespace. The intent is to let those pods reach only the database and a metrics endpoint. The manifest is correct on its own terms, and the allow rules name the two destinations.

The review starts with the selector. If the selector is app: api and only the API deployment carries that label, the reach is narrow. If a second workload in the same namespace also carries app: api, the reach doubles and the second workload loses every path the new policy does not explicitly allow. Reading the selector against live labels is what distinguishes those two cases, and it is a check the manifest alone cannot answer.

The second step is the two-direction check. The API pods now permit egress to the database on its port, but the database pods must also permit ingress from the API pods. If an older, broader policy already permits that ingress, the path works because of the union rule. If no ingress policy permits it, the path breaks even though the egress side looks correct. Either outcome is consistent with the manifest, and only the full applicable policy set resolves which one applies.

The third step is enforcement. If the CNI supports policy enforcement, the change behaves as analyzed. If it does not, the policy is inert and the analysis is academic. Recording the enforcement evidence up front keeps the estimate honest and stops a no-op change from being read as a security improvement.

Ingress and egress interaction

Official (F018): a connection requires the source pod egress policy and the destination pod ingress policy to allow it. Reviewing only one direction is how a change passes review and still breaks traffic. The allowed path is the intersection of the two ends, so both need checking.

Read the two directions together when estimating blast radius. A policy that permits egress from the API pods does nothing if the database pods do not also permit ingress from the API pods. The traffic-flow table records both halves of each path.

Traffic flow Egress rule Ingress rule Expected result
API to database Allowed on TCP 5432 Allowed from API Connection succeeds
Worker to internet Denied by default Not applicable Connection blocked
Monitoring to API Allowed Allowed from monitor Metrics scrape works
Workflow for reviewing a NetworkPolicy change through enforcement, selectors, and both traffic directions
Editorial workflow derived from official Kubernetes facts F016 through F018. Approval comes after both directions are checked, not after the manifest is written.

Additive allow rules

Official (F017): NetworkPolicies are additive, so the allowed connections are the union of allowances from all applicable policies. Adding a narrow policy does not cancel a broader policy that also selects the same pod. This is the single most common blast radius mistake.

A reviewer who reads policy order as a deny sequence will reach the wrong conclusion. The documentation also describes how policies combine, so the union rule applies across every policy matching the pod. A pod that looks locked down by a new policy may still be reachable through an older one.

The check is to enumerate every policy that selects the pod and ask what each permits. A narrow rule is a permission, not a restriction. Recording the full set of applicable policies is what turns the union rule from a hazard into a reviewable fact.

Selector review

Selectors are where blast radius is decided. An empty selector matches every pod in the namespace. A label that is misspelled matches nothing. A label that is shared across environments matches more than the author intended.

Review each selector against the live labels in the cluster. Claude Code can generate the selector list from the manifest, and the engineer verifies it against the pods that actually carry those labels. The selector table above is the artifact that records this check.

A selector that matches pods in a shared namespace deserves explicit attention. Multi-tenant namespaces are where a broad selector stops being a narrow control. Confirm the owning service for every matched pod before approval.

Blast radius estimation

The blast radius is the set of pods whose traffic behavior changes, plus the set of connections that stop working. It is an estimate because it depends on enforcement, on every applicable policy, and on the live labels. None of those are fully knowable from the manifest.

A useful estimate names the affected pods, the paths that change, and the enforcement evidence. The estimate is the reviewer’s decision input, not a guarantee. When the estimate is uncertain, the honest answer is to narrow the change, not to widen the claim.

CNI capability Enforcement evidence Residual risk
Policy support present Confirmed by cluster admin Plugin behavior varies
Policy support absent No controller found Policy inert
Support unknown Nothing recorded No claim possible
Tradeoff diagram comparing a narrow selector change, a broad namespace policy, and the enforcement uncertainty between them
Editorial tradeoff diagram based on official Kubernetes facts F016 through F018. Narrow changes reduce blast radius; broad changes need stronger evidence.

Approval evidence

Approval should record what the reviewer checked, not just that they approved. The evidence packet for a NetworkPolicy change has three parts. The selector-to-service table names the affected pods and their owners. The traffic-flow table shows both directions and the expected result. The enforcement-evidence table ties the manifest to the cluster that will apply it.

The evidence packet is what makes the change reviewable later. When a connectivity incident happens, the packet is the record of what the reviewer believed would happen. An absent packet means the on-call reconstructs the reasoning from memory.

Claude Code can assemble the draft evidence from the manifest. The engineer confirms it against the live cluster. Keep the packet in the pull request so it travels with the change.

Recording evidence also supports the governance layer around the change. The SOC2 change evidence packets review covers what a compliance auditor expects to see, and the audit evidence integrity checks review covers keeping that record trustworthy over time. For identity decisions around who may approve a network change, the access recertification review and the vendor security review checklist cover the adjacent questions.

Validation limits

There are two limits to name honestly. First, enforcement is a cluster property, and a manifest-only review cannot observe it. Second, the union rule and the two-direction requirement mean the blast radius is a set intersection that needs the full policy set to compute correctly. A partial review produces a partial estimate.

Layer 3 and Layer 4 policies do not control application identity. A rule that permits TCP 5432 from a labeled source does not authenticate the workload behind the label. Labels are not identities, and a policy that treats them as such overclaims what it proves.

These limits connect to the broader threat model. The infrastructure threat model boundaries review places network policy inside a wider set of controls, and the OWASP AISVS control mapping review covers how agent-driven changes map to application security requirements. Neither replaces the cluster-level enforcement evidence, which only the target environment can provide.

Control checklist for CNI enforcement evidence, selector ownership, both traffic directions, and additive rule review
Editorial control checklist based on official Kubernetes facts F016 through F018. It separates enforcement evidence from selector reach and both traffic directions.

Concrete win, honest loss, and implication

Win: The selector-to-service table catches the case where a policy meant for one deployment also isolates a second one. That is caught before apply rather than as a connectivity incident.

Loss: Blast radius is an estimate until real traffic is observed. The two-direction rule and the additive union mean a reviewer can be wrong even with a careful table, especially when the applicable policy set is large.

Implication: Use the review when a NetworkPolicy change touches a shared namespace or a production dependency. Narrow the selector before widening the claim. Record enforcement evidence so the inert-policy case stays visible.

Network policy is one control in a set. The Pod Security Admission gates review covers workload-level admission controls, and the RBAC least privilege review covers identity permissions. For identity outside the cluster, the cloud IAM permission boundaries review and the policy as code audit cover the adjacent boundaries.

When the policy change is part of a delivery workflow, the SLO burn rate change alerts review helps bound the operational risk, and the error budget release policy review covers when a connectivity risk is worth taking. The incident timeline request correlation review is the diagnostic path when a policy change does cause an outage.

The review discipline generalizes across the platform batch. The Terraform plan review gates apply the same pre-apply reading to infrastructure changes, and the Terraform drift triage review covers the reconciliation case where the cluster and the manifest disagree. On the observability side, the OpenTelemetry semantic conventions review and the log pipeline health review are the paths for confirming that a policy change actually produced the traffic change the evidence packet predicted.

Approval authority is a separate question from technical correctness. The break glass incident access review covers emergency access paths, the change freeze emergency rules review covers when a network change can ship during a freeze, and the risk tiered infrastructure approvals review covers who signs off on a blast radius this wide.

One AI API Key option for OpenAI-format agents

The free IDs on this gateway do not work as a model source inside Claude Code. Claude Code uses an Anthropic-format route, and the packet records its Claude IDs as unavailable on 2026-11-27.

For a separate OpenAI-format agent, One AI API Key offers https://api.oneaiapikey.com/v1, one key, and 46 live free IDs. That is a different integration path, not a Claude Code workaround. Review the free model list or the quickstart before choosing a route.

Data gap and future update

This article does not verify CNI plugin behavior differences, node traffic exceptions in a specific distribution, or policy support in any named managed Kubernetes offering. Those are cluster-specific and should be checked in the target environment before apply.

The worked example above is illustrative, and the two pods it names are not drawn from a measured incident. The estimate method is the transferable part. A reader who wants a measured case should observe traffic before and after the change in their own cluster with enforcement confirmed, rather than generalizing from this example.

The cited Kubernetes pages were used for the enforcement, additive, and two-direction rules. They do not provide a per-CNI comparison or a managed-offering compatibility matrix, so a future pass can add those once verified against named platforms. The blameless postmortem evidence review is the path for turning a real policy incident into a durable record.

Verdict on reviewing Kubernetes NetworkPolicy blast radius before a Claude Code change applies
Editorial verdict based on official Kubernetes facts F016 through F018. A NetworkPolicy can look correct on disk and still have no effect without an enforcing network plugin.

FAQ

Does a NetworkPolicy take effect as soon as it is created?

Not necessarily. Official (F016): enforcement requires a networking solution that supports it. Creating the resource in a cluster without a supporting controller has no effect, so the manifest alone is not evidence that traffic changed.

Does adding a narrow policy override a broader one?

No. Official (F017): the allowed connections are the union of allowances from all applicable policies. Adding a narrow policy does not cancel a broader policy that also selects the pod.

Do I need to check both ingress and egress?

Yes. Official (F018): a connection requires the source pod egress policy and the destination pod ingress policy to allow it. Checking one direction can miss a path that breaks.

Does NetworkPolicy control application identity?

No. Layer 3 and Layer 4 policies govern IP and port behavior, not application identity. Labels are not authenticated identities, so a policy that permits traffic by label overclaims what it proves.

Can blast radius be proven before apply?

It can be estimated from selectors, applicable policies, and both traffic directions, but it is not proven until real traffic is observed in a cluster with confirmed enforcement. Keep the estimate as a decision input, not a guarantee.

More Claude Code troubleshooting

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
Claim $10 credit →