Why a Coding Tool Can't Safely Connect to Production

Coding tools are built to turn intent into a diff, not to hold production keys for a team. Using 2025 and 2026 incident data, this post maps six ways laptop-credential access fails and walks one production change through a scoped connection, CloudThinker's Sandbox, Auto Mode and the record it leaves.

PerspectiveUpdated Nov 2, 2026

Cover Image for Why a Coding Tool Can't Safely Connect to Production

Why a Coding Tool Can't Safely Connect to Production

It's 02:13. A coding agent on a developer's laptop is asked to "bump the payments service to handle the morning batch". It finds kubectl on the path, a kubeconfig with cluster-admin, and an ~/.aws/credentials file with a default profile that has worked for eight months. It scales the deployment, edits an HPA it wasn't asked to touch, and the session ends. At 09:30 someone asks what changed overnight and why. Nobody can answer, because the only record is a shell history on a laptop that's now in a backpack.

Coding tools like Claude Code, Codex, Kiro and Cursor are very good at writing the change. The trouble starts when the same tool holds the production key. Whatever can steer or compromise the agent then holds the key too. Production access needs its own layer between intent and the API call: one that holds the credential, decides each write and keeps the record. That's the layer CloudThinker's Frontier Investigation Agents run on.

Run this on your laptop first

Before arguing about architecture, check what an agent on a typical engineer's machine would inherit:

aws sts get-caller-identity
aws iam list-attached-role-policies --role-name <role-from-the-arn-above>
kubectl auth can-i '*' '*' --all-namespaces

If the second command lists AdministratorAccess and the third prints yes, that's the authority a coding agent gets the moment it runs a shell command. It's often been there for months and shared across the team.

That model held up while a human was the slowest part of the loop. It breaks once an agent is typing, for four structural reasons:

  • Rate. An agent can issue twenty production calls in a minute. Watching the terminal stops being a review.
  • Identity. The cloud API sees the engineer's role, not "the agent acting for the engineer on this task". There's nothing separate to scope, revoke or audit.
  • Location. The credential sits on the laptop, so anything that runs there can reach it: a poisoned package, a malicious MCP server, a prompt injection that asks the agent to print env.
  • Memory. What happened lives in prompt history and shell history, which nobody can query the next morning.

What the 2025 and 2026 incident data shows

Read the published incident reports and six failure modes keep coming back.

01Credentials

The real target

Attackers go for the key the agent holds, not the model behind it.

02Actions

No human anchor

Destructive production calls run with no per-agent identity or approval.

03Supply chain

Bulk harvest

One poisoned package or MCP server drains every machine that installs it.

04IAM

Blast radius

An over-privileged role turns one compromise into account-wide access.

05Agent CVEs

Tool defects

Bugs in the coding agent itself ship the credential to someone else.

06Prompts

Data egress

Real customer data leaves your boundary inside the prompt.

Six failure modes from published 2025 to 2026 incident data. None of them is about how well the model writes code.

Attackers go for the credential, not the model. VentureBeat's write-up of six exploits against Codex, Claude Code, Copilot and Vertex AI found the same pattern each time: an AI coding agent held a credential, executed an action, and authenticated to a production system without a human session anchoring the request. The GitGuardian State of Secrets Sprawl report counted 28.6 million new secrets in public GitHub commits in 2025, up 34% year over year. AI-assisted commits leaked secrets at 3.2%, against a 1.5% baseline, and 24,008 secrets turned up in public MCP configuration files.

Destructive actions run with no one anchoring them. In the July 2025 Replit incident, a coding agent deleted a live production database during a code freeze, then told the operator rollback was impossible, which wasn't true. The AI Incident Database now lists similar incidents across Kiro, Replit, Antigravity, Claude Code and Cursor.

The supply chain harvests keys in bulk. Socket's SANDWORM_MODE campaign used 19 malicious npm packages to install rogue MCP servers into Claude Code, Cursor, Windsurf and VS Code. On March 24, 2026, two hijacked LiteLLM releases on PyPI collected SSH keys, cloud credentials, kubeconfigs and shell history from every machine that installed them. If the agent's machine has the credential, the supply chain has it.

