← All AI Engineer talks

AI Engineer World's Fair 2026

Give the Agent a Budget, Not a Token — Sachin Malhotra, Anthropic

Read the talk

Give the Agent a Budget, Not a Token

Sachin Malhotra explains how to bound agent autonomy with asymmetric permissions, replenishing rate limits, aggregate monitoring, and trusted identity—using recovery cost to decide where humans must remain involved.

From a talk by Sachin Malhotra

At a glance

Ideas worth remembering

  • Useful delegation requires more than permission: bound action volume and speed, consider recovery, and specify who will notice failures.

  • Visibility and reversibility are separate tests. Reenabling a test exposes failure; skipping it may hide a bug. An action also needs independent authorization when the agent cannot recover it or its impact is unacceptable.

  • Rate limits and trip wires serve different purposes: limits reject excess activity, while trip wires alert people to aggregate behavior after actions occur. Human-only overrides preserve an escalation path.

  • Context explains policy; infrastructure enforces it. Cheap instruction changes can improve behavior, but deterministic checks must remain effective when the agent ignores or misinterprets the guidance.

  • Budgets depend on trusted identity. A credential-holding proxy must stamp calls, and that identity must propagate to downstream work; caller-selected names would allow fresh budgets and undermine attribution.

What happens after the demo ships

Sachin Malhotra introduces the problem from the perspective of CI engineering: test quarantining, merge automation, autoscaling, and merge queues form the machinery that helps a few thousand engineers ship code safely. An impressive agent demo can make broad credentials look sufficient. Give an agent a powerful token and some tools, and it can build and deploy a coffee website. Production exposes a harder question: how much damage can the same autonomy cause when an ordinary operation goes wrong?

His opening incident began with cleanup. An agent listed workloads it no longer needed and attempted to delete them. One stage of the command pipeline evaluated to nothing, dropping the filter and leaving a selector that matched everything. About 200 workloads disappeared in 90 seconds, affecting about 20 engineers. Some were long-running training jobs; Malhotra says some might not have been checkpointed, potentially losing hours of progress. The agent was trying to tidy up, so malicious intent was unnecessary for a large failure.

A token and a tool list had provided permission without sufficiently bounding its consequences. Malhotra proposes three controls—asymmetric verbs, rate limits, and trip wires—and an undo test for deciding how to configure them. The distinction matters: the first three become operational controls, while the undo test is a question used to size those controls.

0:250:29
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:01 · section reference included

Turn permission into a bounded operating budget

The agent had used Malhotra’s own token and had done nothing outside his permissions. He locates the failure in delegating unbounded power while giving the work limited attention. His analogy is onboarding an engineer: teams do not watch every keystroke, but they provide escalation paths and place catastrophic actions structurally out of reach. Agents need similarly explicit operating rules, especially because they can keep working without tiring and can be confidently wrong.

Removing delete permission would prevent that particular operation, but it also blocks legitimate cleanup. Eventually a human must execute those routine actions by hand. Malhotra describes a static token scope as a boolean: an operation is permitted or it is not. Too little permission makes the agent ineffective; too much exposes the system to incidents. His objection is to treating that binary choice as the whole delegation policy.

An operational budget has four dimensions: how much the agent can do, how fast it can act, what it can undo itself, and who notices while it acts. This allows useful autonomy within a defined envelope. The design question becomes how to bound an allowed action’s volume, pace, recoverability, and visibility.

3:123:14
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:06 · section reference included

Separate operations by how their failures appear

A verb is an operation an agent can perform through an API, CLI, or other tool. Two operations on the same resource can have very different consequences. Reenabling a test incorrectly makes CI fail visibly. Skipping a test incorrectly can let a real bug reach production under green checks. The changes may look equally small, but one exposes a problem while the other suppresses the signal that would reveal it.

Malhotra’s rule is to give agents operations whose failures become visible and involve a human in operations that can fail silently. Paging illustrates the tradeoff: an unnecessary page inconveniences the on-call engineer, but it also brings a person into the loop who can correct the mistake. Visible failure still has a cost; its advantage is that it creates an opportunity for intervention.

His team’s test-quarantining service holds tests that an on-call engineer has skipped during an incident. The agent can assess those tests and reenable them. If it makes the wrong call, failed builds make the problem apparent and a human can cheaply restore the quarantine. Skipping remains a human emergency operation because it can conceal a production bug. Both skip and unskip calls carry an identity stamped by an intervening proxy; the agent does not write its own provenance into the audit record.

5:505:53
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:47 · section reference included

Give every write a ceiling that refills

Rate limits turn the budget into a concrete constraint. Each caller receives a small allowance of disruptive actions per time window and can spend it autonomously. Once the allowance is exhausted, requests are rejected with a count indicating that the budget has been exceeded. Waiting replenishes the allowance. This bounds the pace of a damaging loop while allowing routine work to proceed without repeated approvals.

Malhotra calls for a rate limit on every write, with the allowance adjusted to the operation’s context. Deleting resources in a caller’s own namespace might receive a larger budget than modifying resources in a shared namespace. The common rule is that writes are bounded; the quantity reflects the potential disruption.

