Dev.to AI 🤖 Ai 👁 0 📖 15 min read

How to Operate Cloud Infrastructure Through MCP (2026): A Day 2 Delegation Matrix, Guardrails, and Approval Layers

Operate cloud infrastructure through MCP by starting the assistant on a read-only connection for logs, metrics, and diagnosis, then granting write tools one class at a time behind the credential’s own permissions, client

Operate cloud infrastructure through MCP by starting the assistant on a read-only connection for logs, metrics, and diagnosis, then granting write tools one class at a time behind the credential’s own permissions, client approval prompts, and an audit trail you review. Control Plane’s MCP server offers a readonly profile for incident triage and a core profile for routine operations, all through the same API and tamper-proof audit trail as its CLI and console.

Disclosure: Control Plane publishes this guide.

TL;DR

An AI assistant can operate cloud infrastructure through MCP safely when hard boundaries sit under the protocol’s deliberately minimal security surface.

  • Start assistants on a read-only connection so they can triage incidents with logs, metrics, and traces before they can change anything.
  • The credential’s own permissions (IAM roles, RBAC bindings, org-scoped OAuth tokens) and org guardrails such as service control policies are hard boundaries, a server’s read-only profile is the next strongest, and annotations, prompts, and model instructions are advisory.
  • Tool annotations such as readOnlyHint and destructiveHint are hints, and the MCP specification says clients must treat them as untrusted unless they come from trusted servers.
  • Treat logs, issues, and tool output as untrusted, because indirect prompt injection through external data is a documented risk (OWASP LLM01:2025).
  • Read-only still sends data to the model, so scope what the credential can read as well as what it can change.
  • Approve destructive actions one at a time, and review the audit trail after every session.
  • Control Plane’s MCP server offers a readonly profile (27 tools) for incident triage and a core profile (49 tools) for routine operations scoped by Control Plane policies, labels every tool Read, Write, or Destructive, never reveals a secret value, and records every call in the same tamper-proof audit trail as the CLI and console.

How do you operate cloud infrastructure through MCP?

Connect an assistant to a server that exposes infrastructure actions as tools, then govern which tools it can call and under what conditions.

  1. Connect read-only for triage. Start the assistant on a read-only server profile, flag, or policy, which most major cloud MCP servers support. The assistant can query logs, metrics, traces, and events without the ability to change a live resource.
  2. Scope the credential. Scope each token to a single cloud account, organization, or project, use separate credentials for production and non-production, and prefer short-lived tokens issued per session. Remote servers that follow the MCP authorization spec validate that each token was issued for them. Local servers that run over STDIO inherit the developer’s environment credentials, so run them under a dedicated low-privilege profile or kubeconfig, and keep break-glass credentials out of every assistant’s reach.
  3. Vet and pin the server. Use official or reviewed servers, pin versions, and review tool descriptions after upgrades, because a malicious or compromised server controls what the model reads and calls.
  4. Add write tools one class at a time. Move from read-only to a profile with restarts and rollbacks, then add scaling. Keep identity, policy, and deletion tools out of the assistant’s reach, or behind a separate privileged workflow.
  5. Keep client approval on for writes. The MCP specification says there should always be a human in the loop with the ability to deny tool invocations. Claude Code prompts on first use of each tool in its default mode, so add an ask permission rule for an infrastructure server’s tools to make it prompt on every call. ChatGPT’s developer mode requires confirmation for write actions by default and treats tools without readOnlyHint as writes. Cursor requires approval for each MCP connection and each tool call, with an allowlist for pre-approved tools. For multi-step changes, have the assistant state the plan first and turn off auto-run modes for infrastructure servers.
  6. Keep secrets out of the chat. Never paste credentials into the conversation. Use server-side secret tools that create or rotate values without showing them to the model.
  7. Treat tool output as untrusted. The specification requires servers to rate limit tool invocations and sanitize tool outputs, and tells clients to validate tool results before passing them to the model. Logs, error messages, and issue bodies can carry adversarial text.
  8. Review the audit trail after each session. Every action the assistant took should appear in your provider’s audit log or the server’s own trail. Keep the client’s tool-call log as well, because the provider’s trail shows the action without the prompt or tool output that led to it, then compare what you approved with what ran.

Which Day 2 tasks should an assistant handle?

These recommendations follow the MCP security guidance to start with low-risk read scopes and elevate incrementally.

