Est.

The Governance Void Between an API Key and an Accountable Agent Runtime

Five platform controls separate a coding agent with an API key from one you can hold accountable.

· 9 min read
Cover illustration for “The Governance Void Between an API Key and an Accountable Agent Runtime”
Agent Governance · November 14, 2026 · 9 min read · 1,940 words

For engineering teams running Claude Code and another coding agent without managing infrastructure, the deployment decision is a managed-runtime decision. The required platform controls are named-human identity, scoped credentials, isolated execution, hard budget caps, and attributable audit logs. An API key provides access to a model. Production accountability depends on the system around it.

Why coding agents fail in production — and why the API key is not the reason

Model capability is improving quickly, but deployment infrastructure remains a separate constraint. A capable coding agent does not arrive with enterprise identity, incident controls, or a review process attached. Those controls require their own engineering work. When a pilot reaches production without them, scoping and ownership have failed, even if model quality is adequate.

Coding agents run on developer laptops outside managed control planes, so a security team can count its server-side agents and still miss the largest group of agents it has. A registry alone cannot establish coverage. Getting ready for production therefore starts with finding where agents run and which controls apply there.

What an API key actually grants — and what it deliberately does not

An API key authenticates a request to a service. It does not establish a named-human identity boundary, isolate execution, impose a session budget, or create an accountability trail. Access is not a substitute for governance. After authentication, the agent can still decide how many model requests and tool invocations a task requires.

Whatever the developer can touch on disk, the agent can touch. Tokens exported into the environment become resources it can use. That inheritance is the central deployment risk. A model credential and a production infrastructure credential serve different purposes, but an ungoverned session can bring both within reach of the same agent.

The PocketOS / Railway incident makes that distinction concrete. An AI coding agent deleted the production database and all volume-level backups in a single API call. The decisive failure was the permission boundary. One agent held credentials capable of destroying production and its recovery path together, so the architecture needed to address credential scope independently of judgments about the model.

The identity layer: why agent sessions must map to named humans

Every agent session must map durably to a named human through SSO. Without that mapping, access reviews, offboarding, and attribution have no person to whom the policy can apply. A tool label alone is not enough. A PR marked agent:claude-code needs a session ID that lets security operations reach the originating session and identify who triggered it.

Identity also depends on discovering sessions outside the managed environment. Listeners on OpenTelemetry streams can surface agents, their loaded tools, and configuration changes as they happen. MCP server monitoring provides a parallel signal. New servers show which capabilities have become available, helping link the agent inventory to the resources those agents can reach.

The Miasma incident illustrates why attribution must cover session startup as well as deliberate task requests. A .claude/settings.json SessionStart hook acted as a postinstall for the editor, so opening a repository ran code. The configuration file was the attack surface. For an event like the Railway deletion, identifying an authenticated credential would likewise be insufficient without tracing the session to a person. Identity is an accountability prerequisite.

Credential scope and blast radius: what least-privilege means for agents

Once the initiating person is known, the next question is what the session may reach. An agent that reads a production database rarely needs permission to drop it and almost never needs permission to delete its backups. Least privilege requires separating read paths from destructive paths so that one action cannot destroy both production and recovery.

Session credentials should be scoped, short-lived, minted at startup, and revoked on completion. Shared or persistent credentials defeat that session boundary. The design test is direct. What is the worst thing the agent can do with one call, and does its assigned task justify that authority?

Mandiant’s UNC6780 / TeamPCP case describes subverted assistant CLI hooks producing remote code execution, distinct from the group’s use of prompt injection. The Cloud Security Alliance says Mini Shai-Hulud was the first recorded supply-chain attack to use AI coding agent configuration files as a weapon for persistence. These surfaces differ, but both make tool access and credential scope consequential beyond model output. Secret scanning on every agent PR, enforced through infrastructure-level pre-receive hooks, helps keep credentials out of generated code.

Sandbox isolation: why a container is not enough for production agent execution

Credential policy defines intended access. Execution isolation enforces a boundary around the workload. Standard Docker containers share a kernel, creating an unsuitable security boundary for production agents that can write scripts, install packages, and manipulate file descriptors. Proprietary code requires a stronger execution boundary. With MicroVM isolation, each agent workload has its own kernel.

GitHub Agentic Workflows added Docker Sandboxes as a supported runtime in July 2026, allowing broad agent control inside a microVM with network policy and secrets injection. The propose/dispose pattern provides another useful separation. The process communicating with the model API keeps the API key outside the sandbox, while shell commands, tests, file edits, and package management run inside a restricted container or VM without secrets.

Security containment and session reliability remain distinct goals. The former limits what compromised execution can reach. The latter prevents cross-contamination between sessions and access to the host or other teams’ infrastructure. Neither replaces scoped credentials. Even an isolated workload with the Railway incident’s destructive permissions would still need a separate authorization boundary around production and its backups.

Spend control: why budget enforcement must happen before tokens are consumed

Agentic work expands through model calls, reasoning steps, tool invocations, and subagent spawns. Because the agent chooses how much work a task requires, a flat request rate limit does not capture the resulting spend. Complexity changes the consumption pattern. When an enforcement boundary is missing, an agent can gain too much access and use too many resources.

The gateway must therefore enforce the budget before tokens are consumed. Hard caps must apply simultaneously per session, per developer, and per time period, rather than merely tracking aggregate expenditure afterward. An alert does not stop a session.