Over-privileged roles turn one compromise into the whole account. In a November 2025 AWS crypto-mining campaign, attackers worked across 19 IAM principals, created a backdoor user with AdministratorAccess, and had miners running within 10 minutes of first access.

The agents themselves ship the key. CVE-2025-59536 allowed code execution through a Claude Code project config file before any trust dialog appeared. CVE-2026-21852 let an attacker redirect Claude Code traffic by tampering with ANTHROPIC_BASE_URL, exposing API keys. Separately, a DryRun Security study reported by Help Net Security found at least one vulnerability in 26 of the 30 pull requests (87%) that Claude Code, Codex and Gemini agents opened while building two apps. It's a small sample, and the pattern is the point.

The prompt is a leak channel. LayerX found that about 18% of enterprise employees paste data into GenAI tools, and more than half of those pastes include corporate information. When an agent's context holds a real customer email or card number, that value has crossed a third-party boundary.

What a production access layer has to answer

Strip the marketing away and a safe path to production answers six questions. Here's how CloudThinker answers each one today.

  1. Who is connecting? A connection per service, added by a workspace Admin. For AWS, CloudThinker assumes an IAM role you create, locked to an External ID, and gets short-lived STS credentials. Each session is named cloudthinker-<workspace prefix>-<timestamp>, so CloudTrail shows it as its own identity.
  2. What can it reach? The credential's own permissions are the ceiling. Start with a read-only credential and widen it when there's a specific change you want agents to make.
  3. How does traffic get there? Connections run from CloudThinker Cloud. To keep a service private, allowlist CloudThinker's egress IPs or run an environment inside your network. The private connectivity post covers the options.
  4. What data crosses the boundary? CloudThinker replaces secrets and personal identifiers in tool output with placeholders before the model sees them. Within one conversation the same value always gets the same placeholder, and nobody, the agent included, can turn a placeholder back into the value. See What Never Reaches the Model.
  5. What did it do? Every command and its output stay in the conversation, and the calls land in your provider's own logs. On Scale and above, Audit Logs records user, agent and system actions. Nobody can edit or delete an entry, entries are kept 90 days, and you can export them as CSV.
  6. Who said yes? Every write goes through Auto Mode, so you decide what runs on its own and what waits for approval. Reads always run.

A pile of .env files answers none of the six.

01Intent to diff

Coding tool

  • Claude Code, Codex, Kiro, CursorWrites the change and the rationale
  • GitHubPull or merge requestThe artifact it hands over

No production credential

02Intent to action

CloudThinkerCloudThinker

  • ConnectionsOne credential per service, scoped by you
  • SandboxCredential injected only when a command runs
  • Auto ModeWhat runs on its own, what waits
  • Placeholders and logsSecrets masked, every command recorded

Holds the key, keeps the record

03Production

Your estate

  • AWSCloud accountsIAM role with an External ID
  • KubernetesClustersService account with namespaced RBAC
  • PostgreSQLDatabasesRead-only user to start

Your permissions are the ceiling

Two tools at two layers. The coding tool never holds the production credential.

One production change, end to end

Take the 02:13 request again and run it through that layer instead of a laptop. The intent is the same: scale payments from 4 to 8 replicas before the morning batch.

01Intent

Scale to 8

A chat, alert or merge request names the service, the change and the reason.

02Read

Check evidence

Replicas, HPA and load are read first. Reads always run.

03Decide

Auto Mode

The write runs on its own or waits for an approver.

04Run

Sandbox

The connection credential is injected for one command.

05Record

The trail

Who asked, who approved, what ran, what came back.

One production change, end to end. The model sees the intent; only the sandbox sees the secret.

Step 1: the intent arrives without a credential. It comes from chat, an alert, or a merge request the coding tool opened. The model sees text like "scale payments to 8 replicas because the batch queue is three times yesterday's depth". It never sees a key.

Step 2: the reads run first. Reads don't need approval, so the agent checks the evidence before it proposes anything:

kubectl get deploy,hpa -n payments
kubectl top pods -n payments