Task Risk Access needed Recommended approval
Read logs Low change risk; data exposure if logs hold personal data or tokens Read-only observability None; redact sensitive fields at the source
Query metrics and traces Low Read-only observability None
Diagnose a failing workload Low Read-only access to deployments, events, and logs None
Review the audit trail Low change risk; exposes user identities Read-only audit access None
Read workload config and environment variables Medium (data exposure) Read on the specific workload None; keep credentials in secrets so they never appear in config
Restart a workload Medium Write on the specific workload Client approval per call; check the replica count, because a single-replica restart causes downtime
Roll back to the previous image Medium to high Write on the specific workload Client approval per call with the target image shown; check for schema migrations or config the old image cannot handle
Scale a workload Medium Write on the specific workload Client approval per call; keep the minimum above zero for serving workloads and cap cost with limits
Rotate a secret Medium to high Write on secrets and the workloads that use them Client approval per call; check which workloads restart
Change routing or domains High Write on networking resources Client approval per call; check the traffic impact
Run a command inside a workload or volume Critical Exec permission on the workload Off by default; keep it a human-run process
Grant access, identities, or policies Critical Identity, access, and policy write Off by default; use a separate privileged workflow
Delete resources Critical Delete permission on the resource Off by default; keep deletion a human-run process

These are recommendations, so adjust them for your compliance requirements and blast radius. Read-only tasks still send data to the model provider, so logs with personal data or tokens, plain-text environment variables, and audit records carry data-exposure risk even when change risk is low.

What guardrails do cloud MCP servers ship?

Each major cloud and infrastructure MCP server ships its own mix of read-only modes, approval mechanisms, and underlying access controls as of November 2026.

Server Read-only option Approval mechanism Access control that actually enforces
Control Plane MCP server readonly profile (27 tools) advertises no tool that creates, updates, deletes, or runs a command Every tool is labeled Read, Write, or Destructive; the server instructs the assistant to state the impact and get approval before Destructive tools, and client approval prompts add a second layer Control Plane policies (nothing in an org is permitted until a policy allows it) and OAuth with per-org consent; a connection cannot reach an org you did not select, and its profile is fixed for the connection
AWS API MCP Server (awslabs) READ_OPERATIONS_ONLY restricts it to read-only operations REQUIRE_MUTATION_CONSENT asks for consent through elicitation before non-read operations; a security policy file supports a denyList and an elicitList IAM permissions, which AWS says remain the primary security control
Agent Toolkit for AWS (managed AWS MCP Server) --read-only on mcp-proxy-for-aws with SigV4 None in the server; approval comes from the client, the aws:ViaAWSMCPService and aws:CalledViaAWSMCP condition keys let policies target agent calls, and CloudTrail records them IAM policies; the server adds no permissions
Azure MCP Server 2.0 --read-only exposes only read-only tools Tools that read secrets, credentials, or other sensitive data require consent through elicitation, which --dangerously-disable-elicitation turns off; writes rely on the client Azure RBAC permissions of the signed-in user; Microsoft notes that destructive-operation safeguards are not standardized in MCP
Google Cloud remote MCP servers IAM deny policies can match the tool.isReadOnly attribute None in the server; approval comes from the client, Model Armor can screen traffic, and the separate local gcloud MCP server (preview) enforces a default denylist of unsafe commands The mcp.tools.call permission plus the underlying resource permission
Kubernetes MCP server read_only registers only read-only tools, and disable_destructive drops destructive ones (TOML settings) Confirmation rules through elicitation; if the client cannot show a prompt, calls proceed unless the fallback is deny (the default is allow) Kubernetes RBAC, which its docs say is the control to rely on; read_only can still read Secrets the identity can get
GitHub MCP server --read-only, or a /readonly URL on the remote server None in the server; approval comes from the client, and lockdown mode is a best-effort filter against prompt injection from untrusted repository content Permissions of the authenticated token; lockdown mode is not an authorization boundary
Terraform MCP server Approval-requiring tools stay off unless ENABLE_TF_OPERATIONS is set (default false) None in the server once ENABLE_TF_OPERATIONS is on; approval comes from the client Permissions of the HCP Terraform or Terraform Enterprise API token

Which approval layers stop a bad action?

Eight layers govern what an assistant can change and how you catch a bad change, and they differ in strength.

