A book open to chapter 14, “Post-quantum cryptography.”
The opening page of the post-quantum chapter in Real-World Cryptography (2021).

In my book Real-World Cryptography, I wrote:

“Quantum computers can break cryptography,” implied Peter Shor, a professor of mathematics at MIT. It was 1994, and Shor had just come up with a new algorithm. His discovery unlocked efficient factoring of integers, destroying cryptographic algorithms like RSA if quantum computers ever were to become a reality. At the time, the quantum computer was just a theory, a concept of a new class of computer based on quantum physics. The idea remained to be proven. In mid-2015, the National Security Agency (NSA) took everybody by surprise after announcing their plans to transition to quantum-resistant algorithms (cryptographic algorithms not vulnerable to quantum computers).

At the time (2021) I wrote that in a period of confusion. Confusion, because while people understood well that quantum computers, if they were to exist would break lots of cryptography, it was not clear to many that they would ever exist in the first place. In the same chapter, I later summarized:

Ask any expert and you’ll receive different kinds of answers. For some, it’s 5 to 50 years away; for others, it’ll never happen. Michele Mosca, the director of the Institute for Quantum Computing, estimated “a 1/7 chance of breaking RSA-2048 by 2026 and a 1/2 chance by 2031,” while Mikhail Dyakonov, a researcher at the CNRS in France, stated publicly “Could we ever learn to control the more than 10300 continuously variable parameters defining the quantum state of such a system? My answer is simple. No, never.” While physicists, not cryptographers, know better, they can still be incentivized to hype their own research in order to get funding. As I am no physicist, I will simply say that we should remain skeptical of extraordinary claims, while preparing for the worst. The question is not “Will it work?”; rather, it’s “Will it scale?”

The NSA announcement that we should start moving towards post-quantum algorithms, and skip elliptic curves if we had not migrated to them yet, was puzzling to say the least. At the culmination of the frenzy the community of scientists found themselves thrown into, Koblitz and Menezes wrote their bold essay entitled A Riddle Wrapped in an Enigma.

You can tell from some of what they write that indeed, the public perception of the feasibility of quantum computers is somewhat different from today’s:

According to an article in the Washington Post [49], the NSA’s efforts to develop a quantum computer are a part of a US$79.7 million program called “Penetrating Hard Targets.” This is a very small fraction of the NSA’s budget. If the NSA were close to developing a practical quantum computer — or if they believed that another nation was — then they would be devoting far more money to this project.
[…]
Some people are very skeptical about this timeline. As pointed out in [57], there has never been a genuine implementation of Shor’s algorithm. The only numbers ever to have been factored by that type of algorithm are 15 and 21, and those factorizations used a simplified version of Shor’s algorithm that requires one to know the factorization in advance.
[…]
Suppose that the NSA believes that, although a large-scale quantum computer might eventually be built, it will be hugely expensive. From a cost standpoint it will be less analogous to Alan Turing’s bombe than to the Manhattan Project or the Apollo program, and it will be within the capabilities of only a small number of nation-states and huge corporations. […] In other words, according to this theory the main intended audiences for the NSA announcement were the Chinese and Russians, who would be goaded into a pointless expenditure of vast sums of money to build a quantum computer that won’t do them much good. In this way those resources will not be put to uses that the NSA would regard as much more threatening.

If it’s not clear, the NSA’s reputation wasn’t the best around that time either, as they were caught their hands in the pants trying to backdoor a cryptographic standard (the infamous Dual EC backdoor, if you watch the video, know that I cringe every time I rewatch the intro). Koblitz and Menezes write in the same paper:

Perhaps the NSA believes that it can find and exploit vulnerabilities in PQC much more easily than in RSA or ECC, and for that reason they want the public to hurry toward PQC standards. […] If the NSA gets the standards bodies to rush the process, perhaps they’ll make some mistakes, as they did in the case of Dual EC DRBG. Then the NSA can exploit the resulting vulnerabilities.

So is this just another set of shenanigans from the NSA? or should we trust the NSA this time around? The NSA itself used to say that we should because they had all these great cryptographers. We know that thanks to Alex Stamos asking this great question to the NSA director at the time (2015). To this day, I still remember that smirk on that smug NSA director’s face, as they went through with this lunar exchange:

Alex Stamos (Yahoo CISO): My name is Alex Stamos, I'm the CISO at Yahoo.
Adm. Michael Rogers (NSA Director): Hey Alex.
Alex Stamos: Um, so it sounds like you agree with Director Comey that we
  should be building defects into the encryption in our products so that the U.S.
  government can decrypt--
