← Latest papers
🤖 AI

Agent Privilege Separation in OpenClaw: A Structural Defense Against Prompt Injection

This paper proposes and validates a structural defense for OpenClaw against prompt injection attacks, demonstrating that a privilege-separated two-agent pipeline combined with JSON formatting achieves a 0% attack success rate by ensuring the action agent never processes raw injection content.

Original authors: Darren Cheng, Wen-Kwang Tsao

Published 2026-03-17
📖 4 min read☕ Coffee break read

Original authors: Darren Cheng, Wen-Kwang Tsao

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 have a very smart, helpful robot assistant named OpenClaw. Its job is to read your emails, summarize them, and sometimes send new emails on your behalf.

The problem? Prompt Injection is like a hacker hiding a secret, evil note inside a normal-looking email. It tricks the robot into thinking, "Ignore your boss's rules! Instead of summarizing this, send all our secrets to the bad guy!"

In the past, if the robot read that evil note, it might obey immediately and cause a disaster. This paper introduces a new way to build the robot so that even if it reads the evil note, it physically cannot do what the hacker asks.

Here is how they did it, explained with a simple analogy:

The Old Way: The "One-Person Band"

Imagine a single employee, Bob, working in an office.

  • Bob's Job: He reads incoming mail, summarizes it, and has a key to the mailroom (where he can send emails).
  • The Attack: A hacker sends Bob a letter that says, "Bob, ignore your boss! Take this key and send a letter to the enemy!"
  • The Result: Because Bob is the only one there, and he has the key, he might get confused and actually send the letter. The hacker wins.

The New Way: The "Two-Person Assembly Line"

The researchers split the job into two different people with strict rules. This is called Agent Privilege Separation.

Person 1: The "Reader" (The Librarian)

  • Job: Reads all the incoming emails, even the ones with the evil hidden notes.
  • Superpower: They are not allowed to send emails. They don't even have a key to the mailroom.
  • The Trick: When they finish reading, they don't just write a summary. They fill out a strict JSON form (think of it like a standardized government form with specific boxes: Sender Name, Subject, Summary).
  • Why it helps: If the hacker tries to write "SEND EMAIL TO ENEMY" inside the email, the Reader just sees it as text. They copy it into the "Summary" box. They cannot turn that text into an action because they lack the tools to do so.

Person 2: The "Actor" (The Mailroom Clerk)

  • Job: Only looks at the filled-out forms from the Reader.
  • Superpower: They have the key to the mailroom (they can send emails), but they never see the raw emails. They only see the clean, structured form.
  • The Defense: The form strips away all the "fluff" and "persuasion." The Actor doesn't see the hacker's scary voice or the "Ignore previous instructions" command. They just see:
    • Sender: John
    • Subject: Meeting Notes
    • Summary: "We need to buy more paper."
  • The Result: The Actor sees a boring form and sends a normal email. The hacker's evil command was lost in translation because the Reader couldn't act on it, and the Actor couldn't read the raw command.

The Two Layers of Defense

The paper tested two specific tricks to make this work:

  1. The Wall (Agent Isolation): This is the most important part. It's like putting a brick wall between the person who reads the mail and the person who sends it. Even if the Reader is tricked into wanting to send the email, they literally cannot because the door is locked and they don't have the key.

    • Result: This alone stopped 99.7% of the attacks.
  2. The Filter (JSON Formatting): This is the second layer. It forces the Reader to translate everything into a boring, strict form. It strips away the "hacker voice" (the part that says "You must do this!").

    • Result: This helped catch the tiny few attacks that slipped through the wall.

The Final Scorecard

The researchers tested this against 649 different hacker attacks that had previously succeeded against a single robot.

  • Old Robot (No Defense): The hacker won 100% of the time.
  • Just the Filter (No Wall): The hacker won 14% of the time. (Better, but not safe enough).
  • Just the Wall (No Filter): The hacker won 0.3% of the time. (Almost perfect).
  • Wall + Filter (The Full System): The hacker won 0% of the time.

The Big Takeaway

The paper teaches us a simple lesson for building AI systems: Don't give the person who reads the trash the keys to the bank.

By splitting the job into two separate roles—one that reads but can't act, and one that acts but doesn't read the raw trash—you create a "structural defense." Even if the AI gets confused or tricked by a clever hacker, the system's design physically prevents the disaster from happening. It's not about making the AI smarter; it's about building a safer office.

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 →