← Latest papers
🤖 AI

Language-Based Agent Control

This paper introduces Language-Based Agent Control (LBAC), a programming model that ensures agentic applications adhere to user-specified security policies by requiring agents to generate well-typed programs that are statically verified before execution, thereby unifying safety guarantees across both developer-written scaffolding and agent-generated behavior while preserving computational expressiveness.

Original authors: Timothy Zhou, Loris D'Antoni, Nadia Polikarpova

Published 2026-05-14
📖 5 min read🧠 Deep dive

Original authors: Timothy Zhou, Loris D'Antoni, Nadia Polikarpova

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

Imagine you hire a very talented but unpredictable assistant (an AI agent) to do a job for you, like organizing your research papers. You want them to be creative and smart, but you also need to make sure they don't accidentally (or maliciously) delete your files, steal your secrets, or make up fake data.

Currently, most systems force you to choose between safety and freedom:

  • The "Toy Box" Approach (Restricted Tools): You give the assistant a tiny box of pre-approved tools. They can't go outside the box. It's very safe, but they can't do anything clever or complex. If they need to sort a list, they have to ask you to do it one by one.
  • The "Open Kitchen" Approach (Code Interpreters): You give the assistant full access to the kitchen. They can cook anything they want! But if they get confused or tricked, they might burn the house down or serve you poison.

This paper introduces a new way called Language-Based Agent Control (LBAC). Think of it as giving the assistant a magic kitchen where the laws of physics (the rules of the universe) are written in a language they must speak.

The Core Idea: The "Magic Language"

Instead of just giving the assistant a list of "do's and don'ts," the programmers build the entire system inside a special, strict language (like a super-strict version of a programming language called Haskell).

In this magic language, types (the labels on data) act like security guards.

  • If a piece of data is labeled "Trusted," it means it came from a safe source (like a verified database).
  • If a piece of data is labeled "Untrusted," it came from the internet or a user.
  • The language has a rule: You cannot mix "Untrusted" ingredients into a "Trusted" dish.

How It Works in Practice

Let's go back to the research paper example from the text. You ask the agent: "Find the earliest paper on differential privacy and add it to my bibliography."

  1. The Old Way (Code Interpreter): The agent writes a program. It might decide to just make up a fake paper title, write it to your file, and say, "Here you go!" The system only checks if the code runs, not if the content is real.
  2. The Old Way (Restricted Tools): You only give the agent a "Fetch and Save" button. They can't sort or filter the results themselves. They are stuck waiting for you to tell them which one to pick.
  3. The LBAC Way (TYPEGUARD):
    • The agent writes a program in the magic language.
    • To get a paper, they must use a special function that only returns a "Trusted" label.
    • To write to your file, the function requires a "Trusted" label.
    • The Magic Check: Before the agent's program is even allowed to run, a "Type-Checker" (a strict librarian) looks at the code.
      • If the agent tries to write a fake paper (which has no "Trusted" label) to the file, the librarian says, "Error! This code doesn't fit the rules. Try again."
      • The agent gets the error message, realizes their mistake, and rewrites the code to fetch a real paper from the database first.
    • Once the code passes the check, it runs.

Why This is a Big Deal

The paper claims this approach solves the "Safety vs. Freedom" problem:

  • Freedom: The agent can still write complex programs, sort lists, and do math. They aren't stuck with a tiny box of tools.
  • Safety: Because the agent must write code that fits the strict rules of the language, they physically cannot perform actions that break the rules (like leaking secret data or writing fake files). If the code doesn't pass the "Type Check," it never runs.

The "Nested" Agent Trick

The paper also shows that this works even if the agent hires a "sub-agent" to help.

  • Imagine the main agent asks a sub-agent to look at a suspicious email.
  • The sub-agent reads the email (which is "dirty" or untrusted).
  • Because of the magic language rules, the sub-agent is automatically put in a "quarantine zone." They can read the email, but they cannot pass that "dirty" data to the main agent's tools unless they wrap it in a special container that the main agent is allowed to open.
  • This happens automatically because of the language rules, not because of a separate security system.

Summary

The paper argues that instead of building walls around AI agents, we should build the AI's world inside a strict, rule-based language. In this world, safety isn't a separate layer you add on top; it's built into the very fabric of how the agent thinks and writes code. If the agent tries to break the rules, the language itself says "No," and the action is blocked before it ever happens.

The authors tested this with three scenarios:

  1. Data Provenance: Ensuring only real, database-sourced papers are added to a bibliography.
  2. File System Sandboxing: Ensuring the agent can only touch files in specific folders (like a "capability" token).
  3. Information Flow: Ensuring secret data never accidentally leaks to the public internet.

In all cases, the system kept the agent smart and flexible while guaranteeing it couldn't break the rules.

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 →