
I pointed an AI pentest agent at my own identity server. The second run got in.
Autonomous pentest agents are not a demo any more. Strix is an open-source one: you give it a target and a scope, it spins up a sandbox, splits itself into specialist sub-agents (recon, authentication, OAuth abuse and so on) and goes looking, writing up what it finds as SARIF at the end. I starred it, and then thought the obvious thing. If attackers get to use this, I want to know what it looks like from the other side of the wire before I meet it anywhere real.
So I aimed it at my own Keycloak. Keycloak is the identity provider at the centre of my lab, the thing every other service trusts to say who you are. It is the right target for this precisely because it is the worst thing to lose.
Two runs, same afternoon, same configuration. The first found nothing it could prove. The second took the whole realm. I’ll get to why, but the gap between those two results is the part I keep coming back to.
Getting it to run at all
The box I ran it from has no Docker and no passwordless sudo, and Strix wants Docker. That cost me the first hour.
Rootless Podman will speak the Docker API over its own socket, and the Python Docker
client Strix uses is happy to talk to it if you point the host variable there. The
pre-flight check, though, only looks for a binary called docker on the path. A
two-line shim that execs Podman got past that. Then image pulls failed, not because of
Podman but because of a stale credential-helper entry left over from a Docker Desktop
install years ago, which the Docker client tries to honour and cannot. An isolated
client config with an empty auth block fixed it. The sandbox image is pinned to a
specific version, not latest, and is over four gigabytes, so pull it before you start
or the first run spends its time downloading.
One trap worth writing down. There is an option to run the sandbox on the host network. Don’t, not under rootless Podman. Strix then resolves its in-sandbox proxy by a bridge address the host cannot route to and dies before the first request. Left at the default, it publishes a loopback port and the sandbox still reaches the LAN target through Podman’s user-mode networking.
For the brain I used GLM-5.3, a reasoning model, through an Anthropic-compatible endpoint. Reasoning models return empty content if you starve them of output tokens, which looks like the agent silently doing nothing. Give them room.
Run one: it tried a lot and proved nothing
The first run split into a recon agent, an OAuth/OIDC abuse agent and an authentication agent. About a hundred recon requests, then bounded probing. It came back with 27 SARIF records and zero confirmed vulnerabilities.
What it had actually checked was more interesting than that headline. Twenty-odd redirect URI bypass variants, all rejected. PKCE enforced with S256. Implicit flow off. Anonymous dynamic client registration blocked. The admin REST paths and the metrics endpoint all behaved. For a modern Keycloak on a default master realm that is roughly what I would expect, and it was reassuring to see a tool confirm it rather than me assuming it.
It flagged one thing as notable rather than vulnerable: the built-in admin CLI client is public and accepts passwords directly at the token endpoint. That is the resource owner password grant, and it is on by default for that client. The agent noted it and moved on. So did I. That was a mistake, but I didn’t know it yet.
Three items were marked “needs further review”, which in practice means the agent could not pin the exact version without authenticated access, so it could not say which CVEs applied. Fair enough. It did not invent a finding to fill the gap, which I was watching for.
On the detection side, my Wazuh manager lit up. The rule I had written weeks earlier for failed Keycloak logins fired 222 times from the attacking address during the run. Nobody got in, and the SIEM still knew exactly where the noise was coming from.
Run two: same target, nine attempts, full takeover
I ran it again a few hours later to see whether the result was stable. It was not.
This time the authentication agent went at that public client with a short list of candidate admin credentials. Nine attempts. The ninth worked. It held a valid admin access token and a refresh token, and it correctly wrote that up as a complete compromise of the identity provider: critical, CWE-521, weak password requirements.
I did not take its word for it. I replayed the credential myself and got a live admin token back. Then I looked at why. The realm had brute-force protection switched off and no password policy at all. The password was a textbook weak one. And it was mine. I had set it months earlier for a credential-attack exercise in the same lab and never cleaned up, so the one flaw that mattered was not in Keycloak, it was in my housekeeping. Keycloak itself was pinned at a current release with no applicable version CVE.
The agent also reported a missing PKCE requirement on the account client (low) and a reflected CORS origin with credentials allowed (informational). I have not independently re-verified either of those, so I am listing them as agent claims, not facts. Eighteen other surfaces it marked as verified secure.
Why did run one miss it? Same target, same scope, same model. The honest answer is that I cannot fully say. The first run spent its authentication budget on bypass attempts and only lightly on guessing; the second guessed earlier and harder. That is the nature of these agents. The plan is sampled, not scripted. A clean run tells you one path was clean, it does not tell you the target is.
What the SIEM saw the second time
112 failed-login alerts from the attacking address in that window, with the last one a few seconds before the successful token. Lockout was off, so nothing stopped the spray, but the spray was fully visible. Prevention and detection are separate controls and this was a clear case of one being absent and the other working. If this had been a real network, the alert volume alone would have been enough to pull the thread before the ninth guess.
I’ll take that. I would rather have had both.
Fixing it, and tripping over my own fix
Hardening took ten minutes. New admin password, long and random, in the password manager and nowhere else. Brute-force protection on, with a failure threshold, a quick-login check and a sixty-second wait. A password policy requiring length and character classes and forbidding the username. Then I verified: new credential issues a token, old credential is dead.
Except my first verification said the new one was dead too. Two logins under a second apart tripped the quick-login guard I had just enabled and the account was temporarily disabled for a minute. A single check after a pause returned 200. So the control worked, it just worked on me first. Keycloak now also emits its own brute-force and lockout events, which my Wazuh rules pick up, so I have two sources for the same behaviour instead of one.
I deliberately left the password grant enabled on that admin client. It keeps the credential-attack lab usable, and with lockout and a real password behind it the risk is what I want it to be, which is a known one.
What I took from it
An agent run is cheap and I will keep doing them, but I now treat the output the way I would treat a junior tester’s report. Confirmed findings get replayed by hand before I believe them. Negative results get a second run before I trust them, because the first run here would have told me my admin account was fine.
The finding that mattered was not clever. It was a weak password on a public client with lockout off. Agentic tooling does not change what gets you owned, it changes how quickly and how patiently someone can find it.
And the detection that mattered was not clever either. A count of failed logins per source, written weeks before any of this, saw both runs. If you only have time to write one rule for your identity provider, that is still the one.