Adm. Michael Rogers: So that would be your characterization.
Alex Stamos: Well, I think--I think Bruce Schneier and Ed Felten and all
  of the best public cryptographers in the world would agree that you can't really
  build backdoors into crypto, that it's like drilling a hole in the windshield.
Adm. Michael Rogers: I've got a lot of world-class cryptographers at the
  National Security Agency.
Alex Stamos: And I've talked to some of those folks. I think some of
  them agree too, but--
Adm. Michael Rogers: So we agree that we don't accept each other's
  premise.
Alex Stamos: So you tell--okay, there we go. We'll agree to disagree on
  that. So, uh, if we're going to build defects/backdoors or golden master keys
  for the U.S. government, do you believe we should do so--we have about 1.3
  billion users around the world--should we do so for the Chinese government, the
  Russian government, the Saudi Arabian government, the Israeli government, the
  French government? Which of those countries should we give backdoors to?
Adm. Michael Rogers: So I'm not going to--I mean, the way you frame the
  question is designed to elicit a response, and--
Alex Stamos: Well, I mean, do you believe we should build backdoors for
  other countries?
Adm. Michael Rogers: Um, my position is, hey, look: I think number one
  that this is technically feasible. Now, it needs to be done within a framework.
  I'm the first to acknowledge that you don't want the FBI and you don't want the
  NSA unilaterally deciding, "So what are we going to access and what are we not
  going to access?" That shouldn't be for us. I just believe that this is
  achievable, and we'll have to work our way through it. And I'm the first to
  acknowledge there's international implications to this. I think we can work our
  way through this.
Alex Stamos: So you do believe that then we should build those for other
  countries if they pass laws?
Adm. Michael Rogers: I said I think we [can work] our way through this.
Alex Stamos: So I'm sure the Chinese and Russians are going to have the
  same opinion, sir.
Adm. Michael Rogers: I said I think we can work our way through this.
Alex Stamos: Okay. Nice to meet you.
(Laughter)

Experts in the NSA? World-class cryptographers? Koblitz and Menezes didn’t think it mattered anyway from the point of view of NSA’s announcements:

Normally all of the big corporations that do cryptographic work for the U.S. government would have been given some advance notice, but this was not done. Even more surprising, the NIST people were not asked about it, and even researchers in IAD were caught by surprise. It seems that whoever at the NSA prepared the release did so with minimal feedback from experts, and that includes their own internal experts.

11 years later, and we have a NIST standard for post-quantum cryptography. Released in two waves, in 2020 a preliminary not-so-nice standard for stateful hash-based signatures came out (SP 800-208), and in 2024 the more complete and nicer standards came out: FIPS 203 for lattice-based key exchanges, FIPS 204 for lattice-based signatures, FIPS 205 for stateless hash-based signatures, and FIPS 206 for another lattice-based signature. (If you didn’t know, symmetric encryption was supposedly fine, and didn’t really even need to be updated, maybe.)

It’s funny, because at the same time, I remember debates about “crypto agility”. This notion that you should make it easy to swap algorithms if needed. Crypto agility had caused so many bugs that security practitioners started arguing against doing anything like that. For example, there was this attack in TLS where you could pretend that the 256-bit ECDH public key you’d receive was actually an RSA public key (which these days are more like 2048 bits long), which would easily let a man-in-the-middle attacker break and then decrypt your traffic. Another example is the infamous JWT attack whereby replacing "alg": "HS256" with "alg": "none" was enough to remove any cryptographic check. Protocols that removed this runtime flexibility flourished, like the Noise Protocol Framework (another cringy video of me from 10 years ago) meant to replace TLS’ complexity by fixing parameters at compile/design time.

I myself fell into this trap many times, seeing overly complex and overengineered design in order to follow this crypto agility movement. After all, I’m someone that likes simplicity and crypto agility did add a LOT of code. Unnecessary code, I thought at the time, because I was spoiled growing up in a long period of “crypto stabilization” in which people really felt like the current algorithms were going to be the ones that we will use forever (unlike SHA-1, RC4, DES, encrypt-then-mac, etc. designed at a time when we did not understand things as much™️).

But it turns out that maybe… it is the notion of crypto stability itself that is foolish? and that whoever said that cryptography is a field where you have to continuously reinvent yourself because computers do as well, well, was right after all?

So anyway, fast forward and AI becomes a thing, and it turns out that (to the surprise of no one) lots of our cryptography was somewhat secured through absurd complexity, and it turns out also that AIs are very good at navigating that complexity and finding the bugs. We have bugs everywhere.

But security through absurd complexity was not always how we did cryptanalysis anyway, the point was always to gain confidence in schemes via absurd amounts of time spent attacking primitives, until the point where cryptanalysts get bored. Cryptanalysts do get bored, and there aren’t that many of them (because it’s quite a masochistic field), and so with AI we get to push that further, and either get to break more stuff, or get more confidence in stuff.