Layer What it enforces Where it can fail
The credential’s own permissions (IAM, RBAC, policies) A hard limit on which API calls succeed Over-permissioned or shared credentials grant more than intended
A server’s read-only profile or flag Which tools are registered or callable Misconfiguration at startup, a vendor misclassifying a tool, or read modes that still read sensitive data such as Kubernetes Secrets
Org guardrails (service control policies, admission policies, change windows, rate limits) What any caller can do, when, and how fast They apply only if configured for agent identities too
Tool annotations (readOnlyHint, destructiveHint) Hints to the client about tool behavior The specification says clients must treat them as untrusted unless they come from trusted servers
Server elicitation The server asks the user to confirm before a change or a sensitive operation It can be disabled by flags, and it depends on client support
Client approval prompts The client asks the user to confirm each tool call Approval fatigue, and allowlists or auto-run modes that skip the prompt
Instructions to the model Server or system instructions telling the model to ask first The model can ignore them, especially under prompt injection (OWASP LLM06:2025, Excessive Agency)
Audit trail review After-the-fact detection of unintended actions It catches problems only after they happen, and only if someone reviews a complete trail

The credential’s permissions and configured org guardrails are enforced by the provider, so the model cannot get around them, and a read-only server profile is the next strongest, because the model cannot call a tool that is not registered. A client that can also run shell commands with the developer’s own credentials goes around both, so limit what else the session can reach. Build on the hard boundaries first, then add the advisory layers as defense in depth.

How do you defend against prompt injection through logs?

Indirect prompt injection uses text inside logs, error messages, issue bodies, or API responses to steer the model, and the defense is to limit what the model can do after reading it.

On a read-only connection, injected instructions in a log line cannot change infrastructure through that server, but they can still push the model to leak what it read through other connected tools, so limit which other tools share the session. On a write-capable connection, client approval prompts give you a chance to catch a call the model made because of injected text. Treat everything the assistant reads, including logs, metric labels, event descriptions, and Git diffs, as potentially adversarial, and do not auto-approve chains of writes that follow data it just read. OWASP LLM01:2025 recommends human-in-the-loop controls for privileged operations. AWS warns not to connect its API MCP Server to untrusted data such as CloudWatch logs containing raw user data, and Claude Code’s documentation warns that servers fetching external content can expose you to prompt injection.

How does Control Plane’s MCP server support Day 2 operations?

Control Plane handles Day 2 operations for you, including autoscaling, built-in observability, and security.

Its MCP server exposes logs, metrics, traces, diagnosis, restarts, and rollbacks as tools, with a readonly profile for triage and the same audit trail as the CLI and console. The server runs at https://mcp.cpln.io/mcp and uses OAuth with per-org consent, so a connection cannot reach an org you did not select. It has 95 tools in four toolset profiles: readonly (27 tools), core (49 tools, the default), mk8s (51), and full (95). Connect with https://mcp.cpln.io/mcp?toolsets=readonly for incident triage. The Claude and ChatGPT directory listings use core, and other profiles are added as a custom connector URL. The core profile includes deletion, identity, and policy tools, so pair it with Control Plane policies that limit what the consenting user can do, or stay on readonly until you need writes.

The readonly profile advertises no tool that creates, updates, deletes, or runs a command, so an assistant on it cannot change a live resource, while metrics, logs, traces, events, the audit trail, and diagnosis stay available. A connection’s profile is fixed, and an agent cannot expand it mid-session, which makes readonly the hard guarantee for incident triage.

Day 2 tools include diagnose_workload, which reads deployments, events, and recent error logs and returns each likely cause with evidence and the fix, plus get_workload_logs (LogQL), query_metrics (PromQL), query_traces (TraceQL), query_audit_events, restart_workload, and rollback_workload. The rollback tool returns a workload to its previous image and changes nothing else, so environment, secrets, and database schema stay at their current versions and you should confirm the previous image is compatible with them. Scaling goes through update_workload.

Control Plane marks tools that delete, remove, or overwrite data as Destructive, and the server instructs the assistant to tell you the impact and get your approval before running them. That approval comes from the assistant following server instructions and from the client’s approval prompts, so the readonly profile and your policies are the hard guarantees and the Destructive label adds defense in depth.

No tool accepts or reveals a secret value, so the readonly profile cannot read secret values either. Values an application writes to its own logs, or puts in plain environment variables, are still readable through log and config tools. create_secret generates values or returns a Console link where you type them, and rotate_secret replaces values and restarts the workloads that use them. When Terraform or Pulumi manages a resource, the assistant warns that the next apply can revert its change.