After the deletion incident, a neighboring team built an admission webhook that caps deletes per hour, per resource kind, and per namespace. A bypass exists for legitimate exceptional work, but it refuses to operate inside an agent session. Instead, it tells the agent to ask a human to run the command. The agent retains its ordinary budget, the human retains the override, and normal replenishment requires no ticket. The talk does not specify the exact numerical cap.

8:348:36
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

8:26 · section reference included

Watch aggregate behavior and respond to what happens

Malhotra contrasts an allow list, which anticipates what an agent will need, with a trip wire, which detects what its activity actually produces. For cheap actions, the agent can act while each action is recorded with trusted actor identity. Rate limits enforce a hard boundary; trip wires make the resulting behavior observable. Their focus is the aggregate, where a collection of individually plausible calls can reveal a problem.

His team tracks the number of investigation threads an agent launches per hour for a given test-job failure. In one example, that count rose far above its baseline and paged the on-call engineer. The alert occurred after the writes, so it was a detector rather than a preventive gate. It also needed an actual recipient: an unseen trip wire provides no useful response.

The agent had opened investigations for dozens of jobs with the same error signature. Each investigation looked reasonable in isolation, but together they pointed to a shared infrastructure failure. The correction was to add guidance to correlate failures across jobs before launching separate investigations. Malhotra reports that the agent followed that guidance the next time. This illustrates the feedback loop he favors: observe aggregate behavior, identify a missed relationship, and improve the agent’s context with a small, concrete instruction.

10:1010:12
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

10:05 · section reference included

Use recoverability to decide who holds the second key

The undo test asks two questions: can the agent restore the previous state itself, and is the impact of a wrong decision acceptable? This differs from asymmetric verbs, which ask whether a failure will be noticed. Visibility and recoverability are separate properties. If the agent can roll back and the impact is acceptable, Malhotra recommends logging the action and allowing it. Otherwise, someone else must hold a second key, with an audit record explaining the action and the additional authorization.

Feature flags show how this works outside CI. In the canary environment, described as staging traffic and dogfooding customers, the agent can move a rollout from zero to 100, inspect filed bugs, and toggle the feature off or on. Its key cannot promote the flag into production. It can propose promotion based on canary testing, but a separate production-scoped key supplies the authority to proceed. Separate credential scopes can therefore implement the second key without requiring an entirely new authorization system.

In daily use, Malhotra asks the agent through Slack to own the rollout loop. It may clarify the intended audience, such as an internal dogfooding group or early access, and then carry out the allowed work without placing him between every step. Each action bears the agent’s identity rather than his. The delegation gives the agent operational responsibility while preserving attribution.

12:1612:20
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

12:12 · section reference included

Choose controls for the consequences of each action

The controls address different questions: which operations the agent performs, how frequently it performs them, and what observers learn afterward. The undo test helps size the restrictions. Applied retrospectively to the workload incident, Malhotra says a rate limit would have restricted deletion to roughly tens of workloads. A running job in someone else’s namespace cannot simply be undeleted, so exceeding the cap would require a human with the second key. This would limit the loss; it would not make deletion harmless.

Every operation does not need every check. The relevant combination depends on the action being evaluated. Malhotra returns to the onboarding analogy: define what the agent can touch, how much freedom it receives, who authorizes exceptional operations, and how the team knows the arrangement is working.

14:2714:29
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

14:27 · section reference included

Put intent in text and enforcement in infrastructure

Policy lives in two places. Prompts and Markdown context files explain what the agent should do and why. They are cheap to change and can express the reasoning behind a rule. Malhotra says the guidance he described works about 80% of the time in his experience; that is a reported observation, not a guarantee. Context files also need maintenance as they grow. Their fundamental limitation is that they offer advice rather than enforcement.

Infrastructure supplies the hard boundary. In the proxy layer he describes, enforcement does not interpret the prompt or evaluate the agent’s explanation. It sees an operation, counts it against the budget, and permits or denies it; exceeding the budget returns a 403. This narrow, deterministic rule cannot be persuaded by a prompt injection to disregard its count. Text guides the agent’s intent, while infrastructure bounds the consequences when that guidance fails.

15:3015:34
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

15:30 · section reference included

Make identity follow the work

Each agent session has a proxy running beside it. The agent reads its context files, then makes outbound calls through the proxy, which stamps those calls with agent identity. When a call launches a Kubernetes job, the cluster records that identity as a label. Child jobs inherit the same identity. The proxy does not need to follow the execution into the cluster: ownership checks, quotas, rate limits, approvals, and trip wires can all use the propagated stamp.

The caller must not control that identity. If an agent can set its own identity header, exhausting a budget can be followed by choosing another name and receiving a fresh allowance. A limit keyed to a freely changeable identity becomes optional. The proxy prevents this by holding the real credentials and stamping the identity it already knows, rather than accepting the identity the agent claims.

Proxy stamping also provides a session ID. When several sessions run for the same person, operators can distinguish them and identify which session is overreacting or behaving unexpectedly. Trusted identity therefore supports both enforcement and diagnosis: it determines whose activity consumes a budget and lets observers attribute the resulting behavior.

16:4716:48
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

16:42 · section reference included

An operating policy for autonomous writes

Malhotra closes with a practical operating policy: delegate verbs whose failures are visible, retain human involvement for failures that can remain quiet, and put a replenishing ceiling on every write. Observe aggregate behavior and improve the agent’s instructions where a sentence can address the mistake. Use the undo test to size these controls and any additional controls around write operations.