So so far, it seems like we’re breaking stuff mostly. Anthropic, only 4 months ago (I had to double-check because everything happens so fast these days), released a break of HAWK (another lattice-based signature competing in NIST’s never-ending post-quantum standardization effort).

The first result we describe in this post, which was discovered with Claude Mythos Preview, is an improved attack against a digital signature scheme called HAWK. In 2022, the US Government’s National Institute of Standards and Technology (NIST) put out a call for additional cryptographic systems that would remain secure even against quantum computers (which could, if developed, break most of the existing signature schemes in use today). HAWK is one of the third-round candidates under consideration from this call. Despite HAWK having survived two rounds of expert human review over a period of two years, Mythos was able to improve the best-known attack on it in just 60 hours of work—effectively cutting its key strength in half.

Shortly afterward, HAWK withdrew from the competition

Cong Ling discusses AI-assisted cryptanalysis. Replies compare the implications for HAWK and SQIsign.
The HAWK discussion on the NIST post-quantum mailing list, July 2026.

Then, last week, for what seemed like an eternity, rumors started spreading, people started vagueposting.

A cartoon king posts “I know things only SOME people know about. But I can’t tell you!”
“The Vaguepost King,” shared by Steven Waterhouse.

It was tedious, as nobody was really saying anything, but we felt like the roof was going to collapse. At zkSecurity, with my coworkers, we held hands and sang songs. Then we voted on what we thought it would come down to.

An internal zkSecurity poll lists SHA-2, AES, elliptic curves, RSA, better lattice attacks, and something else.
Our guesses at zkSecurity before the announcement.

The first news we got was the creation of a new Cryptography Incident Review Group.

The group’s homepage lists its purpose, its initial assessment of lattice cryptography, and its members.
The review group’s homepage links to its initial assessment of lattice cryptography.

And then the Cryptography Incident Review Group Review Group Review Group Review Group Review Group Review Group was announced shortly after.

And then, Anthropic dropped “the bomb”: news about module lattices. The news felt a bit like a nothingburger, perhaps because of all the hype (I mean we thought RSA was going to break), or perhaps because of the early leaks of the paper title, or perhaps because the attack was quasi-polynomial (we prefer polynomial) and had massive constants (meaning that it was not practical even with a big quantum computer).

Interestingly, Anthropic decided to do some PR by renaming the paper, adding the term Galactic in front of it. The full name now reads “Galactic quasi-polynomial quantum algorithms for integral and module lattices”.

So we went from freaking out to “this seems OK”.

BTW, I acknowledge that we live in bizarre times. As my ex-coworker George Danezis puts it:

So now the title of the amazing cryptographic breakthrough is public. It’s “Computers that do not exist can break crypto algorithms no one uses, but we thought we might use to replace the other algorithms we use, that we knew were broken by the computers that do not exist”

But harvest now, decrypt later attacks are what’s on people’s minds when arguing about moving to better cryptographic schemes now. Harvest now and decrypt later attacks are the idea that a truly evil person could record encrypted traffic now, and decrypt it later once quantum computers become a thing.

Yet, it seems like we might have to worry about a more imminent threat, because yesterday the NSA made a peculiar announcement:

NSA advises National Security Systems (NSS) owners, operators, and vendors to immediately accelerate the transition to post-quantum cryptography (PQC).

This call to urgency is somewhat unprecedented, coming from our familiar and somewhat trusted entity. Even going as far as to double down on the lattice schemes weakened a few days earlier by the Anthropic and the Cryptography Incident Review Group Review Group Review Group Review Group Review Group Review Group announcements. Not only that, but even symmetric cryptography had to be bumped, going against the trends of the last decades (see Too Much Crypto).

It was quickly followed up by other worrying announcements, first from Matthew Prince, the CEO of Cloudflare, who tweeted:

Do not ignore this. Do not underestimate it. Yes, we were briefed on something. Yes, it’s a big deal. No, we can’t give you all the details yet. But it is urgent to move encrypted systems to post-quantum (maybe more appropriately called post-AI) standards.

And then a joint statement from the big labs and friends came in:

Eight companies endorse a faster migration to NIST’s post-quantum standards.
The joint statement shared by Anthropic on December 2, 2026.

It’s now clear, something’s happening, and it’s about non-quantum resistant schemes.

Congratulations to the folks who had decided to go hash-based, or quantum-based a while back. Today, they are celebrating. Congratulations to people who decided to be crypto agile from the start. On the other hand, the people who cornered themselves in primitives that aren’t quantum-resistant are most likely going to have to fight against the inertia. Whether quantum computers are coming or not, this week’s bundle of news is most likely going to become the norm.

