Truss: A programming language designed for agent-written software Bret Taylor published a prototype of Truss, a programming language designed for code written by AI agents rather than humans, which shifts the design goal from authoring convenience to human verification and correctness. Truss organizes packages around contracts that specify data structures, functions and formally verified behaviors, with providers such as HashMap and SortedMap required to supply a proof file (package.proof) demonstrating conformance, so the compiler can validate a provider against a contract an order of magnitude faster than constructing the proof itself. Taylor, who described Truss as "just a prototype," said he hopes to start a conversation about platforms needed for provably correct, verifiably secure and fast agent-written software. Truss Truss is a programming language optimized for agent-written software. Truss aims to make software more reliable, secure, and performant by embracing the unique strengths of AI agents. Traditional programming languages were designed for the ergonomics of human authors, effectively optimizing for the convenience of writing code. Truss, in contrast, assumes code is no longer written by hand, but instead written by AI agents. This fundamental assumption changes most of the design considerations for Truss relative to traditional programming languages: | Traditional programming language | Truss | |---|---| | Optimize for human editing | Optimize for human verification | | Optimize for convenience | Optimize for correctness | | Minimize human authoring time | Spend tokens at authoring time to improve enduring correctness and performance | Rather than optimizing for authoring convenience, Truss requires quite a bit of reasoning at authoring time to verify a program's correctness and performance. That tradeoff is sensible for agent-written software because it is not a burden to the software engineer and the one-time token spend can produce software with enduring robustness. Popular programming languages like Rust are a small step in this direction, providing compile-time memory safety — making Rust code a bit harder to write for humans, but a fantastic language target for AI. Truss takes this idea a few steps further, formally verifying behaviors well beyond memory management. I Bret Taylor https://backchannel.org/ think we will probably rewrite most software written before AI because that software is imperfect, insecure, and slow. I would like to have software that is provably correct, verifiably secure, and incredibly fast, and I would like to be able to use agents to produce software of unparalleled scale and complexity that has those qualities. Truss is just a prototype, but I was hoping to start a conversation about the platforms we need to design to achieve that vision. The atomic unit of a Truss package is a contract. A contract specifies data structures and functions along with their formally verified behaviors, including what they return, what memory they can access, and what state they can change. Providers implement contracts. For example, a Map contract could have multiple providers, a HashMap and a SortedMap . Each provider must provably satisfy all the claims in the contract, and each provider provides evidence of their conformance in the form of a proof alongside the implementation source code. library/collections/map/ map.truss The Map contract package.truss Map dependencies inline/ inline map.truss InlineMap implementation of Map package.truss InlineMap dependencies package.proof Evidence that InlineMap satisfies Map sorted/ sorted map.truss SortedMap implementation of Map package.truss SortedMap dependencies package.proof Evidence that SortedMap satisfies Map When your program uses Map , the Truss compiler will generate a proof of its correctness by relying on the claims in the Map contract without having to independently verify each provider. When you bind Map to a provider like InlineMap , Truss uses the supplied evidence in package.proof to independently verify its conformance, a simple validation process that can be an order of magnitude faster than constructing the proof itself. This approach enables formal verification to scale with large code bases, pushing the majority of the work of formal verification to package authors; when you publish a package, you spend as many tokens generating proofs as you do writing the code, and the programs depending on your package don’t need to recreate your efforts. Truss brings verification all the way to code generation. A provider proves that it implements the contract. The compiler proves that its translation preserves the body’s observable behavior. A separate-compilation rule proves that the guarantee survives linking against conforming implementations. We’re going to make a package that replaces one element in a slice of UInt64 words and returns the value it overwrote. replace-element/ package.truss replace element.truss inline/ package.truss inline replace element.truss package.proof Declare the contract in replace element.truss . The contract guarantees that the element at index is replaced by value , and also protects against buffer overflow: contract ReplaceElement { function replace words: &mutable Slice