Перейти до вмісту

Trust Boundaries for Infrastructure AI Use

Цей контент ще не доступний вашою мовою.

AI for Kubernetes & Platform Work | Complexity: [MEDIUM] | Time: 35-50 min

Infrastructure work has sharp edges.

A wrong answer in this space can cause:

  • outages
  • security exposure
  • data loss
  • hidden misconfiguration
  • expensive operational drift

That means AI trust boundaries matter more here than in casual chat use.

The central question is:

“What should AI be allowed to do, and what must remain human-controlled?”

If you do not answer that clearly, the workflow becomes unsafe by default.

  • what a trust boundary means in infrastructure work
  • which tasks are lower-risk advisory tasks
  • which tasks require strict human review
  • which tasks should not be delegated at all
  • how to design safer AI-assisted infra workflows

You can think of infrastructure AI use in three zones.

Usually safe with verification.

Examples:

  • explain a manifest
  • summarize logs
  • compare configs
  • draft a checklist
  • rewrite a runbook for clarity

AI is helping you understand.

Useful, but must be reviewed carefully.

Examples:

  • propose a Kubernetes manifest patch
  • draft an incident communication
  • suggest troubleshooting branches
  • draft Terraform changes for review

AI is shaping possible action, but not taking action itself.

High-risk.

Examples:

  • applying cluster changes automatically
  • approving production rollout decisions
  • modifying IAM, network policy, or secrets policy without human gate
  • taking destructive remediation action

This zone should stay human-controlled unless you have an intentionally designed automation system with explicit safeguards.

The transition from Zone 1 to Zone 2 often creates a “competence trap” where the user trusts the AI’s explanation and assumes the subsequent draft is equally accurate. In practice, while an LLM can summarize a Deployment manifest flawlessly, it may struggle with the specific side-effects of an Admission Controller that modifies that manifest at runtime. For example, when drafting a NetworkPolicy, the AI might correctly identify the required ports but fail to account for local IPBlock restrictions that aren’t present in its training data or provided context. This necessitates a “Validation-First” mindset where AI-generated drafts are treated as unverified theories until passed through a schema validator or a non-production dry-run.

In Zone 3, the risks scale exponentially because the AI lacks a temporal understanding of cluster state—it sees a snapshot, not the historical trajectory of a rolling update or a cascading failure. If an AI agent attempts to remediate a CrashLoopBackOff by increasing resource limits, it might solve the immediate symptom while masking a deeper memory leak or a misconfigured liveness probe that eventually exhausts the entire node’s capacity. To mitigate this, automated execution must be encapsulated within a “Safety Sandbox” where the AI proposes an action to a deterministic policy engine (like Kyverno or OPA) which then validates the request against hard organizational constraints before execution.

Consider the following workflow for an AI-assisted incident response where the tool transitions from analysis to a proposed (but human-gated) action:

Terminal window
# Zone 1: AI analyzes the failing pods to find commonality
kubectl get pods -n production -o json | \
jq '.items[] | select(.status.containerStatuses[].restartCount > 5)' | \
ai-cli analyze --context "Check for recent image tag changes or OOMKills"
# Zone 2: AI proposes a targeted patch based on findings
# ALWAYS pipe to a file or use --dry-run to maintain the Zone 2 boundary
kubectl patch deployment payment-api --patch-file ai-suggested-fix.yaml --dry-run=server

This distinction matters because the “Blast Radius” of a mistake in Zone 3 is absolute. In a platform engineering context, a misconfigured ClusterRole generated by an AI doesn’t just break an application; it potentially compromises the entire multi-tenant security model. By keeping execution human-controlled or strictly gated by deterministic policies, you ensure that the AI remains an accelerator for human decision-making rather than a single point of failure for infrastructure integrity. The goal is to move the “Trust Ceiling” higher by improving the quality of inputs in Zone 1 and 2, but never removing the “Safety Floor” of manual approval or policy-based validation in Zone 3.

Furthermore, the ephemeral nature of Kubernetes resources introduces a “state desynchronization” risk. An AI might suggest a fix based on a ConfigMap it read two minutes ago, but in a dynamic environment, that resource might have been updated by a GitOps controller in the interim. This lag between perception and action is the primary reason why Zone 3 remains the most dangerous territory for autonomous AI; without real-time, atomic verification of the cluster state, an AI’s “correction” can quickly become an unintended regression.

There is a difference between:

  • AI inside an engineered automation system with fixed controls and
  • a general-purpose model improvising in a production environment

The first can be acceptable in narrow cases.

The second is how you create invisible risk.

Engineered systems leverage AI as a “decision engine” within a strictly typed pipeline. In a Kubernetes context, this means the model doesn’t emit raw YAML; it interacts with high-level abstractions—like a specific Operator or a Crossplane Composition—where the “action space” is pre-validated. By constraining the AI to a predefined set of functions, often referred to as tool-use or function calling, you shift the trust boundary from the model’s unpredictable reasoning to the rigid API contract. If the model suggests an invalid parameter, the underlying schema-validation logic in the Kubernetes API server acts as the final circuit breaker, preventing the “hallucination” from ever reaching the cluster state.