suggested reads:

Golden Labyrinth of Arches.png

It must be tiring to live in SF, because when I talk to people who spend too much time in homeless city they believe that “SaaS is ded”, and that “hardware is where the new moat is”.

Every field is having to reinvent itself, it’s undeniable, and while some fields are certainly dead (I’m thinking of you translation),it’s not clear to me if others are expanding or shrinking. I’m not a doomer I guess. And depending on who you talk to, you might even be convinced that we are going to need many more mathematicians and many more engineers. Gloomers’ takes?

From what I’m seeing around me, one thing is sure, everything is accelerating. The job of being a software engineer has changed. I work now more than ever, it’s much more grindy and less deepwork than it used to be, but I’m also exploring and creating a million things at the same time. To quote the racist piece of shit and great engineer DDH:

I spent a quarter of a damn century chiseling code by hand and loving every moment of it. What a wonderful experience and productive time in that era. […] This is not something to look back upon with regret. This is something to look back upon with joy. […] What a privilege on both sides of that chasm to have been there when we did it all by hand. To be there at the exact moment where we switch over.

And everyone I know that’s cracked is now AI-pilled in the same way. I’m now interacting with the LLMs of my clients, sometimes reviewing whitepapers and code written by LLMs, and running LLMs to perform all kinds of tasks at my job.

But my clients seem to dislike it. They get the ick if I bring them some LLM copypasta, they want something original from me, and they want to interact with a human. You probably do to, and that’s why you’re still reading this nonsense essay. And that’s why I’m leaving the typos in. YOu like it don’t you.

It seems like human connection still matters, and we don’t trust agents fully yet. This is maybe the nursing theory in full effect.

In this era of “SaaS is ded”, you have to assume that anthropic and openai will eat everyone, even though there’s many markets, too many markets, you can sense that they are lurking at your business model, or maybe just your job (after all, bullshit jobs might be over now).

It’s not even that competitors can one-shot the crap you took years to create, it’s that nobody even needs someone to compete because they can just ask Claude😭💗 to do it. If models do get good enough, then lots of product categories will for sure die.

But do we still want to trust Anthropic and OpenAI? In spite of google spreadsheet being a thing that applies to most people and businesses, most people still reached and paid for a specialized tool, lots of business SaaS out there existed to replace the spreadsheet right? Most people want something shiny. I mean think Slack or Telegram or Grokbot. There’s a reason they succeeded or will succeed.

Honestly, I think what’s happening is a return to the small shops. We’ve already seen that startups can move faster than behemoths, due to lean teams being more efficient. Agents change the game 100-folds. Millions of startups will displace giants next year.

I’ve appreciated seeing the mom-and-pops of the world make a come back in the last years, I think this is going to happen to the digital world as well.

If I’m right, then we’re most likely going to see more capture from specialized tooling rather than generalists. For example, I think www.zkao.io will work much better as an AI security engineer specialized in cryptography compared to something like adaptive that’s trying to be everything. Claude is already trying to be everything (but go figure, they’ve raised ~$60M).

Also, unrelated, while small digital shops are going to flourish, smalls shops are going to get cuter. Art is going to be everywhere, and we’re finally going to look like Japan. Me likey (。˃ ᵕ ˂ )⸝♡

I got you smiling, so let me wipe that off your face. Let’s get you to doom, like the doomers do, but on human things. Let me talk about AI social classes. I’ll make the social ladder clearer:

  1. someone working at Anthropic gets access to models that are perhaps two models ahead of the models you can use, they also have unlimited tokens
  2. someone like me has easier access to cyber models like Mythos and daybreak, plebs like you only have access to abliterated models. But even then, some people only have access to the blue team version, while the red team access gives you way less cyber refusals
  3. someone like you (let me guess, the rich pleb) has access to expensive subs, maybe $500 subs, maybe many of them
  4. or if you’re a poor pleb (sorry maybe that was you), you only have access to a $100 sub
  5. or if you’re not in the US, you might not even have access to a US SOTA model?
  6. Maybe you’re really poor, so all you’re using is google AI overview, or models like sonnet and luna

So which one are you? How token rich are you? The less you are, the faster you’ll get replaced, the less opportunities you will get, etc.

If you go touch grass, you will see that most people’s experience is on the last rung, and that is most likely why you’re spending your time at parties trying to convince the non-enlightened about how great AI is.

What should we call this, AI classism? AI caste dooming? Pick your term, but things are not looking good for those that are not willing to be meat proxies, or spawned in the wrong place.

suggested reads:

Translucent waves of rust and gray converge on a black circle.

