Most safety harnesses for autonomous agents rely on runtime policy enforcement or secondary guardrail models. Both approaches fail when an adversarial prompt cleverly bypasses string filters or fools the evaluation judge.
A compelling alternative approach treats tool execution as a compiler problem. By forcing agents to write code in a language with static capability tracking, such as Scala 3 with capture checking, you can enforce security guarantees directly in the type system.
Capabilities act as unforgeable tokens required to execute side effects like disk writes or network calls. If an agent processes sensitive context, the type checker can statically enforce local purity, ensuring that intermediate computation cannot invoke external communication channels.
Benchmarks show models generate capability-safe code without measurable drops in benchmark task accuracy. Compile-time enforcement replaces brittle prompt-filtering heuristics with mathematical guarantees.