Without a reliable session-to-person mapping, a gateway cannot tell which developer’s budget to charge for the tokens used. Gartner’s June 2026 release predicts AI coding costs will surpass the average developer salary by 2028 as token consumption surges.

Observability and audit: what "every tool call is logged" actually requires

Stephanie Jarmak’s Engineering Reliable Coding Agents, published in August 2026, reports that 66.22% of completions across the AgentS4D benchmark were simultaneously task-complete and unsafe under a prespecified risk signal. Functional success was not a safety guarantee. A passing test result therefore cannot stand in for evidence about the agent’s behavior during execution.

The monograph specifies structured records of every model invocation, tool call, memory read/write, and decision branch, with execution traces linking actions to their causal antecedents. Enterprises also need records of file accesses, shell commands, PR creation, and API calls sent to the SIEM and kept for as long as needed. Logs must connect to sessions and responsible people or triggers. For Railway, recording the deletion alone would not explain the session and authority that made it possible.

Microsoft Foundry logs tool calls, retries, and cost automatically for managed agents, while major third-party frameworks need to be set up through low-code or manual configuration. AWS added built-in observability for Bedrock AgentCore agents in summer 2026, using OpenTelemetry-based traces through ADOT and routing them to Amazon CloudWatch. Both illustrate a shift toward structured traces. Yet agents emitting no telemetry require network-level discovery through LLM API signatures and MCP activity, while PR labels must make the audit trail traversable from artifact to originating session.

Agents-as-code: why configuration belongs in the repository, not a vendor dashboard

Permissions, sandbox policies, spend caps, and logging settings govern agent behavior just as application code governs software behavior. When those settings exist only in a vendor dashboard, they sit outside repository history and code review. Governance changes need a reviewable diff. Repository-committed configuration lets an owner inspect a permission or tool change before deployment, reducing the need to reconstruct it after an incident.

NVIDIA’s OpenShell expresses filesystem, network, process, and inference controls in YAML that can be committed, reviewed in pull requests, and deployed through CI/CD. Foundry similarly treats agent definitions, tool configuration, and infrastructure provisioning as code, including Bicep or ARM templates. The pattern spans behavior and infrastructure. In the Railway case, destructive permission scope is precisely the kind of configuration decision that needs visible ownership.

Declarative rules still need runtime enforcement. Wenhao Yang, Runzhi He, and Minghui Zhou’s A First Look at Coding Agents’ Compliance with AI Contribution Rules in Open-Source Communities finds that agents almost never proactively retrieve contribution rules. Auto-loaded AGENTS.md files can surface those rules in context, and reminders improve disclosure and verification. However, the study found no refusal to contribute in AI-banned repositories under any tested condition.

How should teams run Claude Code and Codex without managing VMs?

A managed runtime versus self-hosted infrastructure is primarily a governance choice, gated first by compliance exposure, then economics, then team capability. Tool selection does not settle that choice. Compute isolation, RBAC, network controls, and data residency remain separate infrastructure requirements regardless of which coding agent a team adopts.

Managed runtimes can provide microVM isolation, session-scoped credentials, budget enforcement, and structured audit logging as platform primitives. This removes the need to build and operate those controls internally. Models can also be upgraded while the API stays the same, while self-hosted teams must handle model swaps or stay pinned to older versions. For teams seeking infrastructure-free operation, these are the relevant capabilities to evaluate rather than assuming a tool subscription supplies them.

Retry and timeout implementations may be opaque, which becomes consequential when an agent retries a non-idempotent action. Data residency and predictable pricing need to be promised in clear terms in the contract. Audit access may be limited to vendor exports unless direct log access is available. Self-hosting offers direct internal access to prompts and logs and control over residency and retry behavior, but obliges the enterprise to operate every governance layer itself.

Foundry and AgentCore illustrate managed observability, while OpenShell illustrates repository-driven policy controls. Those examples do not establish interchangeable support for running both coding tools. The recommendation follows the control requirements. A team avoiding VM operations should choose a managed runtime whose execution support, isolation, credential lifecycle, budget enforcement, and audit access satisfy its review, rather than treating any single adjacent capability as a complete platform.

What genuine accountability at each layer looks like in practice

Engineering leaders should treat production approval as a dependency-chain review rather than a collection of independent feature checks. SSO establishes the person responsible for a session. Scoped credentials bound its authority. A microVM enforces its execution boundary. Gateway caps then constrain consumption against that identity. Structured traces link what the agent did to its session, while reviewed configuration records who approved the controls.

Security operations must be able to move from an agent-created PR to its session in the SIEM, inspect the actions taken, and identify the responsible person. Credential revocation and budget stops must operate at their intended boundaries. Incident runbooks must exist before GA, because evidence of an incident is useful only when the organization is prepared to respond.

This changes what production readiness means. The review asks whether the deployed system fits SSO, SIEM, code review, and incident response policy. Running a coding agent on a laptop with an API key is a prototype. Running it on managed infrastructure with the full accountability chain in place is production.

Sources

  1. Engineering Reliable Coding Agents: Evaluating and Operating the System Around the Model
  2. Microsoft Build 2026: Securing code, agents, and models across the development lifecycle
  3. Accountable Agents in Software Engineering: An Analysis of Terms of Service and a Research Roadmap
  4. A First Look at Coding Agents' Compliance with AI Contribution Rules in Open-Source Communities
Filed underAgent Governance

More in Agent Governance