We’re slowly learning that agents are like us: they’re much more efficient at solving problems if the problems are formulated perfectly.

At least this is what we see with tasks that perform extraordinary well with agents: if you give them a pass/don’t pass test, and a durable session, they will work for hours, days, weeks, months, to find you the best possible algorithm/implementation.

For example: “implement the best sorting algorithm” and let the agent run the benchmark itself.

The problem is that the pass/don’t pass test can be broken, and agents love to cheat (it appears so).

So your test needs to include not only that your sorting algorithm is fast, but that it is correct on ALL inputs.

For such a scenario, verifying that the list output is sorted might appear to be enough, but it’s not: the agent could produce something that is correct only some of the times.

So the better test is something more like a quickcheck/proptest: you generate many inputs, and check that all outputs are correctly sorted. This is usually fine enough.

For example, see how Yukon had people optimize a zero-knowledge proof (ZKP) system (called Flock), and how it verified submissions by generating random inputs and checking if the optimized candidates would produce valid ZK proofs.

In other scenarios, when you’re dealing with adversarial inputs, you can’t risk that an algorithm is X% correct where X is “not close enough” to 100.

In these scenarios, formal verification is the savior. This is what my coworkers did with zk.golf where people battle to optimize ZK circuits and a service verifies that submitted circuits are sound and complete (basically secure) with a mathematical proof written in lean (based on our framework clean).

In the last year I’ve been working on zkao, an AI security engineer that people can “hire” to continuously look for bugs in their codebases. The bugs that zkao attempts to find are contained in the hardest of software: cryptographic software.

I’ve learned the hard way that finding bugs in cryptography software is hard because of two reasons:

  1. it’s not always clear what the threat model is
  2. it’s not always clear what security properties the system requires

To illustrate the first problem, let me give you an example. We sometimes look at libraries that expose public-key cryptography algorithms and accepts elliptic curve points. zkao used to (and probably still do sometimes) report lack of subgroup membership verifications as bugs. If that doesn’t make sense to you, I’ll reformulate it as: things don’t work too well if the inputs are not trusted, as they are not sanitized in the implementations.

In many of my past audits, I’ve reported these kind of bugs as low-severity findings depending on the context, and especially when I didn’t find better bugs. When you don’t find good bugs as part of an audit, you’re always a bit ashamed, and so you try to pad with OK-bugs. But these days, people hate it. Perhaps they always did, but it’s especially worse now because their own vanilla agents will report those as well. And what your SOTA security experience does by default is what I call vibe auditing.

So anyway, I don’t want zkao to report such bugs most of the time, but sometimes maybe it should. It really depends on the threat model of the library, and how it’s used in the overall app, and so on. So before we can figure out if these are bugs, and exploitable in practice, we need to understand the overall context of the application, and this is a whole different problem. It’s a problem of integration and context acquisition, and you need more than a prompt to fix that.

That’s perhaps the main reason why vanilla models are often unusable due to the wall of false positives or low findings they report.

To illustrate the second problem, “it’s not always clear what security properties the system requires”, think about the fact that a lot of cryptographic protocols are poorly specified in the first place and it is not clear what security properties one should look for in them. For example, many confidential transfer protocols have had a hard time formulating what properties they need for their protocols to be secure. People used to list what seemed like random security properties, without realizing if one encapsulated others. For example, what it took was some brainstorming and out-of-the-box thinking when Zooko thought about and found the Faerie gold attack.

Screenshot 2026-11-17 at 20.33.46.png

Zcash Protocol Specification Version v2026.9.0-105-gf217a3

A way to prove protocols secure in cryptography is to model their ideal functionality, and then compare that to the real-world spec, and see if someone could observe a trace and distinguish in which world it happened (in the real world or in this ideal world). But even then, the goal of finding the right security properties has shifted to finding the right ideal functionalities (and there are often many).

Even in “simple” cryptography, it took some time for people to figure out the right way of modeling core primitives. For example, Neal Koblitz and Alfred Menezes wrote an entire paper called ANOTHER LOOK AT SECURITY DEFINITIONS (in titlecase).

Finding the “right” definition of security is often elusive. Concepts such as symmetric and public-key encryption, hash functions, and message authentication have been around for decades, but the choice of security models is still fraught with unsettled issues.

For example, it was thought that Duplicate-Signature Key Selection (DSKS) attacks were not really an interesting property of signature schemes:

It must be emphasized that possession of the duplicate-signature key selection property does not constitute a weakness of the signature scheme — the goal of a signature scheme is to be existentially unforgeable against an adaptive chosen-message attack.

yet it turned out that a beautiful DSKS attack completely broke the Let’s Encrypt protocol. For the anecdote, I missed this DSKS attack as part of my very first audit (of Let’s Encrypt) in an internship at NCC Group in 2015.

