# Give the Agent a Budget, Not a Token - Sachin Malhotra, Anthropic <!-- ref: @content/youtube/aie/give-the-agent-a-budget-not-a-token-sachin-malhotra-anthropic tags: [agent permissions, budgets, rate limits, audit trails, identity, CI, infrastructure guardrails] version: 2 updated_at: 2026-11-24T05:16:25.808Z --> **[Watch on YouTube](https://www.youtube.com/watch?v=rbjWzZK2LU0)** # Give the Agent a Budget, Not a Token - Sachin Malhotra, Anthropic *Synthesized from Sachin Malhotra's talk on AI Engineer, 2026-08-22.* Sachin Malhotra presents as an engineer on the CI team at Anthropic, which builds and runs the testing and merge infrastructure for code written inside the company. ## Core Thesis Sachin argues that handing an agent an access token and a tool list is a yes-or-no grant that does not scale once the agent works in production. He proposes replacing it with a budget that has four dimensions: how much the agent can do, how fast, what it can cancel or undo on its own, and who notices when it acts. Guardrails should live partly in the agent's text instructions and partly in an infrastructure proxy that the agent cannot argue with. ## Key Insights - **The incident.** A cleanup agent deleted about 200 workloads in 90 seconds, affecting the work of 20 engineers. A pipeline stage had returned an empty result, so a filter dropped out and the selector matched everything in the row. Some of the deleted jobs were long training runs, and some had no checkpoints. - **Token versus budget.** A token is a static yes or no over a list of access areas. Narrowing the token either makes the agent useless or leaves it able to cause a postmortem. - **Asymmetric verbs.** The same-sized action can have a different blast radius depending on what fails. Some verbs fail loudly (unblocking a test that turns CI red) and are recoverable by a person. Others fail silently (skipping a test lets a real bug reach production green). Silent-failure verbs need a human and an audit trail. - **Test quarantine example.** The agent may re-enable quarantined tests when they are working correctly. A wrong call turns builds red and can be rolled back fast, so the action is allowed, but the proxy records the caller's identity rather than the agent self-reporting. - **Query limits (speed limits).** Each user gets a fixed number of destructive actions per time window. Going over the limit rejects the request with a budget message, and the limit refreshes over time. The limit size varies by scope: a larger limit for one's own namespace, a smaller one for a shared namespace. A bypass flag exists, but inside an agent session it refuses and tells the agent to ask the person to run the command. - **Origin of the limit.** After the incident, a neighboring team built a permission webhook that caps deletions per hour for each resource type and namespace. - **Tripwires instead of whitelists.** Whitelists are static guesses made before any data exists and go stale. Tripwires record what happened after the fact, and their fix is often one or two lines of agent context. Track aggregate metrics rather than individual calls. - **Worked tripwire case.** The team tracked investigation threads launched per hour when a test job fails. A spike paged the duty officer. The agent had opened separate investigation threads for dozens of tasks with the same error signature. The fix was an instruction to correlate similar failures before starting separate threads. The speaker calls this a smoke detector rather than a door lock. - **The cancellation test.** Ask whether the agent can undo the action itself and whether the consequences are acceptable if it is wrong. If either answer is no, a second key is required, and that key must belong to someone other than the agent. Log why the second key was needed. - **Canary feature-flag example.** The agent can raise a flag from 0 to 100 on canary traffic and read errors, but cannot push the flag to production. It can only suggest that a person do that after canary testing. The speaker's own flag work runs through the agent in Slack, with the speaker not in the loop. - **Where the rules live.** Text (prompts, context markdown) states intent and is cheap to change but only advisory; the speaker says the agent follows it about 80% of the time. The infrastructure proxy does not read the prompt. It counts, compares and returns a 403 on a deletion or budget overrun, and prompt injection does not move it. - **Identity comes from infrastructure.** The proxy stamps every outgoing request with an identity the agent cannot set. The speaker's example is an agent that renames itself "Sachin 2" to get a fresh budget. Each session also gets a session ID, so overactive sessions can be separated out. In a Kubernetes example, the stamp is written as a label and child tasks inherit it, so every quota, speed limit and approval reads one tag. ## Actionable Takeaways 1. Give agents actions whose errors show up immediately, and keep a human on actions whose errors stay silent. 2. Set a self-renewing limit on each destructive right, so no one has to file a ticket to get more budget. 3. Monitor aggregate metrics, such as investigation threads per hour on test failures, rather than individual calls. 4. Run the cancellation test (can the agent undo it, and are the consequences acceptable?) on every write operation to decide whether a second key is needed. 5. Have the proxy layer stamp identity, and let the agent's own claimed identity count for nothing. ## Notable Quotes > "The agent technically didn't do anything that I couldn't do." — Sachin Malhotra > "The budget has a completely different form." — Sachin Malhotra > "Verbs ask what the agent is touching." — Sachin Malhotra --- *Related: `@content/youtube/dan-martell/you-only-need-6-months-to-change-your-life` · `@content/youtube/aie/why-your-enterprise-tech-stack-isn-t-ready-for-ai-agents-christopher-lovejoy-saul-howard` · `@content/youtube/aie/60-of-our-data-prs-now-merge-with-no-human-review-chetas-joshi-robinhood` · `@content/youtube/aie/finops-for-ai-agents-who-spent-all-the-tokens-tisha-chawla-susheem-koul-microsoft` · `@content/youtube/aie/your-pr-says-the-tests-passed-prove-it-stephen-chin-cassandra-chin`* --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*