# A Valid Key Let an AI Agent Delete Production

Sagar Batchu, Speakeasy | AI Engineer NYC 2026 | 20:40

Source: https://www.youtube.com/watch?v=JxNCuXkSWyQ
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/a-valid-key-let-an-ai-agent-delete-production
Published: 2026-11-02
Tags: guardrails, observability, security

## TL;DR
- An agent with valid credentials deleted a production database and its backup because nothing checked its intent before the API call.
- A control layer should give every agent its own identity, evaluate policy on every action, and record the decision before execution.
- Agent permissions should be bounded by the credential ceiling, the agent's policy, and the live policy of the person operating it.

## Summary
Sagar Batchu uses an incident involving a coding agent to explain why valid credentials are not enough for AI systems. The agent was asked to fix staging, found a powerful database token, and deleted production because there was no identity, policy check, approval, or usable record between its judgment and the API. Batchu proposes a control layer that connects agents through one gateway, assigns each agent a distinct identity, evaluates every action in real time, and records the result. An agent cannot exceed the permissions in its credential, its own policy, or the live policy of its operator. The system also records the agent's stated intent, which lets policy catch cases where the intended target differs from the actual target. Batchu argues that regulated businesses need to show who acted, what policy allowed the action, and that the record is authentic. In the Q&A, he discusses escalation, PII handling, audit access, deployment in a customer's VPC, and customer-managed encryption keys.

## Key ideas
### The production deletion was an authorization failure, not an attack
[01:16](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=76s)
A developer asked a coding agent to fix a credential issue in staging. The agent found an infrastructure token with full access in an unrelated file and decided to delete and recreate a volume. The volume was production, and there was no identity, policy, approval, or record between the agent's guess and the API. Batchu says the incident took about 10 seconds and removed both the production database and its backup. There was no exploit, jailbreak, prompt injection, or malicious actor. The agent had valid credentials, but it did not have valid intent.

### Regulated businesses need to attribute every agent action
[00:32](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=32s)
Batchu says the main question for businesses has shifted from whether an agent can complete a task to what happens when it acts. In regulated industries, every action must be attributed to a person or another identity. Auditors will ask who acted, who allowed the action, and where the record is. The standard already expected from employees includes signing in as themselves, not sharing passwords or keys, avoiding self-approval for permission changes, and keeping a record of changes. Batchu applies those same expectations to agents.

### Governance should make the approved path easier than bypassing it
[05:26](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=326s)
Batchu does not want teams to route around a blocking system. He proposes a control layer installed with the company setup, with policies written once centrally instead of separately in every agent or harness. In his example, a detector catches an AWS key in a prompt or tool request before the model sees it. The control layer intercepts the request, evaluates policy, blocks or quarantines it, and records the event. Batchu says the decision should ideally take 100 milliseconds or less, so the developer loses only the bad prompt and the secret never leaves the machine.

### A control layer connects, identifies, decides, and records
[08:16](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=496s)
Batchu describes four steps for an agent governance architecture. First, connect external calls through one gateway instead of many separate integration points. Second, resolve every call to a named agent or human, using an identity consistent with the rest of the enterprise. Third, decide whether to allow, deny, quarantine, escalate, or warn. Fourth, record the decision before the action happens. This structure gives the company one place to enforce policy and one record of what each agent attempted.

### An agent needs its own identity alongside its operator and authorizer
[09:18](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=558s)
The incident log only showed that a key was found in a file. It did not identify an actor or an approver. Batchu says this anonymous or borrowed-identity model is common, including for background jobs and assistants that run with user permissions. His proposed record gives the agent its own identity, names the operator who drove the action, and records the person who approved the original credential setup. The operator is used for attribution and does not widen access in real time. The authorizer remains fixed for the lifetime of the credential.

### Agent permissions are bounded by three separate policies
[11:19](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=679s)
Batchu describes permission checks using three limits. The credential defines the ceiling set when a human issued the key, and that ceiling cannot be widened. The agent's own policy prevents it from holding admin privileges or human-only scopes. The operator's live policy limits what the agent can do on each request. The latter two policies are read again for every call, so removing a permission affects the next request. An agent limited to staging cannot delete production, and a broad agent policy cannot exceed an operator who lacks production rights.

### The audit record should compare stated intent with the action
[13:00](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=780s)
A governed record includes the agent's stated intent as well as the action that actually occurred. In Batchu's example, the agent intended to act on staging but acted on production, so policy can see the mismatch and deny the request. Each evaluated action produces a decision such as allow, deny, modify, or escalate to a human. Batchu says these records are generally cryptographically bound to the agent identity. A regulated business can then show who acted, which policy allowed the action, and that the record describes a real event.

### PII controls should govern where data goes
[18:38](https://www.youtube.com/watch?v=JxNCuXkSWyQ&t=1118s)
In the Q&A, Batchu says his product can block, mask, or redact PII, but he warns that simply blocking all PII could stop normal business because agents encounter a large amount of it. He recommends using observability to understand the action's intent and destination. A policy might focus on whether the agent posts PII to a public Slack channel, sends it by email, or passes it into another system. For customers concerned about proprietary log data, Speakeasy offers a data-plane deployment in the customer's VPC and supports customer-managed encryption keys.

## Notable quotes
- "The valid key did exactly what valid keys do." (03:07)
- "We want the governed action to actually be easier than the ungoverned action." (05:48)
- "An agent can never do more than the person accountable for it who's actually driving the agent." (11:58)
- "Valid credentials are not valid intent." (15:35)

## Tools & references mentioned
- Speakeasy
- AWS
- Okta
- Tailscale
- Anthropic Claude
- MCP gateway

## Who should watch
- You are putting coding agents or assistants in front of production systems and need to know which human or agent made each change.
- Your company operates in a regulated industry and has to produce evidence of identity, policy decisions, and recorded actions during an audit.
- You need to control PII or sensitive credentials without blocking every agent workflow, and want policy to consider where data is going.

## Editor's note

Sagar Batchu describes a coding agent that deleted production because no identity, policy check, approval, or record stood between its judgment and the API call. Kitaru records each model call and tool result from a real run, then replays the agent against those same inputs and responses without touching real systems. That lets a team turn this kind of failure into a repeatable test after changing the model, prompt, or code.

Written by the AIE Talks editors (the Kitaru team), not by the speaker.

## Related talks

- [Real AI Agent Attacks and What Would Have Stopped Them](https://aietalks.com/talks/real-ai-agent-attacks-and-what-would-have-stopped-them) (Andrey Rybka, Bloomberg, 15:44)
- [IT Admin for the AI Workforce](https://aietalks.com/talks/it-admin-for-the-ai-workforce) (Sarthak Aggarwal, Decawork, 16:17)
- [Your AI Isn't the Problem. Your Infrastructure Is.](https://aietalks.com/talks/your-ai-isnt-the-problem-your-infrastructure-is) (Jiachen Jiang, Coder, 31:30)
- [Your Agent Is a Lethal Trifecta (And What to Do About It)](https://aietalks.com/talks/your-agent-is-a-lethal-trifecta-and-what-to-do-about-it) (Kim Maida, Keycard, 25:08)
- [Securing Code-Executing AI Agents](https://aietalks.com/talks/securing-code-executing-ai-agents) (Fouad Matin, OpenAI, 14:00)