Another example is DJB famously arguing against the need to check the cofactor of its X25519 curve, which also led to the break of the end-to-end encryption protocol of Matrix (which I found (I can’t miss them all), and talk about in more detail in my book Real-World Cryptography).

Anyway, it seems like if you lay out the threat model correctly, and you figure out all the security properties you want to prove, agents can do miracles. Figuring out exactly what these pass/don’t pass test look like is not easy, but it really gets you 90% of the way.

Since I haven’t seen much ink being spilled on the subject, I’ll take this opportunity to name this test after myself: I call it the Wong test. I’m ashamed at my own self-importance, but you gotta try to name something after you at one point in your life, and I’m getting older.

Part of figuring these Wong tests is that even once you have them, it might not be enough… Because you need to convince yourself that you found them all!

There is one final “advantage” of precise definitions that is rarely mentioned in discussions of the subject. They are helpful for the attackers. Like everyone else, the adversaries have limited resources and a desire to concentrate them where they’ll do the most good (or rather, the most bad). When publicity about a protocol specifies the security model that served as a guide for its design and a basis for the security guarantee, adversaries can also use that model as a guide, focusing their efforts on devising attacks that are outside the model.

suggested reads:

It seems like as a codebase changes, or as models get better, some prompts are good to rerun. You know, like a periodic “find all the bugs” prompt, although I wouldn’t recommend that one (security is hard, and there are better tools like www.zkao.io out there to find bugs using AI).

Anyway, I call that concept agent gardening, and it’s a mix of prompts that help maintain a codebase in order by constantly refactoring or cleaning up code.

I’m curious as to what people think are good prompts to run periodically. Mine live in a file called GARDENING.md where each prompt is accompanied with a date/commit next to it to understand when the last time we ran it was, and what was the outcome of that run.

To give you an idea, here are some of the prompts that live in that file:

  • should we update any of our dependencies?
  • is there dead code we should remove?
  • do we duplicate code and make some things overly complicated, which could benefit from some abstraction (an interface, a constructor, a common library/package, etc.)
  • are we lacking e2e testing in some area?
  • review past agent transcripts produced by agentic code in this codebase and figure out if there are things that we do that consume way too many tokens in the context of our agents, maybe commands, or prompts, or something that adds tons of tokens for no good reason
  • is there anything in your memory that could be useful to hardcode into AGENTS.md for other coworkers to benefit?
  • are the docs up-to-date?
suggested reads:

I’ve realized that not many people are using this kind of techniques for “it’s 2027 soon, agentic codebases need a different kind of testing”, and I’ve been told I should document it somewhere at some point, so here it is.

A lot of tests in my codebases are not written as code, they’re written as scenarios in a SCENARIOS.md file.

Agents know that they should maintain a manageable list of such scenarios that describe end-to-end tasks and expected behavior from different point of views.

Agents can decide to run through all of them, or some of them, after code changes in order to verify that some expected high-level specification is still respected.

To do that, agents have access to two things:

  1. A codebase CLI that has commands to speed up running through these scenarios. Things like adding the right data in the database, running well-known db queries with the right settings, spinning up redis, etc. No end-to-end tests, just atomic things.
  2. A way to orchestrate any LLM responses, so that I pay sub cost instead of actually calling the token API. Usually I do this by having my own LLM provider in pi, and a codebase CLI command that creates the server side of things and let the LLM interact with it to see requests and produce responses.

That’s it. I call it ADT for Agent-Driven Testing.

suggested reads:

As a small team, we always have a million things to focus on. In my mind, I sometimes think that we could expand our team in order to be able to brainstorm all these issues we’re trying to optimize: how can we have better oracles to query our codebases, how can we get our workers to start faster, how can we spend our budget more intelligently across tasks that we need to run, how can we cache artifact builds more efficiently across workers, etc.

A large company like Meta would have people focusing on these different parts of the stack, and coming up with clever algorithms to optimize things ad-infinitum. On the other hand, a big team has trouble moving fast, they’re constantly fighting against an aging codebase, and coworkers are fighting against other coworkers, and also nobody dares making changes too large as often nobody understands the whole codebase and is scared of breaking things.

Making important changes is fast and easy with a small team, we already knew that. Today, coding agents make this even more insane.

Wait, we have coding agents, why don’t we use these to solve all of these problems? Well, with coding agents we have another problem: the nursing problem.

Agents have to be nursed, we don’t trust them fully yet, they don’t seem to understand our tastes, where we want to go, and they’ll gladly do everything at the same time without caring too much about our metrics. Sure we can try to hardcode all of the stuff we want to optimize, and all of the stuff we don’t care about, but they still seem to come up with weird decisions that we don’t like. So for most of us, we don’t want to let them roam around and change code without supervising them.