Conversely, allowing a model to “improvise” involves giving it access to unrestricted shells or broad RBAC permissions, such as cluster-admin, with the expectation that it will troubleshoot and resolve a networking fault on the fly. This introduces “Semantic Drift,” where the intent of the platform engineer—encoded in Helm charts or Kustomize overlays—is overwritten by the model’s tactical fix. This creates a state where the live cluster no longer matches the git repository, effectively breaking the GitOps reconciliation loop and making disaster recovery impossible because the “fix” was never versioned, peer-reviewed, or tested against the broader system architecture.

# Example of a constrained Function Definition (Tool) for an AI Agent
# This restricts the AI to specific namespaces and replica counts,
# rather than allowing raw 'kubectl scale' access.
name: scale_deployment
description: Adjusts replica count for approved stateless workloads.
parameters:
type: object
properties:
deployment_name: { type: string }
namespace: { type: string, enum: ["web-frontend", "api-gateway"] }
replicas:
type: integer
minimum: 1
maximum: 12 # Hard guardrail against runaway scaling costs
required: ["deployment_name", "namespace", "replicas"]

In practice, this distinction is the difference between an “Autopilot” and a “Black Box.” Engineered controls allow platform teams to monitor the decision-making process through structured logs and telemetry, ensuring that every AI-driven action is attributable to a specific, human-defined policy. Improvisation leads to “Shadow Infrastructure,” where undocumented changes accumulate until a minor update triggers a cascading failure that is invisible to traditional monitoring. For platform engineers, the goal is to use AI to handle the cognitive toil of analyzing logs and metrics, while keeping the execution of changes firmly within the established guardrails of the existing Kubernetes control plane.

What “Human In The Loop” Should Actually Mean

Section titled “What “Human In The Loop” Should Actually Mean”

Weak version:

“A human glanced at it.”

Strong version:

“A human reviewed the evidence, understood the change, checked the blast radius, and explicitly accepted responsibility.”

If the human cannot explain why the step is safe, the loop is cosmetic.

Use AI freely for:

  • explanation
  • summarization
  • review support
  • drafting candidate options

Use AI cautiously for:

  • config changes
  • remediation plans
  • policy suggestions
  • security interpretations

Do not let AI alone:

  • approve production changes
  • decide destructive action
  • handle secrets casually
  • rewrite operational controls without review

A good workflow:

  • AI summarizes a failing rollout
  • AI proposes likely hypotheses
  • AI drafts a rollback checklist
  • human validates the evidence
  • human decides rollback vs forward-fix
  • human executes the change

A bad workflow:

  • AI sees alert
  • AI decides likely cause
  • AI generates a fix
  • AI applies it automatically
  • human only reads the summary afterward

That is not acceleration.

That is unmanaged risk.

Before allowing AI into a task, ask:

  • what is the blast radius if it is wrong?
  • can the output be verified cheaply?
  • does this task require local context the model does not have?
  • who is accountable if the change fails?

If the answers are unclear, keep AI in an advisory role.

Infrastructure AI use becomes safe when trust boundaries are explicit.

Use AI to:

  • understand better
  • review faster
  • draft more clearly

Do not use AI to quietly replace:

  • verification
  • approval
  • accountability

That is the difference between disciplined augmentation and reckless delegation.

Q1. Your team is investigating a failed rollout in production. An AI assistant summarizes the rollout events, compares the new manifest to the previous version, and drafts a rollback checklist. The on-call engineer reviews the evidence and then decides whether to roll back. Which trust zone does this workflow primarily stay in, and why is it considered acceptable?

Answer This stays in Zone 1 and Zone 2, which is acceptable because the AI is helping explain, review, and draft options rather than executing the change itself.

The safe part of the workflow is that the human validates the evidence, checks the likely blast radius, and makes the final rollback decision. The module treats that as disciplined augmentation, not unsafe delegation.

Q2. A platform team gives a general-purpose AI agent access to production credentials. During an alert, it identifies a likely cause, generates a manifest patch, and applies it automatically before any engineer reviews it. What is the main problem with this design?

Answer The workflow crosses into Zone 3 without a proper human gate, which makes it high-risk and unsafe.

The module explicitly says AI should not alone approve production changes, decide destructive action, or apply cluster changes automatically unless it is inside an intentionally designed automation system with explicit safeguards. Here, the model is improvising in production, which creates unmanaged risk.

Q3. Your team asks AI to draft a new NetworkPolicy after a service outage. The draft looks correct, so one engineer assumes it is safe because the AI’s earlier explanation of the service topology was accurate. What specific trap does this illustrate, and what should the team do next?

Answer This is the competence trap: trusting the drafted action because the earlier explanation seemed strong.

