A bounded programming language for safe AI agent operations.
Project details
Leashterm is a specialized programming language designed for AI agents, emphasizing safety and accountability. With features like upfront permission declarations, bounded retries, and a tamper-evident audit log, it ensures that AI programs operate securely and with transparency, making it ideal for sensitive applications.
Leashterm is a compact programming language designed specifically for AI agents, emphasizing security and bounded execution. Unlike traditional programming languages that allow unrestricted actions followed by sandboxing, Leashterm integrates essential constraints directly into its syntax, ensuring safer operation from the outset.
needs directive. Any attempt to access undeclared resources is blocked, enhancing security.retry N { ... }, where N is a fixed number from 1 to 10. This prevents infinite loops and uncontrolled retrying.verify a == b, the program automatically halts if conditions do not hold, ensuring that only valid operations are executed.retry) and iteration over finite lists (for), preventing endless loops.--max-steps. This safety mechanism prevents unintended computational escalation, especially important when using nested operations.Leashterm is structured less as a general-purpose language and more akin to an executable capability manifest, tightly coupling predefined permissions with computation. The driving design philosophy is to minimize capabilities to ensure that each program admits a clear pre-execution upper bound on both its functionality and the work it can perform. This allows for effective capability checks before execution, maintaining control over agent actions while providing useful computational ability.
Here's a brief example demonstrating Leashterm syntax:
# comment
needs read("notes.txt") # declare permission to read
needs write("out.txt") # declare permission to write
let text = read("notes.txt") # read from file
print(text) # output the content
verify len(text) == 10 # check if text length is 10
retry 3 { # retry the block up to 3 times if failed
let t = read("maybe.txt") # attempt to read another file
}
if trim(text) == "yes" { # conditional execution
print(concat("got: ", text))
} else {
print("no")
}
for f in ["a.txt", "b.txt"] { # loop through provided files
print(read(f))
}
Within this framework, the language values safety and accountability. It enforces strict computational limits while enabling meaningful work, striving to balance power and security in AI systems.
Comments
0Start the conversation
Share the first comment.