The solution I’ve been toying with the idea of infra agents. Agents that have long, durable sessions, and live within the infrastructure, in place of code that would have attempted at deterministically figuring out what to do.

meat-proxy.png

We’ve all sort of coming down to the conclusion that flows and orchestrations with a few edgecases should be hardcoded, and that the ones with a million edgecases should be given to the agents, so I guess I’m talking about the ones in the middle that should be hardcoded as well but we don’t have time to figure out how to do it and we don’t want to let crazy agents hardcode these rules forever.

So the solution is to just have an agent move and live in that part of the codebase, see the stuff we’re seeing, and make decisions based on that. When you see everything, the decision is much easier to make on the spot / just-in-time. Maybe with time they’ll come up with scripts to get there faster, and with more time these scripts will become so reliable that they will encode the full algorithm that we would have come up with in the first place had we had the time to do that.

I call this point crystallization. I’m not sure it ever happens, because our codebases are constantly shifting nowadays, but maybe we will see instances of crystallization happen around us, maybe you will witness some of that.

suggested reads:

Stochastic agents shifting the boundaries between deterministic infrastructure and CLI/MCP tools.

We’ve all been amazed at how many LLMs and decisional models we’ve managed to integrate, in all sorts of places, in our codebases.

What was once a complicated deterministic process combining many heuristics that had to be managed carefully is now just an agent with a high-level prompt written in English that the whole team can easily maintain.

And even saying that, it’s not clear we’re still editing these prompts manually, or even reading them anymore.

In my case, after integrating my first agent loop in the codebase, I quickly reached for a configuration language in order to orchestrate these agents. Small configuration languages are better, and so I set out for a minimal syntax in yml files.

The configuration language basically looked like a GitHub workflow, simple enough that you’d think it would be really useful and that should be the obvious boundary between stochastic agents and deterministic code.

Deterministically automate what you can deterministically automate.

Underneath that, things were more flexible, constantly changing, and so subagents seemed like the right orchestration approach. One root agent following some high-level script, and getting better and better at orchestrating an army of subagents as models improved.

A friend then asked me, wait why use a configuration language to orchestrate your root agents? Why not just use prompts as well?

This is when the idea of a border between deterministic code and stochastic agents constantly shifting appeared in my head.

The idea of deterministic code is that it is fast, cheap, and predictable. But the predictability has a cost: it is not flexible, and bugs in the code can leave your application in unrecoverable states that will get your application stuck until you fix the code and ship an update.

Agents are slow, expensive, and often non-local. Open-weights are changing the game, but they are still slow and expensive. That hasn’t changed much. At least if you want output tokens of quality.

But we can all predict a future where this ceases to be the case. A future where every MacBook Pro ships with a special AI chip, an NPU, and SteveJobs 5.5 running on it, so that producing code on the fly is no longer slow, expensive, or non-local.

In such a world, perhaps the deterministic code orchestrating our agents will vanish. How much will it vanish? It’s hard to tell. Maybe we won’t use apps anymore, or UIs, maybe everything will be requested from agents on the spot.

Maybe agents will be the only UI humans will interact with going forward, maybe natural language will be the only API.

But beneath these agents, I want to argue, deterministic code is alive, and thriving.

Perhaps, deterministic code is not shifting, it’s getting teleported underneath agents’ feet.

We’re less and less preoccupied by how to run some infrastructure, and getting busier with what tools and custom CLIs and MCPs we’re giving our agents access to.

Tomorrow’s money will be in what your agents can interact with, the building blocks they can use to do useful things, and the code they can generate on the fly for the future requests they will have to handle.

If you’re building for tomorrow’s world, my advice would be to focus on that: one building block that would be useful for many people’s agents.

I sometimes wonder what the future of collaborative work looks like in this agentic world. We’ve set up and philosophized about all of these engineering processes to death. From dependency injection to scrum masters, from best practices to the minimum number of reviewers required for your PR to land, none of this matters anymore, all of this went to trash.

Most of our important tests are now shifting to SCENARIOS.md files, describing high-level flows in English, that agents can test using their pstack-inspired verification commands.

I still talk to people who work at companies where people manually write code, and manually review code, and everything sounds so slow, and so archaic.

suggested reads:

I get the same email often enough (“hey, we’re shipping some crypto, who do we talk to?”) that I figured I’d just write the answer down once.

So here’s the answer: if you’re building anything that touches cryptography and you want someone to look at it before it goes live, reach out to zkSecurity.