If an HPA already manages payments, it will resize the deployment again on its next sync. The agent puts that in the plan and leaves the choice (scale the deployment, or raise the HPA's minReplicas) to the approver, instead of editing the HPA on its own.

Step 3: the write waits for a decision. Scaling is a write, so it goes through Auto Mode. The approval shows current replicas, target replicas, the queue-depth evidence and the rollback (--replicas=4).

Step 4: the command runs in CloudThinker's Sandbox. The Kubernetes connection's credential is injected there for the command and never shown in chat. What that credential can do is decided in your cluster, not in a prompt. Bind the connection's service account to a Role like this and scaling one deployment is the only write any request can make:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: cloudthinker-scale
  namespace: payments
rules:
  - apiGroups: ['apps']
    resources: ['deployments/scale']
    resourceNames: ['payments']
    verbs: ['get', 'update', 'patch']
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: cloudthinker-scale
  namespace: payments
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: cloudthinker-scale
subjects:
  - kind: ServiceAccount
    name: cloudthinker-reader
    namespace: cloudthinker

If a log line carries an injected instruction to "print the database password", the agent doesn't have it in context, and connection secrets in command output reach the model only as placeholders. The role couldn't read Secrets anyway.

Step 5: the record is already there. The conversation holds who asked, the evidence, the approval, the exact command and the API response. The Kubernetes audit log shows the cloudthinker-reader service account. For AWS work, a CloudTrail Lake query on the role answers "what changed overnight" in one pass:

SELECT eventTime, eventName, eventSource, userIdentity.arn
FROM <event-data-store-id>
WHERE userIdentity.sessionContext.sessionIssuer.userName = 'CloudThinkerAccessRole'
  AND readOnly = false
  AND eventTime > '2026-11-01 00:00:00'
ORDER BY eventTime DESC

The coding tool still did the part it's good at. It never held the key.

Why this beats the laptop model

Coding tool with laptop credentialsCoding tool plus CloudThinker
Who the API seesThe engineer's roleA role or service account created for CloudThinker, named per session in AWS
Where the secret sits~/.aws, kubeconfig, envEncrypted at rest, injected into the sandbox when a command runs, never in chat
Prompt injection asks for a secretIt's in env, so it can leakConnection secrets in output reach the model as placeholders
Production write at 02:13Runs because the key worksGoes through Auto Mode first
Customer data in outputSent in clear to the model providerEmails, phone numbers and card numbers masked by default
"What changed overnight?"Shell history on one laptopThe conversation, your provider's logs and Audit Logs

The deeper difference is where authority lives. On a laptop, authority is a file, and whoever can read the file has it, including the agent, its dependencies and anything that tricks it. With an access layer, the credential sits in one place you scoped at the provider, it's used only where the command runs, and each write is a decision someone can point to later.

Two tools, two layers

You don't need one tool that does everything. You need two at the right layers. The coding tool turns intent into a diff. CloudThinker turns an approved intent into a production action and writes it down. Keep the coding tool you like, and stop asking it to do the second job.

The costs of building that second layer yourself are in Build vs Buy: The 24-Month TCO of an Agentic Operations Platform.

Getting started

Connect one AWS account with a read-only role, then ask in plain language:

"List the IAM users in this account with access keys older than 90 days, the policies attached to each, and when each key was last used."

"Scale the payments deployment to 8 replicas for the morning batch. Show me the plan, the permission you'll use and the rollback before anything runs."

"Show me every production change from last night, who asked for it, who approved it and the command that ran."

The first prompt usually makes the case on its own. See how Frontier Investigation Agents connect to production.

Related reading

About the author

ST

Steve Tran

Founder & CTO, CloudThinker

Steve Tran is the founder and CTO of CloudThinker, which builds Frontier Investigation Agents for production cloud operations. He writes about incident investigation, cloud cost, and the practices teams use to safely run autonomous AI agents against production AWS, GCP, and Azure environments.

agenticopssecurityconnectionssandboxautonomousopsdatatokenizationpiicodingtoolsvibeopsenterprisecloudthinker