What a $900M Bank Error Teaches Us About AI Agents - John Feminella, Two Sigma

AI Engineer · 18 min · 207 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:01[music]
  2. 00:12Uh my name's John Feminella.
  3. 00:14I work on AI architecture and engineering at Two Sigma, which is a hedge fund here in New York.
  4. 00:20Before I get too far into things, I have a legal disclaimer slide that I have to show you.
  5. 00:24It says two things.
  6. 00:26One, I promise not to sell or market or offer you any securities at any point in this talk.
  7. 00:31And two, everything in this is my own opinion and not the opinion of Two Sigma.
  8. 00:35All right, thanks for indulging me.
  9. 00:36If I don't say those magic words, the 5G microchips implanted in me will explode.
  10. 00:44So, that slide is a good example, actually, of how our industry is regulated.
  11. 00:48And as a regulated company with lots of controls, I think one thing that's always interesting is to explore what happens when controls fail, because that gives you a good idea about why the controls were there in the first place.
  12. 01:00And so, I'd like to tell you a story about that by showing you another legal slide.
  13. 01:05After August 2020, a very interesting contract clause suddenly started showing up in a bunch of commercial loan agreements.
  14. 01:12And this clause essentially tries to prevent a certain scenario from happening.
  15. 01:16And it's complicated, but I'll explain it like this.
  16. 01:18Let's say that you're a lemonade stand business, and you borrow money from a lender to capitalize your lemonade stand.
  17. 01:24And the bank that's overseeing that transaction, that's in the middle between the borrower and the lender, sends the lender all of the money that you owe in a catastrophic
  18. 01:36mistake.
  19. 01:38You'd probably be mad and want the money back, but the lender might also say, "No, thanks.
  20. 01:41You paid us back and we're all good, so we'd rather keep the money."
  21. 01:45Something like this happened in August 2020.
  22. 01:48Revlon, the cosmetics company, had borrowed money under a big 2016 term loan.
  23. 01:54And that loan was split up into a bunch of pieces across 300-plus lenders, hedge funds, credit funds, CLOs, other banks.
  24. 02:02And in the middle is Citibank, the administrative agent.
  25. 02:05Being the agent in this kind of transaction means that you're performing the plumbing that connects the borrowers with the lenders and managing the life cycle of the loan.
  26. 02:13So, in this transaction, Revlon pays City and then City pays the lenders.
  27. 02:17And City's not lending its own money, it's just in the middle moving people's money around.
  28. 02:22So, here's the plan for August 11th, 2020.
  29. 02:26Revlon would pay about 8 million bucks of accrued interest to both groups and the lenders' principal would roll into this new facility.
  30. 02:33That's an exchange of paper, not cash.
  31. 02:35So, the remaining lenders' principal would stay put.
  32. 02:38And the idea here is that only interest should be going out, principal should not be moving at all.
  33. 02:44And the bank had a piece of internal processing software called Flexcube.
  34. 02:48Isn't that a fun enterprise software name?
  35. 02:51So, in Flexcube, the easiest way to do this kind of transaction is to pretend to record it like Revlon were paying off the entire loan.
  36. 03:00And that triggers the correct interest payment calculations to everyone.
  37. 03:04You can probably guess what's about to happen next.
  38. 03:06So, you're supposed to send the principal portion to an internal wash account that you own as the bank, so that it's booked and recorded correctly, but it never leaves the bank's perimeter.
  39. 03:17So, keep your eye on that wash account.
  40. 03:19What was supposed to happen is that the boxes labeled uh front and fund and principal should all include the wash account number and should all have a check box checked next to them.
  41. 03:29So, unfortunately, it turned out that was what needed to happen, but for various arcane reasons, uh the boxes were not checked.
  42. 03:37And although Flexcube pops up a warning notification that says, "Uh-oh, money's about to leave the bank.
  43. 03:42Are you sure you want to do this?"
  44. 03:43That was correct.
  45. 03:44Money was supposed to leave the bank because they were making the interest payments.
  46. 03:48So, the three approvers who were supposed to approve that looked at it and said, "Yep, that's the right thing that's supposed to happen."
  47. 03:54And although that warning notification popped up, the human operators carrying out the transaction overrode that.
  48. 04:00Remember, Revlon was making that interest payment.
  49. 04:02So, the principal never went to the wash account, and instead Flexcube sent the entire outstanding principal of the loan to all of the 300 lenders, about $900 million instead of $8 million.
  50. 04:14So, every
  51. 04:14[snorts]
  52. 04:14lender got the amount that they would have been owed if Revlon had paid the loan in full, but Revlon didn't want to pay off the loan.
  53. 04:21It wanted to hold onto its money.
  54. 04:22That was a great deal for the lenders because remember, Revlon was in trouble at the time, so its loans weren't trading at face value, and getting all your money back on a deal
  55. 04:30that you thought was only worth 60 cents on the dollar is a great deal for you.
  56. 04:35So, they didn't want to give the money back even after Citi called them and said, "Please, that was a mistake.
  57. 04:39Give us the money back."
  58. 04:40And their argument was, "We shouldn't have to give the money back because you paid us in full, and that's how loans work.
  59. 04:45You eventually pay them back, and just because you paid it back at a different time than you were supposed to doesn't mean that we should have to give it back now."
  60. 04:52And so, to prevent that from happening, uh commercial loan agreements everywhere started including including a clause like that one.
  61. 04:58So, what does a payment error at a bank have to do with AI agents?
  62. 05:01Well, the bank had this procedure, it had these controls, and everybody did what they thought the right thing to do was.
  63. 05:07That's the problem I want to talk about for the rest of this talk.
  64. 05:09Every day, we're giving real agents real autonomy over systems like Flexcube.
  65. 05:15And how do we prevent accidents like that one from either from happening without locking everything down or just hoping we'll get lucky that they won't happen.
  66. 05:23So, here's the crux of the issue.
  67. 05:24You can't really know in advance what an agent will do, right?
  68. 05:27They're these non-deterministic systems.
  69. 05:29Uh and that sounds scary until you remember that humans are also non-deterministic systems, and they're going to make mistakes, too.
  70. 05:35And so, most firms don't choose to say, "Well, in order to reduce the risk of humans making a mistake, we're going to like lock them in rooms and prevent them from talking to each other, and they're all going to double-check everybody else's work, right?"
  71. 05:45We allow them a certain amount of autonomy along with a certain amount of controls.
  72. 05:49So, we give them boundaries, visibility, and we equip them with systems and controls that let them do their jobs effectively.
  73. 05:56So, in this sort of model, safety and innovation are not opposite ends of a spectrum that you must trade off on.
  74. 06:02There are things that you you at the same time.
  75. 06:04So, I think you can have your cake and eat it, too.
  76. 06:07And when we were thinking about what controls we wanted to apply to agents, we also looked at some approaches that didn't work for us.
  77. 06:12We don't want to sandbox or lock down everything, cuz a sandbox with no real access to systems is not is safe, but it's not very interesting or useful.
  78. 06:20If you let agents go wild and do whatever they want, that's uh, you know, maybe powerful and freeing from a cognitive perspective, but the isolation is very weak there, and that that approach is generally not suitable for highly regulated enterprises.
  79. 06:34And then, if you just have policy documents that agents look at or that are part of your uh, specification for the prompts, that's also not very enforceable at runtime.
  80. 06:43You can't guarantee that that will be part of the enforcement controls.
  81. 06:47So, what did work for us was thinking about what mix of controls would get us both safety and innovation at the same time.
  82. 06:54So, how do we provide boundaries and stop problems, but don't hinder folks from operating correctly?
  83. 07:00So, we have a number of these controls, but today I'll talk about five of them.
  84. 07:03And when I say controls here, what I mean are the guardrails and shared capabilities that let teams move in ways that don't hinder what they're trying to do.
  85. 07:13And we want to We don't want to reach some chasm that we need to cross to to let people get their work done before uh, and then make everyone wait while we build a bridge to get there.
  86. 07:24So, these controls are composable.
  87. 07:25Each one does one job, and then together, they let us run agents with real autonomy at an appropriate level of safety.
  88. 07:34So, the first problem is that agents were showing up everywhere.
  89. 07:37We have big teams with lots of agents running.
  90. 07:40We have small teams with a few.
  91. 07:41We have individual people running stuff in a uncontrolled way.
  92. 07:45And these come in every shape.
  93. 07:46Could be random chatbots.
  94. 07:48It could be MPC servers glued together in this Frankenstein hotchpotch.
  95. 07:52It could be cool notebook experiments.
  96. 07:54Could be really useful web tools for folks.
  97. 07:57But, it's hard to answer when you look at that a few simple questions, like who owns this?
  98. 08:03What tools does it have access to?
  99. 08:04What should it be doing?
  100. 08:05What should it is be doing?
  101. 08:06If if answer those kinds of questions, if you can't govern them, then you can't really also reuse that.
  102. 08:12So, you're tempted to build multiple solutions to the same problem if you don't know about what exists already, and then the firm can't also govern those in any kind of legible way.
  103. 08:23So, one thing that firms sometimes do here is add some kind of gate, like don't let anything run until everything is registered and approved and it's gone through this very onerous process.
  104. 08:32And that sounds safe, but if you look at what it does, the work, every idea, even some simple notebook experiment, is going to wait in line behind something that's really risky.
  105. 08:42And we don't um you know, we we don't want to subject everybody who's given the diversity of agents to exactly the same process.
  106. 08:49So, most people are going to give up, or they'll just get pushed to some shadow IT, less governed path that is um less visible, and then we don't get to see anything at all.
  107. 08:58So, that's what motivated the first control is an agent registry.
  108. 09:01You can't govern what you can't see.
  109. 09:03So, the agent registry makes agents legible, and it registers,
  110. 09:06[snorts]
  111. 09:06retrieves, and discovers the key facts about agents that we want to know for any agent.
  112. 09:12Um so, those are things like which tools it deploys, what endpoints it's going to talk to, which product does it belong to, who owns it.
  113. 09:19And humans, other programs, other agents can then use the agent registry to decide what's available at the firm, whether that's useful for them, and to go use that as the source of truth for other questions.
  114. 09:31So, this doesn't require extra effort on your part.
  115. 09:33It just happens when you use one of the firm's approved agent building frameworks, it's automatically registered, all that information is recorded there for you.
  116. 09:40And if you want to do a manual registration, you can certainly do that.
  117. 09:44So, the second problem we have is that now that we've got all these agents doing all these things, we
  118. 09:51[snorts]
  119. 09:51quickly notice that what they're doing is really different.
  120. 09:54And that means our agents carry really different risks, right?
  121. 09:57So, a thing that summarizes Jira linear tickets is really different than a production deployment agent that can touch a running system.
  122. 10:06And if we can use the same if we We to use the same review process to cover all of these agents, then
  123. 10:11[snorts]
  124. 10:11every agent is waiting in the same queue for weeks for human review, and if people are going to route route around slow processes, then we wind up in the same situation
  125. 10:19that we had before.
  126. 10:21So again, you might be tempted to say the answer is something like really detailed heavy manual review by all of these different constituencies.
  127. 10:27Again, that feels safe, but now we've got a trivial summarizer waiting 2 months for the same sign-offs as an agent that is touching production systems.
  128. 10:37And most of the good agent ideas, most of the ones that have value right away, start out as small experiments, and you don't want those people to wait in the same line as the stuff that's touching production right away.
  129. 10:49So the reviewers are drowning in these like low-risk requests, and the high-risk ones have to share that attention pool.
  130. 10:55So we don't want to trade away that speed if we can help it.
  131. 10:58So again, because not every agent needs the same review, and because most agents are purpose-built rather than open-ended.
  132. 11:04When I say open-ended here, you can imagine coding agents like Pi or Claude Code.
  133. 11:09When you open them and you start typing, uh Claude Code or Pi doesn't know what you're about to ask.
  134. 11:14It doesn't It doesn't circumscribe its purpose in any particular way, but most of the agents that are deployed in enterprises do have very specific purposes.
  135. 11:22When you're engaging with that agent, it's to do something specific that's well known and well understood.
  136. 11:28So they have a very specific reason for existing and a very circumscribed purpose.
  137. 11:32And you can tell these agents apart from each other by looking at what they declare up front, their tools, um the end points they access, the controls that that are applied to them, etc.
  138. 11:43So the third problem is that if you know about your agents and what they're doing, you'll quickly notice that many agents don't talk to each other, or sorry, they don't talk to just one thing or in just one capacity.
  139. 11:54The more open-ended the agent is, the more it looks like a Claude Code or Pi, the more it can do a variety and a diversity of different things.
  140. 12:03Call an internal API, run a tool like a web search, that sort of thing.
  141. 12:07And
  142. 12:07[snorts]
  143. 12:07each one of those is a different opening a different door to a different kind of risk.
  144. 12:12And if you give an agent an entitlement for a role account, then it can do a lot more damage than something that's just going to read a public web page, for example.
  145. 12:20So, the question is not can this agent do X, but what's the granularity that we need to solve for for the agent to act successfully?
  146. 12:29And again, one tempting answer is to kind of be heavy-handed here or to give every agent the same short allow list of stuff that's safe to do and then block everything else.
  147. 12:39Uh that's safe, but it's also useless.
  148. 12:41An agent that can't uh that can't search or can't call an API or can't do any of those things without asking somebody first can't really do the work that it was intended for.
  149. 12:50And then teams either give up on those agents or they find a way around the wall, and both outcomes are costly.
  150. 12:56So, a wide kind of blanket block on everything trades away the innovation that we want to preserve and avoids making a real decision about risk.
  151. 13:05Um and as author John Shedd wrote, "A ship in harbor is safe, but that is not what ships are for."
  152. 13:11So, the fix here is to let agents declare their purpose upfront and say what tools they're going to use or what tools they need access to.
  153. 13:21Um so, in the second column here, we might say that a research summarizer is going to be allowed to use a web tool to access research, but for a release deployer agent, we're not going to allow them to do that because they have no reason to use that tool.
  154. 13:38And so, if they try to ask for it, they won't get it by default.
  155. 13:41Um so, we don't need to make this kind of decision for every tool.
  156. 13:44The agents just have to say which tools they want.
  157. 13:46Right?
  158. 13:47And and you're as the agent author, you're in the best position to say, "I need these four things out of the 500 that are available."
  159. 13:55So, the way we need to enforce that is that when agents run in our managed environments, they look at the registry that we talked about before to look up what policies apply to it at initialization
  160. 14:07time.
  161. 14:07And that policy gets translated into enforcible statements, like which endpoints are you allowed to access, which hosts are you allowed to access, uh what other types of resources are available or not available to you.
  162. 14:19And in this way, nobody's writing a ticket every time they need to change the access, nobody's going to talk to IT or some other group outside of your team.
  163. 14:28As long as you conform to the risk score that we talked about before, and you're in the agent registry, you're you're governed, you're approved.
  164. 14:36So, this is how we keep the cost to teams really low for deploying, building, running agents.
  165. 14:42And the same control architecture works in a variety of settings.
  166. 14:46The next thing we noticed was that teams were building a a ton of different ways to evaluate agents, and every stack looks different, and some teams don't build anything at all.
  167. 14:54Sometimes you build like this really detailed stack for how your models work, sometimes it's sometimes there's nothing, and I think in general we'd be upset if teams were not writing unit tests, right?
  168. 15:06And we consider evals to be kind of the same thing.
  169. 15:08If models are changing, that's like a runtime dependency that your application has, and if your agent is going to change models, it doesn't know without the evals what's going to happen to its
  170. 15:20to its outputs and to the quality of those outputs.
  171. 15:23So, again, one tempting answer here is let's have some kind of central evaluation methodology that waits for a full eval suite and a committee sign off, but now every like prompt tweak, every one-line change is going to sit in that same queue.
  172. 15:37So, we don't want to put more decisions on more reviewers for things like that.
  173. 15:42We we don't want to trade away that iteration.
  174. 15:44So, again, you wouldn't ship software without unit tests, so agents need evaluations for the same reason, and we want to provide this stuff at the level of the firm that's going to be the same for everybody.
  175. 15:55So, team A writing evals, team B writing evals, they're both going to have many of the same features.
  176. 16:01So, we want to have one shared approach to how we do evals, and have the shared approach be something that's run by the firm and available to everybody for doing their evals.
  177. 16:09So, that covers all the common parts of evals, and all you've got to do is just write what's true about your agent.
  178. 16:17Uh and finally, maybe you've had the experience of being asked to approve lots and lots of individual agent actions when there's a human in the loop.
  179. 16:24So, that's fine at a small scale, but once you're operating agents in parallel or in production, this becomes completely onerous and review requests come in faster than anybody can be
  180. 16:35expected to approve them.
  181. 16:37I mean, after the first few times of this happening, you succumb to review fatigue where you just see yes, yes, yes, yes, yes, and eventually you click yes on something that's,
  182. 16:44you know, activating a new nuclear bomb, right?
  183. 16:46So, you don't want to click yes by reflex, but that's going to happen inevitably.
  184. 16:52And one recent example of this is, uh, earlier this year a director at an AI research lab told her open claw agent to suggest emails to delete from her inbox and then wait for her approval,
  185. 17:01but her inbox was so large that eventually the agent compacted its context and lost the part that said, "Wait for my approval."
  186. 17:07And then it deleted hundreds of emails and didn't stop when she told it to stop from her phone.
  187. 17:12So, again, you might be tempted to try to make a human approve every action, but that's not the right way to do it.
  188. 17:17A better approach is to let these independent, conservative classifiers make decisions about routine calls and then send a person only the requests that are most important, the ones that are most likely to make a difference.
  189. 17:30If you're saying yes 99.99999% of the time, then that's probably just a rule that the agent should follow, not a request you need to ask the human for permission for.
  190. 17:40And the stuff that's unclear or ambiguous or potentially dangerous, yes, surface that to a human or if it's definitely just dangerous, deny it outright.
  191. 17:48So, this is a way to not have to do all the review work all the time.
  192. 17:53So, we don't want to take the same approach for both explicit, uh, when an explicit rule is applied, we want deterministic fast paths.
  193. 18:00When explicit rules don't apply and there's some ambiguity, we want a classifier to do that work instead.
  194. 18:06So, putting those five pieces back together, you create a registry so that every agent is visible from the day it's created.
  195. 18:12You score each agent so human review goes in the right spot.
  196. 18:15You run on guardrails so that they only touch what they need.
  197. 18:19You share evals and metrics so everybody is reaching the same bar without having to reinvent the wheel.
  198. 18:24And then finally you govern your runtime to make sure that classification happens there and not somewhere else.
  199. 18:30So each of these controls works together.
  200. 18:33So I'll leave you with one question.
  201. 18:34Why do cars have brakes?
  202. 18:37It's not just so that you can stop, it's so that you can go fast and stop safely.
  203. 18:41So controls for our agents works the same way.
  204. 18:44Thank you very much.
  205. 18:45I'm John Feminella and I hope you had a good time.
  206. 18:47[applause]
  207. 18:49[music]