For the newer readers: a few years ago I cofounded zkSecurity, and what started as a “let’s audit ZK circuits” shop has grown into something much broader. We audit advanced cryptography in general now (ZK, sure, but also MPC, FHE, TEEs, threshold signatures, consensus protocols, post-quantum, and the boring primitives everyone gets wrong), we do formal verification for when “we reviewed it carefully” isn’t good enough, and we do development and design work too. The team is world-class, a mix of researchers, hardcore devs, and CTF people. Most of them are more qualified than me, which is exactly the situation you want when you’re handing off code you care about =)

There’s a second answer I’ve started giving lately too: zkAO, an AI tool we built that finds bugs in cryptographic codebases.

I want to be careful here, because everyone is slapping “AI” on a landing page right now and most of it is noise. But I’ve been doing this for over a decade, and I’ll just say it: I think zkAO is the best tool out there right now for finding cryptography bugs in real codebases.

Crypto bugs aren’t your average off-by-one. They’re things like a missing range check, a reused nonce, an unvalidated subgroup, a constraint that’s underconstrained. Off-the-shelf tools just miss these, because they don’t understand the cryptography. zkAO does, and that’s the whole point of it.

It’s not a replacement for a real audit. But it finds a lot of bugs cheaply and early, and it’s good enough that we use it ourselves on our own audits.

So if you’re shipping crypto: zksecurity.xyz for the audits and the formal verification, zkao.io to throw an AI bug-finder at your codebase and see what falls out.

Anyway, that’s the pitch.

suggested reads:

self-willed NFT

In 2022, Vitalik floated the idea of “soulbound NFTs”, NFTs that would be linked to your identity forever.

Today, with zkML (which I’ll explain in a bit), I think we can go further: NFTs that will live a life of their own, and decide by themselves when to change owner. I call these Self-willed NFTs.

The simple explanation here is that an NFT could represent an agent with its own personality (potentially secret), that people could try to seduce into updating their ownership.

Of course, you could still allow monetary-based transfer of ownership, but these concepts are taboo in countries with a complicated history like the US.

Anyway, self-willed NFTs can be truly realized through two technologies:

  • LLMs, this should be obvious
  • zkML, which allows someone to prove that the agent took a deterministic step according to their personality, values, and information available to them

Time to introduce zkML in a few sentences. LLM inference can be seen as a function of two inputs: the model and the prompt, and one generated output. Adding “zk” to it allows you to hide the model, or (part of) the prompt, or the output, or a combination of all three. While maintaining the integrity of the computation of course.

A self-willed NFT could thus have a secret personality committed on-chain (a hash of a pre-prompt), and zkML could be used to prove that some public inference is the correct result of a secret pre-prompt and prompt, as well as a configured and agreed model.

Then the agent could also control tools like a “change of ownership” tool in order to update this. Of course you would have to set a temperature of 0 to prevent abuse from the operator, and also assume that an operator has access to the pre-prompt (or you could have a trusted setup and then an MPC to hide the pre-prompt forever…)

You can imagine that conversations with the LLM could be rate-limited and gated (and ordered) on-chain, via a token, and potentially even private between the self-willed and the NFT.

zkML has seen a lot of advances, notably ICME’s Jolt Atlas, Zkonduit’s EZKL, the Mina zkML library, PSE’s circom-ml library, the work of Modulus Labs, and the work of Daniel Kang. Check it out, it’s a really interesting subfield of ZK! (or a subfield of AI, whichever you’re from.)

It was six years ago, when I joined the security team of Libra/Diem at Facebook. Two years later I was security lead and I had learned a huge number of lessons, some even life lessons.

I’ve been trying to motivate myself to record a vlog of some sort with some of the lessons learned during that time. It was a hectic two years during which I got my first gray hair, attended a house party with Mark Zuckeberg, grilled some s’mores on the Facebook campus while stalling all night to help announce the Libra project to the world at 6 AM, met a kidnapper as part as wanting to extend my crypto security circle, and wrote a book while traveling the US during covid.

But anyway, while I find the time and the will to record that one, I thought I would talk about a book that I rarely talk about, the security engineer handbook.

It’s a tiny read, with no bullshit and fluff, that contains a huge amount of learnings and gotchas that one should know about when joining a security team, and trying to make it, as a first timer. A huge amount of lessons I learned from are in that book, and I would recommend it anyone who’s in school and learning about security, or getting started in a security team, or working at a security team and wondering about the meta.

Anyway, it’s here.

suggested reads:

elsewhere

book Real-World Cryptography Applied cryptography, from Manning. podcast Two And A Half Coins Crypto, banking & distributed systems. youtube Cryptography videos Concepts & security, explained.
page info:
page 1 of 64
631 posts total