The CLI, console, Terraform and Pulumi providers, and the Control Plane MCP server all work through the same Control Plane API, and Control Plane’s tamper-proof audit trail records actions from all of them, so an agent cannot act outside the trail. The Control Plane AI plugin sets up the MCP server for Claude Code (on the full profile) and for Codex and Antigravity CLI (on core), so add the readonly URL as a separate connection for triage sessions. Control Plane is PCI DSS Level 1, SOC 2 Type II, HIPAA, and GDPR compliant.

The walkthrough on how to let Claude or ChatGPT deploy your app covers deployment, the guide to letting AI agents operate infrastructure safely covers agent safety more broadly, and the explainer on WebMCP in the Control Plane console covers the browser side.

FAQ

These answers cover common questions about operating cloud infrastructure through MCP.

How do you operate cloud infrastructure through MCP?

Connect an assistant to a vetted, pinned MCP server, start on a read-only profile for triage, scope the credential to one account or org, add write tools one class at a time, keep client approval on for changes, and review the audit trail after each session.

Is it safe to let an AI assistant manage production infrastructure?

Yes, when hard boundaries are in place. The credential’s permissions are the limit the model cannot get around, a read-only profile keeps write tools out of reach, and client approval prompts and model instructions add defense in depth that should never be the only protection.

What is a read-only MCP server?

A read-only MCP server, or a server running a read-only profile, registers only tools that retrieve data and none that create, update, or delete resources. The Control Plane MCP server offers a readonly profile, set with ?toolsets=readonly. The AWS API MCP Server uses READ_OPERATIONS_ONLY, Azure MCP Server 2.0 uses --read-only, and other major servers offer similar flags, settings, or IAM policies.

Can MCP tool annotations prevent destructive actions?

No. Annotations such as readOnlyHint and destructiveHint are hints that are not guaranteed to describe tool behavior, and the MCP specification says clients must treat them as untrusted unless they come from trusted servers. They help well-behaved clients decide when to prompt, but they enforce nothing at the server or credential level.

How do I stop prompt injection through logs?

Triage on a read-only connection so injected text in logs cannot change infrastructure through that server, and limit which other tools share the session so the model cannot leak what it read. When write tools are available, approve each call and check its parameters, follow OWASP LLM01:2025 guidance, and redact or filter raw user data from logs the assistant reads, as AWS advises for its API MCP Server.

How do MCP servers authenticate?

Through OAuth 2.1 when they follow the MCP authorization spec, which is optional but recommended for HTTP transports in version 2026-07-28. Servers must implement OAuth 2.0 Protected Resource Metadata (RFC 9728), clients must use Resource Indicators (RFC 8707), servers must validate that tokens were issued for them, and servers must not accept or pass through other tokens. Dynamic Client Registration is deprecated in favor of Client ID Metadata Documents. Local servers that run over STDIO instead read credentials from the environment, such as an AWS profile, kubeconfig, or API token.

Which MCP servers support read-only mode?

The Control Plane MCP server (readonly profile, fixed for the life of a connection), the AWS API MCP Server (READ_OPERATIONS_ONLY), Agent Toolkit for AWS (--read-only through mcp-proxy-for-aws), Azure MCP Server 2.0 (--read-only), the Kubernetes MCP server (read_only), and the GitHub MCP server (--read-only or a /readonly URL) offer read-only modes as of November 2026. Google Cloud remote MCP servers can deny non-read-only tools through IAM deny policies on tool.isReadOnly, and the Terraform MCP server keeps approval-requiring tools off by default.

How does Control Plane’s MCP server handle destructive actions?

Control Plane labels every tool Read, Write, or Destructive, and Destructive tools exist only in the profiles with write access (core, mk8s, and full). The server instructs the assistant to state the impact and get your approval before running them, and the client’s approval prompts add a second check. The readonly profile and your Control Plane policies are the hard guarantees, because readonly registers no tool that creates, updates, deletes, or runs a command, and a connection’s profile cannot be expanded mid-session.

Does the MCP specification enforce security on its own?

No. The specification defines how clients and servers communicate, recommends scope minimization starting with low-risk read scopes, and states that tools represent arbitrary code execution. Enforcement comes from the credential’s permissions, org guardrails, the server’s profile, and the client’s approval behavior, and Microsoft notes that destructive-operation safeguards are not standardized in the specification.

Talk to the Control Plane team about the MCP server for your org, or sign up free and connect your first assistant.

Originally published on the Control Plane blog.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.