Podcast

Root Causes 639: Fighting Static API Key Spillage Is Like Fighting Gravity

Hosted by
Tim Callan
Tim Callan
Chief Compliance Officer
Original broadcast date
July 10, 2026

Static API keys are a common security practice. In this episode we discuss the risk of these keys being revealed, including directly by the AIs that use them.

Podcast Transcript

Tim CallanTim CallanJason, you wanted to talk about static API keys. Static API keys, of course, used in a whole lot of different places.
Jason SorokoJason SorokoThe reason why they're talked about more and more right now is because anybody who's playing with AI agents - typically, to log into various resources, you need some kind of a way to authenticate into those systems. And so, what do human beings always do? They choose the worst and what seems to be the easiest solution, which is the same way we've done it forever with human beings: hand them a password. So we're just handing agents passwords. Not even a username, it's just a password. So, Tim, what do you know about shared secrets like passwords? What's their problem?
Tim CallanTim CallanThe problem with shared secrets is someone else can get them.
Jason SorokoJason SorokoSomebody else can get them, in multitudes of different ways. So we would need more than 100 podcasts to describe all the different attacks possible against these API keys. There's so many ways you can steal a shared secret. And these agents are using static API keys just like passwords. But now let's talk about - for those of you who are watching this who haven't played with agents much yet - here's a typical day in the life of the workflow of an API, a static API key. All right, I gave my credit card to a service online. It does something for me that I want my agent to be able to use. And I had to click a button on a website, and it creates an API key. It's just an alphanumeric string. I then have to copy that and paste it somewhere. The typical thing to do is to actually key that in, or paste it into a Linux command line.
So right there, put on your pen tester hat. How many different places has this now been in the cloud? And so, even if you're really trusting of your environment file in Linux, that's great. But, Tim, we've seen so many of these static API keys end up being found in public GitHub repositories. And that's just one of many places. Furthermore, because it's a static API key, that means it doesn't expire. You can set, typically, an expiry date. Some services allow you to do that. But how many people are setting it to, like, daily? Nobody.
Tim CallanTim CallanExactly. So then once that API key gets lifted, you would imagine most of the time there's a real attack window. Could be a sizable attack window, where you can just continue to reuse that key.
Jason SorokoJason SorokoYes. And I think that this notion of short lifespans - even if you have that kind of discipline, the lifespan that you're going to give it is more than enough for a bad guy to do all the bad things they need to do.
Tim CallanTim CallanRight. Because when we talk about short lifespans, we're talking about things like a month. You've plenty of time to do your exploit in a month.
Jason SorokoJason SorokoIf you've set it as short as a day, that's an ocean of time for the bad guy to do what they need to do. And so, Tim, this is the thing: I'm gonna give you a little story of something I did recently, because that's really what this podcast is about. I stood up an OpenBao server. So, in other words, OpenBao - for those of you who don't know - is the public fork of HashiCorp Vault. So it works very similarly. And one of the things it can do is it can actually store in a vault these static API keys. Piece of cake. So it's nice. So instead of going to an environment file, instead of going environment variable in Linux, I actually had my agents talk to the OpenBao server to be able to get the secrets out. So it's just a nice, safe place to put the secrets in, and a nice, safe place to get the secrets when they're needed by the agent. So I stood that up. I had a nice mechanism that was officially a key that was minted in order to be able to open the vault. And also, I even went as far as to stand up a private certificate authority that issued TLS certificates to basically every single place where communication was happening - it actually created a mutual TLS session. So that was pretty darn secure. Pretty locked down. So I put on my pen tester hat and started counting all the different ways in which the static API keys were actually leaking all over the place. It ended up turning out that I stopped counting after 11 different ways that it was leaking the keys. My favorite way that it was leaking the keys is - it actually made me laugh, even though it's not funny at all. My agentic harness, which happened to be Claude Code - even though I had asked it not to put the static API key anywhere in bash history...
Tim CallanTim CallanIt did anyway.
Jason SorokoJason SorokoAs it's conversing with me, it goes, "Hey, is this the right key?" "Thanks." And now everybody in the world knows it too. And so even Claude Code was smart enough to realize, after it had spilled the key: "Oh, security breach. I highly suggest that you go and rotate your key." Thanks, Claude.
Tim CallanTim CallanMaybe you could have had that thought before you leaked it.
Jason SorokoJason SorokoYes. So, Tim, I'm security obsessed. So are you. How many people who are just trying to do their day job are like, "whatever."
Tim CallanTim CallanAbsolutely. And, you talked about harness locking down the the amount of usable time on one of these keys to be very short. We've all seen this movie. We know how this goes. The person who's stuck doing this as an implementer on a day-by-day basis is going to be motivated to make it as long as they can. And so often, they just will.
Jason SorokoJason SorokoThey just will. And so, for those of you who are in positions that own risk - you're a CISO, you're a CIO, you're a director of IT - I guarantee you and I, Tim, have talked about rogue shadow IT systems for certificates for years. Well, it's, I would say, 100x for agents. Shadow agents, shadow everything going on. How many systems are out there in your enterprise right now where people are very excited - legitimately excited - about standing up agents and automating workflows, but they're using the weakest security process?
Tim CallanTim CallanAnd I haven't seen numbers on this, but I have to imagine, however you would quantify it, that the number of active agents, or the amount of activity that's being done by agents, or the amount of power to do things that agents have in our enterprises -
Jason SorokoJason Soroko- is just growing exponentially right now. Exponentially.
Tim CallanTim CallanLike, in a way, this isn't a new risk. This is a conversation we could have had two years ago. But the degree of risk is orders of magnitude bigger now, and I predict will be orders of magnitude bigger again in another year or two.
Jason SorokoJason SorokoYes, Tim. That's why we're trying to get ahead of this. And there's gonna be a few more episodes where you and I talk about the alternatives to static API keys.
Tim CallanTim CallanThat's perfect. That's where we need to go next. So let's just leave this here for now. Thank you, Jay.
Jason SorokoJason SorokoThanks, Tim.

Stay informed with expert insights

Subscribe to Root Causes for engaging discussions on PKI, digital security, and best practices for protecting your organization's critical assets. Don’t miss an episode!

Listen on Apple PodcastsListen on SpotifyListen on SoundCloud