Checking how many agents are working

How this works
Kontakt
← Blog
A cinematic photograph of a brass robot at three brass doors of different sizes, one open, one with a small latch and one locked with a note, in teal and steel with a warm amber light, the AMARBARO mark and wordmark centred over it.
✎Blogbeitrag

Permissions: what an agent may do without asking

The short version

A guard of ours blocks the read commands ls, cat, head, stat, readlink and file only when they point into a virtual environment's bin folder or config file and the diagnosis tool has already confirmed the folder was moved.

What this is about

An agent that asks permission for every little thing is useless. An agent that never asks is dangerous. The useful middle is a set of rules that say which actions are free, which are checked and which need your yes.

This article gives you a simple way to sort actions into those three groups. It also tells a real story about a check of ours that blocked a harmless command, and why we keep it.

Why it matters

Remember the loop from the first article: choose an action, run it, read the result. Each action is something that really happens. Reading a file changes nothing. Deleting a folder cannot be undone.

If you give an agent the same freedom for both, you will either be clicking "allow" all day or one day find a folder gone. Sorting actions in advance, once, saves both.

How it works

The three groups

Free: reading and looking. Reading a file, listing a folder, searching, checking a status. These change nothing. An agent should do them without asking, as much as it needs.

Checked: changing things inside a safe area. Editing a file in the project, running a test, creating a new file. These change things but can be undone, for example through version control. Let the agent do them, with a check around them: a test, a diff you will read, a backup.

Ask first: anything hard to undo, or that leaves your machine. Deleting data, pushing code to a public place, sending a message, spending money, changing system settings, anything involving a secret. The agent stops and asks, and says what would be lost.

The rule of thumb is in two questions. Can this be undone? Does it leave my machine?

Who does the sorting

You can write the list in the instructions. But, as the article on rules showed, a written list is a wish. For the groups that matter, add a check that blocks.

In our own setup, many of these are hooks: small programs that run before a tool call and say yes or no. A blocked call returns an error that says nothing in that call ran. Each check also names an escape hatch, a setting that lets a person switch it off for one deliberate call. We use an escape only with a reason written down.

Sorting by place

The same action can be free in one place and risky in another. Reading a file is free. Reading a file that holds a key is not. Editing a test file is checked. Editing a script that a running process uses can break that process.

So some checks look at the target, not just the action.

The harmless command that was blocked

This is the story we promised.

A virtual environment, or venv, is a folder of packages that one program uses. Move the folder and its internal paths still name the old place. The result is confusing. Error messages mention files from a different project. A person who reads the start-up scripts by hand sees paths that look like a second project and draws the wrong conclusion.

We had made this mistake several times. So we built a guard. It runs a diagnosis tool first. If the tool says the environment is healthy, the guard stays silent. Only when the tool says the environment was moved does the guard fire.

When it fires, it blocks the read commands ls, cat, head, stat, readlink and file, but only when they point into that environment's bin folder or its config file. Any other read passes.

Those commands are harmless in themselves. The guard blocks them because their answer is already known, and reading by hand leads to a wrong conclusion. The block message names the one full diagnosis and the one cleanup to run instead. It also states how many times the mistake has happened.

Why a harmless block is worth it

A guard that fires on a harmless call costs one blocked command. A repeated hand diagnosis costs a stretch of reading and a wrong turn. And a refusal that carries the fix ends the search in one line. A refusal that only says no sends the agent back to the same move.

What we still do not know

We have not counted how often the guard has fired, or how often a session got past it with another hand read. We do not know whether the repeats came before or after the guard was written. And we have one such guard, not a set. We say so because a check that nobody has tested in use is a wish in a costume.

Make your own list in ten minutes

  1. Write ten actions your agent might take.
  2. Mark each one: free, checked or ask first.
  3. For each "ask first," write what would be lost.
  4. For each "checked," write what check surrounds it.
  5. Pick the one "ask first" you worry about most, and make it a real block, not only a sentence.
  6. Break it on purpose once, to see it work.

Glossary

  • Permission: a rule on what an agent may do.
  • Hook: a small program that runs before an action and can allow or block it.
  • Guard: a hook built for one specific mistake.
  • Escape hatch: a deliberate way to switch a check off for one call.
  • Virtual environment: a folder of packages one program uses.
  • Version control: a system, such as git, that records changes so they can be undone.
  • Undo: restoring something to the way it was before an action.

Try it

  • See how we package rules. The skills page shows how we write guidance for agents, including which mistakes to avoid.
  • Make your list. Do the ten-minute exercise above for the assistant you use. Which "ask first" action do you have no block on?
  • Read the long version. Our blog has "Ledger Blocked a Harmless ls" and "The Tool Gate Must Own the First Move."

Kommentare

Noch keine Kommentare.

Anmelden um zu kommentieren.