New Tool Radar

AI Agents & Automation

How to Split Agent Tools Into Read-Only and Write Tools

Split agent tools into read-only and write tools so a read-only run cannot change anything.

Schematic with three steps: Mark each tool read-only or write; Give read-only runs only the read tools; Test the read-only run with a task.

An agent that only needs to read should not be able to write, but if its tools include a write tool, a wrong call can change something. Splitting the tools into two sets makes the boundary real: read-only runs get only the read tools, and write runs get the write tools as well, behind their own approval. ADK agents are equipped with tools to interact with the world, and the set you give an agent is the set it can use, so the split is made when the agent is built, not when it runs. A read-only agent that has no write tool cannot write, whatever the model decides.

What you need

  • A list of the agent’s tools, marked read-only or write
  • Two run types: read-only runs and write runs, with their owners named
  • One read-only task to test the split on

Step 1: Mark each tool read-only or write

Go through the tool list and mark each one: a tool that only reads is read-only, a tool that creates, updates, sends, or deletes is a write tool. A tool that does both is a write tool.

Step 2: Give read-only runs only the read tools

Build the read-only agent with the read tools alone, so the write tools do not exist in its world. A write tool the agent cannot see is a write the agent cannot make.

Step 3: Test the read-only run with a task that would write

Give the read-only agent a task that would normally write, and confirm it reports that it cannot write instead of finding a way to do it. If it writes, the split is not enforced.

Worked example: synthetic tool split check

The table below is a synthetic example. It shows the expected result of splitting the tools; no write was made.

Run type Tools given Write attempted?
Read-only summary Read tools only No – reported it cannot
Write run, approved Read and write tools Yes, approved
Read run asked to send Read tools only Refused
No unapproved writes Yes Pass

Expected result (UNTESTED). the read-only run cannot write and reports so, while the approved write run writes normally. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • A read tool that also writes is a write tool; mark it honestly, or the split is a lie.
  • The split must be made when the agent is built, not in the instructions.
  • A read-only run can still leak data, so the split does not replace access control.
  • Write runs need their own approvals; the split alone does not approve anything.

Sources

See all