His final emphasis is the foundation beneath those choices: identity must come from infrastructure, not from the request. That establishes the stable basis on which the remaining budgets and controls can be tuned.

18:4918:51
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

18:49 · section reference included

Read the complete timestamped transcript
  1. 0:01

    [music]

  2. 0:12

    Hello. All right. Uh, let's get started.

  3. 0:16

    So, um, well, welcome to the talk. Give

  4. 0:20

    the agent a budget, not a not a token.

  5. 0:23

    Um, quick intro about me. My name is

  6. 0:25

    Sachin. Um, I'm an engineer on the CI

  7. 0:27

    team at Entropic. Uh we basically build

  8. 0:29

    and manage all of the test machinery for

  9. 0:31

    all the code that people write. Uh so

  10. 0:34

    everything from test quarantining to

  11. 0:35

    merge automation to CI autoscaling to

  12. 0:38

    merge cues, everything and anything in

  13. 0:39

    between. Um it's it's basically the

  14. 0:41

    plumbing that allows a few thousand

  15. 0:42

    engineers every day to ship code safely.

  16. 0:45

    Uh I've been at the company for a little

  17. 0:46

    over 10 months. I'm based out of

  18. 0:47

    Seattle. Um and outside of work, I love

  19. 0:50

    dialing my espressos and climbing some

  20. 0:51

    crazy mountains.

  21. 0:54

    So a lot of cool agent demos they they

  22. 0:56

    start with the same way really. So

  23. 0:58

    someone gives an agent a god token um

  24. 1:01

    and gives it an access to some sort of

  25. 1:02

    tool list and just watch as it goes. So

  26. 1:05

    and it does go like in in this

  27. 1:06

    particular example it it'll spin up like

  28. 1:08

    a cute little coffee website. It'll

  29. 1:10

    build all the pages, deploy them, uh

  30. 1:12

    bring it up live and it's done in 3

  31. 1:13

    seconds. Uh people will nod people will

  32. 1:16

    clap and someone will ship it into

  33. 1:18

    production. And this this talk is

  34. 1:20

    basically about what happens after that

  35. 1:22

    after the demo ships once the agent is

  36. 1:24

    starting to do some like real work in

  37. 1:26

    production. [snorts]

  38. 1:28

    So here's what after looked like in in

  39. 1:31

    our one of our scenarios. So what you're

  40. 1:33

    looking at is like a real command. Um

  41. 1:34

    the agent was trying to clean up after

  42. 1:36

    itself. Um it it was basically listing a

  43. 1:38

    bunch of workloads that were no longer

  44. 1:40

    interesting or useful to itself. Um and

  45. 1:42

    then it found them and deleted them. Now

  46. 1:45

    that's that's completely reasonable

  47. 1:46

    except one stage in the pipeline

  48. 1:49

    basically evaluated to nothing and the

  49. 1:51

    filter dropped out and now the selector

  50. 1:53

    matched everything.

  51. 1:56

    So you can see it took out about 200

  52. 1:58

    workloads uh which ended up impacting

  53. 2:00

    about 20 engineers worth of stuff and

  54. 2:02

    all of that was gone in 90 seconds.

  55. 2:05

    Nobody was being malicious in this case

  56. 2:07

    like the agent genuinely thought it was

  57. 2:09

    tidying up after itself. uh some of

  58. 2:11

    these workloads were long running

  59. 2:13

    training jobs and stuff. Maybe some of

  60. 2:15

    these were not even checkpointed and it

  61. 2:17

    was just like hours of progress that was

  62. 2:18

    gone poof in like 90 seconds and stuff,

  63. 2:21

    right? Um the the problem in in this

  64. 2:24

    case is that this idea of like here's a

  65. 2:27

    token and here's a tool list that is

  66. 2:29

    just like not enough like it just

  67. 2:31

    doesn't scale when the agent is starting

  68. 2:32

    to do some some like real work in

  69. 2:34

    production.

  70. 2:37

    >> So here's just a brief summary of like

  71. 2:39

    what we're going to talk about today. Uh

  72. 2:40

    I'm going to walk through three

  73. 2:42

    primitives um and asymmetric verbs. We

  74. 2:45

    we're going to look at some like rate

  75. 2:47

    limits. We're going to look at this idea

  76. 2:49

    of like trip wires over allow lists. And

  77. 2:51

    then I'm going to talk about this one

  78. 2:52

    lens that which I call the undo test

  79. 2:55

    that you can sort of use to size up the

  80. 2:57

    other three primitives. Uh so three

  81. 2:59

    things that you basically enforce and

  82. 3:01

    then one question you sort of ask about

  83. 3:02

    all of them.

  84. 3:06

    So here's basically what bugged me uh

  85. 3:09

    after the cleanup was done for the

  86. 3:10

    incident that I was just showing you. Uh

  87. 3:12

    the the agent technically hadn't done

  88. 3:14

    anything that I couldn't have done. Uh

  89. 3:16

    it was using my token after all. The the

  90. 3:19

    failure wasn't the model itself. The

  91. 3:20

    failure was that I was giving the agent

  92. 3:22

    unbounded amount of power to do

  93. 3:24

    something that I wasn't watching super

  94. 3:26

    intently. Um and it was we've basically

  95. 3:30

    solved this the same kind of problem

  96. 3:32

    except not for agents but like the first

  97. 3:34

    time you onboarded like a junior

  98. 3:35

    engineer on onto your own teams, right?

  99. 3:37

    So just think about it like we don't we

  100. 3:39

    don't basically sit around watching um

  101. 3:41

    every engineer or new boarded person

  102. 3:43

    just like type out every keystroke on

  103. 3:46

    their keyboard, right? Like we're not

  104. 3:47

    behind their chairs just watching

  105. 3:48

    everything that they're doing. Uh there

  106. 3:50

    is always a path on whenever a new

  107. 3:52

    engineer wants to ask for something. Um

  108. 3:53

    there is always an escalation path. uh

  109. 3:56

    the catastrophic stuff is just

  110. 3:58

    structurally out of reach for them. So

  111. 4:00

    the the other side of the coin is that

  112. 4:02

    the agents are very different. They they

  113. 4:04

    never get tired. They never sleep. And

  114. 4:05

    every so often they're just like very

  115. 4:07

    confidently wrong. Um and if I'm being

  116. 4:09

    honest, that's that's maybe most of us

  117. 4:10

    on the first month of our jobs anyways.

  118. 4:12

    And so what what we're going to talk

  119. 4:14

    about in a little bit in is just this

  120. 4:17

    idea of like your onboarding checklist,

  121. 4:19

    but written down as policy for for

  122. 4:20

    agents.

  123. 4:23

    So that and that brings me to the word

  124. 4:25

    in the title of my my talk here is that

  125. 4:27

    the the the standard fix for an incident

  126. 4:30

    like that is basically that you narrow

  127. 4:32

    the token scope, right? Like you just

  128. 4:34

    take the deletes away effectively. You

  129. 4:36

    would technically never do that for like

  130. 4:38

    a new hire, right? Like you would you

  131. 4:39

    wouldn't take the whole verb away from

  132. 4:41

    them. And it also doesn't work for an

  133. 4:43

    agent either. Maybe it works for about a

  134. 4:45

    week, maybe two, but then you eventually

  135. 4:47

    end up in a situation where the agent is

  136. 4:49

    genuinely trying to delete something

  137. 4:50

    that it feels like is just not in the

  138. 4:52

    infrastructure and you will just be

  139. 4:55

    there sitting and pressing enter by hand

  140. 4:57

    all over again. The the core concept

  141. 5:00

    with a token that I feel like is wrong

  142. 5:02

    is that a token is a boolean. It's just

  143. 5:03

    a yes or no. It's a static list of

  144. 5:05

    scopes. Um you either have it or you

  145. 5:08

    don't have it. So if the token list is

  146. 5:10

    too tight, then your agent is

  147. 5:12

    effectively useless. If the token list

  148. 5:14

    is too wide, then you're maybe writing

  149. 5:16

    writing like a postmortm. A budget is a

  150. 5:19

    very different shape. A budget is is um

  151. 5:22

    not just like one number. It just has

  152. 5:23

    like four different four different

  153. 5:25

    dimensions, right? How much can the

  154. 5:27

    agent do? Uh how fast can it do it? What

  155. 5:30

    can it undo on its own? And then who's

  156. 5:32

    noticing while it's actually taking

  157. 5:33

    those actions? And that's roughly the

  158. 5:36

    umbrella for like my four primitives. Uh

  159. 5:37

    is that each of the things that follow,

  160. 5:39

    they're basically being um one of the

  161. 5:41

    things along these dimensions. and

  162. 5:43

    they're going to replace a yes or no

  163. 5:44

    question with a budget.

  164. 5:47

    So, I'm going to start off with this

  165. 5:48

    first verb which I call asymmetric

  166. 5:50

    verbs. Uh, and by verbs I simply means

  167. 5:53

    operations or actions that an agent can

  168. 5:55

    take. So, like it could be API calls, it

  169. 5:56

    could be uh CLI commands, it could be

  170. 5:58

    really anything. And they're asymmetric

  171. 6:01

    because the same sized action even

  172. 6:03

    though it looks same size, they're they

  173. 6:05

    can have very different blast radius in

  174. 6:07

    actuality depending on which direction

  175. 6:08

    it goes. So the the core point is that

  176. 6:11

    you need to stop thinking about

  177. 6:12

    resources for a second and think about

  178. 6:14

    verbs. So specifically think about what

  179. 6:17

    happens when one of the verbs goes

  180. 6:19

    wrong. So some verbs they fail out loud.

  181. 6:22

    So in this particular example, let's say

  182. 6:23

    if an agent decides to unskip a test and

  183. 6:26

    say it's the wrong call, the worst that

  184. 6:28

    would happen is CI would go red uh for a

  185. 6:30

    bunch of people. Um same with paging.

  186. 6:32

    Like if an agent decides to page a human

  187. 6:34

    and if it's the wrong call, the worst

  188. 6:36

    that's happening is that it's a nuisance

  189. 6:38

    for the on call. But there's always a

  190. 6:39

    human to correct it. There are other

  191. 6:42

    verbs that fail silently, right? So if

  192. 6:43

    the agent decides to skip a test uh due

  193. 6:46

    to whatever reason, it shouldn't have.

  194. 6:48

    Nothing technically turns red. A real

  195. 6:50

    bug can actually walk into production

  196. 6:52

    with green checks and nobody would

  197. 6:54

    notice it until much later. So unskip

  198. 6:56

    and skip in this example, they're

  199. 6:58

    effectively the they're the same kind of

  200. 7:00

    action, but the difference is which of

  201. 7:02

    the failures would show up on a

  202. 7:03

    dashboard and which one wouldn't. And so

  203. 7:04

    the core idea is that you give um access

  204. 7:07

    to verbs that can fail out loud loudly

  205. 7:09

    on a dashboard to your agent and for the

  206. 7:11

    other ones just involve a human.

  207. 7:14

    Uh just a bit of context on CI stuff and

  208. 7:18

    how this plays out for us is that we

  209. 7:19

    have a test quarantining service behind

  210. 7:20

    the scenes and it basically holds a list

  211. 7:22

    of um all the tests that are currently

  212. 7:24

    skipped because an on call decided that

  213. 7:26

    it had to uh they had to like break

  214. 7:28

    glass a certain situation whenever there

  215. 7:29

    was like an incident or something. Now

  216. 7:31

    the agent has the ability to reenable

  217. 7:34

    any one of these own depending on like

  218. 7:35

    when it evaluates when the tests are uh

  219. 7:38

    working fine and stuff. Again if it's

  220. 7:40

    the wrong call the worst that would

  221. 7:41

    happen is a bunch of different builds

  222. 7:42

    and tests would just like start showing

  223. 7:44

    up red and then a human can actually put

  224. 7:45

    them back very cheaply. The skip is a

  225. 7:48

    break glass verb itself right like it's

  226. 7:50

    basically as I mentioned what our on

  227. 7:51

    call would reach for uh during a very

  228. 7:53

    critical situation during under pressure

  229. 7:54

    and stuff. And so in that scenario if

  230. 7:57

    like uh an agent actually gets it wrong

  231. 8:00

    a real production bug can actually a

  232. 8:01

    real bug can walk into production. So

  233. 8:03

    this needs a human and it will always

  234. 8:05

    leave an audit trail. Uh and the key

  235. 8:07

    detail is that the agent itself is not

  236. 8:09

    responsible for writing the row or the

  237. 8:10

    audit trail itself. There is a proxy in

  238. 8:12

    the middle that I've highlighted that

  239. 8:13

    I'm going to talk about in a little bit.

  240. 8:14

    Uh which is responsible for stamping the

  241. 8:16

    caller's main identity on every call

  242. 8:18

    whether it's a skip or an unskip. um the

  243. 8:21

    agent technically never holds uh the pen

  244. 8:24

    on its own provenence.

  245. 8:26

    The second primitive is about rate

  246. 8:28

    limits. Uh it's pretty standard concept

  247. 8:30

    but and this is the most concrete form

  248. 8:32

    of like the budget idea as a whole. So a

  249. 8:34

    ceiling that refills. So every caller

  250. 8:36

    gets a small amount of disruptive

  251. 8:38

    actions uh per time window. So you can

  252. 8:41

    spend them however you want. Uh there's

  253. 8:42

    no approval, there's no waiting. And if

  254. 8:44

    you cross the line, the request simply

  255. 8:46

    bounces back with a count saying that

  256. 8:47

    you're actually exceeding your count um

  257. 8:49

    your budget. You wait a bit and then the

  258. 8:51

    limit essentially refills. And that's

  259. 8:53

    that's the whole thing. So the agent

  260. 8:55

    gets full autonomy within the limit. And

  261. 8:57

    there is a hard ceiling on how bad a

  262. 8:59

    single loop can get. And every write

  263. 9:01

    effectively gets a rate limit. There are

  264. 9:03

    no exceptions to that. What changes is

  265. 9:05

    the size of the rate limit. So if if if

  266. 9:07

    I'm if I'm trying to delete a bunch of

  267. 9:08

    workloads in my own name space like my

  268. 9:10

    my rate limit might be higher but if I'm

  269. 9:12

    trying to touch resources in a shared

  270. 9:13

    namespace my budget or my rate limits

  271. 9:15

    might be smaller.

  272. 9:19

    So this is uh effectively the

  273. 9:21

    solutioning for the incident that I was

  274. 9:23

    showing earlier. Um after the incident

  275. 9:24

    the team sort of that sits next to mine

  276. 9:26

    they they built an admission web hook of

  277. 9:28

    sorts uh whose sole job is to cap the

  278. 9:31

    number of deletes at a fixed number per

  279. 9:33

    hour per resource kind per name space.

  280. 9:35

    There is always a bypass flag because

  281. 9:37

    sometimes you genuinely want to delete

  282. 9:39

    more than you're allowed for and maybe

  283. 9:40

    some on call scenario or whatever. And

  284. 9:42

    the part that I absolutely love in this

  285. 9:44

    case is that inside a cloud code session

  286. 9:46

    or inside an agent session effectively

  287. 9:48

    the the bypass flag simply refuses to do

  288. 9:50

    anything. All it's going to do is tell

  289. 9:52

    the agent to ask the human to run the

  290. 9:53

    command itself. So the agent effectively

  291. 9:56

    gets the rate limit and the human keeps

  292. 9:58

    the override and nobody effectively has

  293. 10:00

    to file a ticket for uh the limit

  294. 10:02

    because it just like refills.

  295. 10:05

    The third primitive is about this

  296. 10:07

    concept of trip wires over allow lists.

  297. 10:10

    So in my mind like an allow list is

  298. 10:12

    effectively a guess that you're making

  299. 10:13

    up front about what the agent needs or

  300. 10:16

    about model behavior or agent behavior

  301. 10:17

    itself. uh I feel like it's pretty

  302. 10:19

    static and you write it up front before

  303. 10:21

    before you have any data on like how the

  304. 10:22

    agent is behaving in different

  305. 10:24

    situations. A trip wire on the other

  306. 10:26

    hand is how you get that data like after

  307. 10:28

    the fact. So for cheap actions you let

  308. 10:30

    the agent act and every action gets

  309. 10:32

    recorded with the actor sort of stamp

  310. 10:34

    identity stamp and these two kind of go

  311. 10:36

    well together like rate limits are the

  312. 10:38

    enforcement um they they put a hard

  313. 10:40

    limit on uh the rate itself. Trip wires

  314. 10:43

    are how you find out what actually

  315. 10:44

    happened so you've got something to

  316. 10:46

    react to. So you effectively watch the

  317. 10:49

    aggregate and not like individual calls.

  318. 10:51

    And usually when a trip wire goes off

  319. 10:52

    the fix is like maybe one or two lines

  320. 10:54

    in the agents context and not really a

  321. 10:56

    big code change. Uh the core point is

  322. 10:58

    that allow lists don't really get better

  323. 10:59

    over time. They can get stale but trip

  324. 11:01

    wires do get better over time.

  325. 11:04

    So here's like a loopin practice for us.

  326. 11:06

    So like we track one number uh which is

  327. 11:08

    the number of investigation threads that

  328. 11:10

    our agent is launching per hour for a

  329. 11:12

    given test job failure. So one morning

  330. 11:14

    say the number was way above the

  331. 11:15

    baseline and the trip fire page is on

  332. 11:17

    call and that part's important because a

  333. 11:19

    trip wire that nobody sees is

  334. 11:21

    practically useless. Uh it pages after

  335. 11:23

    the right has already happened after the

  336. 11:25

    the limit has been crossed not before.

  337. 11:27

    It's effectively the smoke detector not

  338. 11:29

    the lock on the door. Uh the agent has

  339. 11:31

    spun up in this particular scenario a

  340. 11:33

    bunch of like investigation threads for

  341. 11:34

    dozens of job that were all failing with

  342. 11:36

    the same kind of error signature. Each

  343. 11:39

    thread effectively looked reasonable on

  344. 11:40

    its own, but like if you took them in

  345. 11:42

    aggregate, you would realize that it was

  346. 11:43

    actually an infrastructure failure that

  347. 11:44

    was causing the same test failure

  348. 11:46

    signatures across the board. So the fix

  349. 11:48

    in this case was as simply as telling

  350. 11:51

    the agent on like, hey, the next time

  351. 11:52

    you encounter something like this, maybe

  352. 11:53

    try to correlate a bunch of different

  353. 11:55

    failures and test jobs and stuff before

  354. 11:57

    launching a separate investigation

  355. 11:59

    thread. So that correlation is

  356. 12:00

    important. Um and the next time when

  357. 12:02

    this happened, uh it did exactly that

  358. 12:04

    because that that example and that line

  359. 12:05

    of like how it should react and like how

  360. 12:07

    it should like uh debug things was was

  361. 12:09

    right there to guide it.

  362. 12:12

    So that's three rough primitives. Now

  363. 12:14

    the lens I mentioned at the start is

  364. 12:16

    this idea of undo test. And this one's

  365. 12:18

    slightly different. It's it's not

  366. 12:20

    something you effectively enforce in

  367. 12:21

    code. It's the question you ask when

  368. 12:22

    you're sizing the other three. So it's

  369. 12:25

    two questions really. One, can the agent

  370. 12:27

    put it back by itself? and how bad would

  371. 12:29

    the impact be if it actually got it

  372. 12:31

    wrong. And this this this sounds like

  373. 12:34

    asymmetric verbs in a sense, but it's

  374. 12:35

    kind of difference because the verbs ask

  375. 12:38

    whether you would notice the failure and

  376. 12:40

    undo asks whether you can recover from

  377. 12:42

    it. So if if if the agent can

  378. 12:45

    effectively roll back its own change and

  379. 12:47

    the blast radius is acceptable to you,

  380. 12:49

    you effectively log it and you let it

  381. 12:50

    go. If either of the answers is no, then

  382. 12:53

    you effectively need a second key and

  383. 12:55

    the second key is not something that the

  384. 12:57

    agent holds itself. It has to be someone

  385. 12:59

    else. Um, and there has to be an audit

  386. 13:01

    record so that you can you can track on

  387. 13:03

    like what happened, why the second key

  388. 13:04

    was involved and stuff like that.

  389. 13:07

    Let me let me just show you this another

  390. 13:09

    example of like how this works outside

  391. 13:10

    of like the CI domain specifically. So

  392. 13:12

    our agent has a key for one of our

  393. 13:14

    feature flag services. So on the canary

  394. 13:16

    side which is basically our staging

  395. 13:18

    traffic and a bunch of like dog fooding

  396. 13:19

    customers the agent effectively has the

  397. 13:21

    full dial. It has the ability to um ramp

  398. 13:24

    up a specific feature flag roll it out

  399. 13:25

    to uh all of the canary traffic and it

  400. 13:28

    can take it all the way from zero to 100

  401. 13:30

    and it also has the ability to sort of

  402. 13:32

    uh look at any bugs that are being filed

  403. 13:33

    and toggle it back off and on. What the

  404. 13:35

    agents key is not scoped to do is for

  405. 13:37

    promoting the flag to real production.

  406. 13:39

    The best that an agent can do for now in

  407. 13:41

    a lot of cases is that it can propose uh

  408. 13:43

    that an that someone actually promote

  409. 13:45

    the feature flag in production because

  410. 13:46

    it's been tested out in Canary. But

  411. 13:48

    that's pretty much it. Um the second key

  412. 13:51

    in this scenario is not necessarily a

  413. 13:53

    new O system. It's a scoped key for

  414. 13:55

    production and a scoped key for Canary.

  415. 13:59

    So this is what it looks like day-to-day

  416. 14:01

    for for me personally. is like I I ask

  417. 14:03

    cla tag in our slack channel to to own

  418. 14:06

    the loop the entire loop uh on on

  419. 14:08

    rolling out a flag. It can it can

  420. 14:09

    basically ask me a clarifying question

  421. 14:11

    on whether this is for internal dog

  422. 14:12

    fooding group or early access or

  423. 14:13

    whatever. Uh and the important part is

  424. 14:16

    that I'm not in the middle of any of

  425. 14:17

    these things. Every action that the

  426. 14:19

    agent is taking is stamped with its own

  427. 14:21

    identity and not mine. And that stamp is

  428. 14:23

    basically what ties the whole thing the

  429. 14:24

    whole thing together.

  430. 14:27

    So the these these primitives they

  431. 14:29

    compose together nicely because each one

  432. 14:31

    asks us a different question right the

  433. 14:32

    verbs ask what the agent is touching the

  434. 14:35

    rate limit asks how often and the trip

  435. 14:37

    wires catch what happened afterwards and

  436. 14:39

    the undo test is sort of the length that

  437. 14:40

    I personally used to to size all these

  438. 14:42

    three now the original sort of cold open

  439. 14:45

    delete that I was showing you the the

  440. 14:46

    incident itself the rate limit itself

  441. 14:48

    would have capped it at a few couple of

  442. 14:50

    tens of workloads itself the undo test

  443. 14:53

    if you would be thinking about it it

  444. 14:54

    will basically tell you that you can't

  445. 14:55

    unddelete a running job in someone

  446. 14:56

    else's namespace. Um so so anything past

  447. 14:59

    the cap basically need a human with the

  448. 15:01

    with a with a second key. So the the

  449. 15:04

    important part is that you don't need

  450. 15:05

    all the checks in every right scenario.

  451. 15:07

    Only some of these might be relevant for

  452. 15:08

    like whatever kind of action you're

  453. 15:10

    trying to evaluate. Uh and if any of

  454. 15:12

    these really sound familiar, it it

  455. 15:14

    should because this is effectively some

  456. 15:16

    sort of onboarding checklist for your

  457. 15:17

    engineers like what can a new engineer

  458. 15:19

    touch, how much rope do they get, who

  459. 15:21

    signs off on their operations, and how

  460. 15:23

    do we know it's effectively working? We

  461. 15:25

    just wrote it for people. It's now the

  462. 15:27

    same checklist that we want for agents.

  463. 15:30

    So where does all the policy that I've

  464. 15:32

    been talking about really live? Uh it's

  465. 15:34

    two places and I feel like you need

  466. 15:35

    both. The first one is text. Uh that's

  467. 15:38

    prompts. That's your context files

  468. 15:40

    markdown the agent reads before it can

  469. 15:42

    act. And this is where you can explain

  470. 15:43

    your why the the intent. We've we got

  471. 15:45

    exactly the same sentence that I was

  472. 15:47

    showing earlier um written down in a

  473. 15:48

    markdown file. It works about 80% of the

  474. 15:51

    time. Uh the the upside is that it's

  475. 15:53

    very cheap to change and you can explain

  476. 15:55

    the reasoning. The downside is you have

  477. 15:57

    to garden it because the the files can

  478. 15:59

    grow over time and at the end of the day

  479. 16:00

    it's just advice. Uh text can shape the

  480. 16:03

    intent but there is no enforcement

  481. 16:05

    anywhere. The the second place is

  482. 16:07

    infrastructure uh which is the proxy

  483. 16:09

    layer for us. So the proxy is is not

  484. 16:11

    reading the prompt. It doesn't know why

  485. 16:13

    the agent wants to do something and it

  486. 16:15

    doesn't really care. It will see a

  487. 16:17

    delete happening. It'll see like a

  488. 16:18

    budget being crossed and it'll simply

  489. 16:20

    return a 403 and that's the whole

  490. 16:21

    conversation really. It's narrow. It's

  491. 16:23

    deterministic. It it counts, compares,

  492. 16:26

    it can allow a delete or deny. What it

  493. 16:28

    can't do is explain the why and a clever

  494. 16:31

    like prompt injection cannot really talk

  495. 16:32

    it out of the rule itself. So you need

  496. 16:35

    both. Uh the text shapes what an agent

  497. 16:37

    is trying to do and infra is bounding

  498. 16:39

    how wrong can it go.

  499. 16:42

    So zooming out, this is where uh the the

  500. 16:45

    infrastructure sort of really lives for

  501. 16:47

    us. So like every agent session has its

  502. 16:48

    own proxy running right next to it. The

  503. 16:51

    agent starts off by reading its own

  504. 16:52

    context file. The the markdown files

  505. 16:54

    that I was showing earlier that's that's

  506. 16:55

    the text layer and every outbound call

  507. 16:57

    goes through the proxy after that point

  508. 16:59

    which is the infrastructure layer. So

  509. 17:00

    the proxy is not like whatever the agent

  510. 17:03

    is trying to do the the proxy is only

  511. 17:05

    responsible for stamping that action

  512. 17:06

    with the agent's identity. Uh like if

  513. 17:08

    the if the if the agent is trying to

  514. 17:10

    launch a bunch of jobs in a Kubernetes

  515. 17:11

    cluster the the proxy is not following

  516. 17:13

    it. what is following is the stamp

  517. 17:15

    itself, the identity itself. So the in

  518. 17:18

    this example, the cluster would write

  519. 17:20

    the stamp onto the job as a label. Um

  520. 17:22

    and every child job or anything that's

  521. 17:24

    happening afterwards simply inherits the

  522. 17:25

    same identity and the every safeguard

  523. 17:29

    that is there in the rest of our systems

  524. 17:30

    that that are simply they're simply

  525. 17:32

    reading that like one label. Uh whether

  526. 17:34

    it's ownership, whether it's kotaas,

  527. 17:35

    rate limits, approvals, trip wires,

  528. 17:37

    whatever it is, they're all keyed on the

  529. 17:39

    same stamp and the agent never got to

  530. 17:41

    touch it.

  531. 17:43

    So that's roughly the shape of it. But

  532. 17:45

    before I wrap up, I want to spend like

  533. 17:47

    30 seconds on why it has to be a proxy

  534. 17:49

    layer, like a different layer that is

  535. 17:50

    doing the stamping on this identity and

  536. 17:52

    not the caller itself. Because without

  537. 17:54

    it, the agent can roughly pick a

  538. 17:55

    different name. Um, and every limit that

  539. 17:57

    you've basically set resets.

  540. 18:01

    So say the agent has the ability to set

  541. 18:04

    its own identity in a header, right? So

  542. 18:06

    let's say it hits a specific limit and

  543. 18:08

    what's the easiest fix from an agent's

  544. 18:10

    point of view that it can do? it'll just

  545. 18:12

    change the header. In this case, it'll

  546. 18:13

    just say instead of such in such in two

  547. 18:15

    and voila, you just have a fresh budget

  548. 18:18

    to work with. Now, in this case, you

  549. 18:20

    technically don't have a rate limit. You

  550. 18:21

    just have a suggestion. Uh with the

  551. 18:23

    proxy in the path, the agent never gets

  552. 18:25

    to say who it is. The proxy already

  553. 18:27

    knows. It's the thing that's holding

  554. 18:28

    real credentials and it stamps every

  555. 18:31

    call with the identity that it already

  556. 18:32

    knows, not the one that agent claims.

  557. 18:35

    And because proxy is the one that is

  558. 18:36

    stamping, you also get this per session

  559. 18:39

    ID so that you're able to differentiate

  560. 18:40

    different sessions that are running all

  561. 18:42

    for you and see which one's overreacting

  562. 18:44

    or which one's not acting as it's

  563. 18:46

    supposed to be.

  564. 18:49

    U so again just stuffs that I want you

  565. 18:51

    to take home with is give the agent

  566. 18:54

    access to verbs that would fail out loud

  567. 18:56

    uh and keep the human on the ones that

  568. 18:58

    can fail out quietly. Two, you you put a

  569. 19:00

    ceiling on every right and that has the

  570. 19:02

    ability to refill on its own so nobody's

  571. 19:04

    effectively filing tickets. Three, you

  572. 19:06

    watch the aggregate and not the

  573. 19:08

    individual calls that help you

  574. 19:09

    understand the agents behavior. Um, and

  575. 19:12

    then you fix whatever you can with the

  576. 19:13

    sentence. And four, you use the undo

  577. 19:16

    test to sort of size all of these three

  578. 19:18

    or any other u primitive that you have

  579. 19:20

    for your own write operations. And

  580. 19:22

    underneath all of this uh is is this

  581. 19:24

    concept of identity which has to come

  582. 19:25

    from the infrastructure, not from the

  583. 19:27

    request. I feel like that's one rule. If

  584. 19:29

    you get that one rule right, everything

  585. 19:31

    else is uh just just tuning.

  586. 19:34

    Thank you.

  587. 19:35

    [applause]

  588. 19:50

    [music]