The module warns that AI can move from explaining well in Zone 1 to drafting imperfectly in Zone 2. The team should use a validation-first mindset and treat the draft as an unverified theory until it is checked with schema validation, dry-run, or other non-production verification.

Q4. During an incident, an engineer asks AI to analyze failing pods and then uses kubectl patch ... --dry-run=server with the AI-generated patch file instead of applying it directly. Why is that boundary important?

Answer It keeps the workflow in Zone 2 rather than letting it slip into Zone 3.

The AI is still proposing a possible action, but the dry-run preserves human control and cheap verification before any real change happens. The module frames this as a safer pattern because draft recommendations must be reviewed carefully and not executed blindly.

Q5. A company wants AI to scale approved stateless workloads, but only inside specific namespaces and within fixed replica limits enforced by a policy-driven tool interface. How is this different from letting a chatbot run arbitrary kubectl commands in production?

Answer This is closer to AI inside an engineered automation system with explicit safeguards, which can be acceptable in narrow cases.

The module distinguishes that from a general-purpose model improvising in production. The constrained tool interface limits the action space, applies hard guardrails, and reduces invisible risk. An unrestricted chatbot with broad permissions would violate that trust boundary.

Q6. A senior engineer skims an AI-generated remediation plan for a production IAM policy update and says, “Looks fine, ship it.” According to the module, why is this not a strong human-in-the-loop process?

Answer Because the human review is cosmetic rather than accountable.

The module says strong human-in-the-loop means the human reviewed the evidence, understood the change, checked the blast radius, and explicitly accepted responsibility. A quick glance without being able to explain why the IAM change is safe does not meet that standard.

Q7. Your team asks whether AI should be allowed to rewrite operational controls for a sensitive multi-tenant cluster because it would save time. The blast radius is large, local context is incomplete, and accountability is unclear if the change fails. Based on the module’s decision test, what role should AI play?

Answer AI should stay in an advisory role.

The module’s decision test asks about blast radius, whether the output can be verified cheaply, whether local context is missing, and who is accountable if the change fails. Since those answers are unfavorable here, AI should help with explanation, review, or drafting, but it should not rewrite the controls on its own.

Goal: define clear trust boundaries for an AI-assisted Kubernetes workflow by separating advisory tasks, review-required drafts, and human-only execution steps.

  • Pick a realistic infrastructure scenario, such as a failed rollout, a proposed NetworkPolicy change, or an IAM/RBAC update. Write down the system affected, the namespace or environment, and the potential blast radius if a change is wrong.
  • List 6-8 tasks an engineer might perform in that scenario. Include a mix of analysis, drafting, approval, and execution tasks such as summarizing logs, proposing a manifest patch, approving production rollout, rotating credentials, or applying a rollback.
  • Classify each task into one of three zones: Zone 1 for explain and review, Zone 2 for recommend and draft, Zone 3 for execute or approve. Mark any task as Zone 3 if it changes live state, grants access, handles secrets, or makes an irreversible decision.
  • For every Zone 2 task, define one required verification step before a human can accept it. Use checks such as schema validation, dry-run, diff review, policy validation, or peer review.
  • For every Zone 3 task, define the human control point. Record who approves it, what evidence they must review, and what would make them reject the action.
  • Draft a short workflow that keeps AI in an advisory role. Example pattern: AI summarizes evidence, AI drafts options, human validates evidence, human checks blast radius, human decides, human executes.
  • Add one unsafe version of the same workflow where AI crosses the trust boundary, then rewrite it into a safe version with explicit controls.
  • Document a simple rule set for your team: AI may explain and draft, AI may not approve production changes, AI may not apply destructive actions, AI may not access secrets without explicit policy and human review.

Verification commands:

Terminal window
kubectl diff -f candidate-change.yaml
kubectl apply --dry-run=server -f candidate-change.yaml
kubectl auth can-i update deployment -n production
kubectl get events -n production --sort-by=.lastTimestamp
kubectl describe networkpolicy -n production

Use the commands only to verify a candidate change or inspect current state, not to apply unreviewed AI-generated actions directly.

Success criteria:

  • Every task in the scenario is explicitly assigned to Zone 1, Zone 2, or Zone 3.
  • Every Zone 2 task has a concrete verification step.
  • Every Zone 3 task has an explicit human approval gate.
  • The safe workflow keeps AI advisory and preserves human accountability.
  • The unsafe workflow clearly shows what boundary violation would create unmanaged risk.
  • The team rules make it obvious what AI can do, what must be reviewed, and what must remain human-controlled.

Continue to AI/ML Engineering if you want to build and operate deeper AI systems.

  • NIST AI Risk Management Framework — Provides a primary framework for assigning controls, oversight, and accountability around AI-assisted decisions.
  • OWASP Top 10 for LLM Applications — Covers common failure modes and security risks that matter when AI is used near sensitive infrastructure workflows.
  • Kubernetes Admission Controllers — Useful background for the module’s idea that high-risk actions should be constrained by explicit safeguards rather than improvised model behavior.