← Latest papers
💻 computer science

Misquoted No More: Securely Extracting F* Programs with IO

This paper introduces SEIO*, a framework that combines relational quotation with verified syntax generation to securely extract shallowly embedded F* programs with IO and refinement types into a deeply embedded calculus, providing machine-checked proofs of Robust Relational Hyperproperty Preservation (RrHP) to guarantee security against arbitrary adversarial linking.

Original authors: Cezar-Constantin Andrici, Abigail Pribisova, Danel Ahman, Catalin Hritcu, Exequiel Rivas, Théo Winterhalter

Published 2026-07-20
📖 7 min read🧠 Deep dive

Original authors: Cezar-Constantin Andrici, Abigail Pribisova, Danel Ahman, Catalin Hritcu, Exequiel Rivas, Théo Winterhalter

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Invisible Safety Net

Imagine you are a master architect who has designed a magnificent, self-driving car in a perfect, imaginary world where physics always behaves exactly as you predict. You have written the blueprints in a special, super-precise language that allows you to mathematically prove the car will never crash, never brake when it shouldn't, and always follow the rules of the road. This is what computer scientists call "formal verification." It's like building a car in a dream where you can be 100% sure of every bolt and wire.

But here's the catch: that dream world doesn't exist on the real road. To actually drive the car, you have to translate your perfect blueprints into a language that real engines and tires understand, like C or OCaml. This translation process is called "extraction." The problem is, the translator (the computer program that does the conversion) isn't perfect. It might drop a bolt, twist a wire, or misunderstand a rule. If the real-world car is built on a mistake made during translation, your perfect proof of safety becomes useless. The car might look safe on paper but crash in reality.

For years, scientists have tried to fix this by checking the translator's work after the fact, kind of like a mechanic inspecting a car after it's built to see if it matches the plans. But this paper introduces a smarter way: instead of just checking the finished car, they build a "safety certificate" during the translation that proves, mathematically, that the real car is a perfect twin of the dream car, even if the translator makes a mistake. They call this a "secure extraction" framework, and it's designed to keep your digital creations safe even when they are mixed with messy, unverified code from the outside world.


The Paper's Big Idea: The "Relational Quotation" Magic Trick

The authors of this paper, a team of computer scientists, have built a new framework called SEIO★ (Secure Extraction of IO-star). Their goal was to solve the "translation problem" for programs written in F★, a language used to write highly secure software like cryptographic tools. These F★ programs are often "shallowly embedded," which is a fancy way of saying they are written in a high-level, abstract style that's great for proving things but hard for computers to turn into real code.

Usually, when you turn these abstract programs into real code, you have to use a "metaprogram" (a program that writes other programs) to do the heavy lifting. The old way of doing this was risky: the metaprogram would write the new code and then try to write a proof that the new code was correct. If the proof failed, you'd have to start over. If the proof passed, you still had to trust that the metaprogram didn't sneak in a bug while writing the proof. It was like asking a student to grade their own homework and hoping they didn't cheat.

The authors' breakthrough is a technique they call Relational Quotation. Instead of asking the metaprogram to write the final code and the proof, they ask it to do something much simpler: write a typing derivation. Think of this as a step-by-step recipe card that says, "Step 1: Take this ingredient. Step 2: Mix it with that." This recipe card doesn't actually cook the meal; it just proves that the ingredients could be cooked into a specific dish.

Here is the clever part:

  1. The Metaprogram (The Recipe Writer): The unverified metaprogram looks at the original abstract program and generates this "recipe card" (the typing derivation). Because the recipe card follows the exact structure of the original program, it's very easy to write.
  2. The Check (The Inspector): The F★ language itself checks this recipe card. It asks, "Does this recipe actually describe the original program?" If the metaprogram made a mistake and wrote a recipe for a cake when the original was a soup, the check fails. But if the recipe matches, the F★ language is 100% sure that the recipe is valid.
  3. The Verified Step (The Master Chef): Once the recipe card is verified, a different, fully verified function (a "Master Chef" that has been mathematically proven to be perfect) takes that recipe and cooks the final dish (the real code). Because the recipe was proven to match the original, and the chef is proven to cook exactly what the recipe says, the final dish is guaranteed to be a perfect twin of the original.

This approach minimizes the "trust" we have to place in the unverified metaprogram. We only trust it to write the recipe, not to cook the food or grade the homework. The hard part—proving the food is safe—is done by the verified Master Chef.

The "Secure Compilation" Superpower

The paper doesn't just stop at making sure the code is correct; it goes a step further to ensure it is secure. In the real world, your verified program might get linked with other code that is not verified—maybe code written by a hacker, or just sloppy code from a different team. This "adversarial" code tries to break your program's rules.

The authors prove that their SEIO★ framework satisfies a super-strong security rule called Robust Relational Hyperproperty Preservation (RrHP). To understand this, imagine your verified program is a fortress.

  • Old methods might say, "The fortress walls are strong, so it's safe."
  • This paper says, "Even if a hacker tries to sneak in through the back door, or if they try to trick the guards, or if they try to change the rules of the game, your fortress will still behave exactly as you designed it."

They prove this using two "logical relations," which are like two-way mirrors. One mirror checks if the real code does everything the abstract code could do. The other checks if the real code doesn't do anything the abstract code couldn't do. By proving both, they show that the real code is a perfect, secure shadow of the original, no matter what messy code it gets linked with.

What They Actually Did (and Didn't Do)

The team built this framework entirely inside the F★ language and used a computer to check every single step of their proof. They didn't just guess or simulate; they proved it mathematically.

  • What works: They successfully extracted programs that handle file Input/Output (reading and writing files) and use "refinement types" (types with extra rules, like "this number must be positive"). They showed that even with these complex features, the extraction remains secure.
  • What's still a work in progress: The paper admits that their current system doesn't handle recursive functions (functions that call themselves) or full "dependent types" (where types can depend on values) in the most natural way. They had to use a workaround involving iterators (loops) for recursion. They also note that their metaprogram sometimes has to guess where to put certain safety checks, which can be a bit clunky.
  • The Bottom Line: They haven't solved every problem in the universe of programming, but they have built a new, much safer bridge between the world of perfect proofs and the messy world of real code. They proved that by splitting the job into a "recipe writing" phase and a "cooking" phase, you can get strong security guarantees without having to trust the recipe writer completely.

In short, SEIO★ is a new tool that lets programmers take their perfect, verified ideas and turn them into real-world software with a mathematically guaranteed safety net, ensuring that even if the translation process is imperfect, the final result is still safe from the chaos of the outside world.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →