← All posts

Delegate wisely: my AI agent is not allowed to take initiative

How my personal AI agent on OpenClaw is built: it reads Telegram and Google Chat, files tasks in Todoist and collects them in Google Docs. Only on command, read-only by construction, a label on every task, and Ansible instead of manual setup.

Everyone talks about AI, but few people understand how and where exactly it can and should be applied. Today I will show how I use an AI agent in my daily work. With the commands, the mistakes and the bill for the first three days.

Some people believe that AI is "intelligence" and that it is going to replace somebody. In my view, it will simply help us separate truly intellectual work from pseudo-intellectual work, so that we can stop wasting time on nonsense. Personally, I use AI first of all as a highly efficient text processor. If you need to process large volumes of text quickly, that is a good place to apply AI.

The use case: 30 tasks an hour from different chats

I usually have many projects running at the same time. Sometimes everything goes calmly and to plan, and sometimes up to 30 new tasks land on me within an hour from different messengers and chats. My task management system is already in place; this is not about it. But collecting context from several messages into one task, and copying every screenshot and the text of every voice message into it, simply takes a long time. Sometimes it is easier to write the task down by hand, but sometimes there is a lot of context, and I call in the neural networks.

A chat is not an agent yet

The AI itself, or more precisely an LLM, a large language model, usually comes with a chat interface where you type questions and get answers. Real work needs agents: programs that can connect to real external systems and interact with them. For development people usually use Claude Code, Codex and others. For more casual scenarios I prefer OpenClaw.

To set everything up you need your own server, at home or in the cloud, and access to every tool you care about. It does not take much hardware: my agent lives in a Docker container on a machine with 1 vCPU and 2 GB of RAM, which costs about $12 a month in the cloud. I do not host the models; I pay for tokens through OpenRouter.

And to do the setup itself I, of course, use Claude Code or something similar. I just ask it what is needed to connect Telegram, Google Chat and everything else, and off I go.

The interface: a Telegram bot and a group with topics

I chose Telegram as the interface. You create a Telegram bot and plug its token into OpenClaw. After that you write to the bot in Telegram and it returns the model's answers. The bot answers only me: the config has an allowlist of users with one person on it.

I also like the approach of a separate Telegram group with topics. The bot is added to the group, and each topic is bound to its own agent. I have four: general, coach, tasks and CRM. Each has its own instructions, its own memory and its own sessions. The coach knows nothing about my work, and the work agent does not know how much I bench. That suits me.

The task agent is called Jedi, after Maxim Dorofeev's book "Jedi Techniques": that is the method it uses to phrase tasks. The rest of this article is about Jedi.

Access: "read-only" has to be a fact

For the agent to work with the messages in my chats, it needs access to them. This is where it gets interesting.

A bot cannot see anyone else's conversations at all: it only receives what is addressed to it. That is a property of the Telegram Bot API, not a checkbox in the settings. Reading my chats takes my own user session: an api_id and api_hash from my.telegram.org plus a login with a code. And a Telegram user session has no read-only mode. It is a full second login to the account, able to send, delete and forward.

I grant read-only access, because I consider making an AI speak in my place disrespectful to the people I talk to. But writing "please do not send anything" in the agent's instructions is not a restriction, it is a wish. So it is built like this:

  • the session sits on the host, in a file that the user running the agent's container cannot read;
  • next to it runs a small daemon under its own account. It knows a few read requests: list chats, read messages, search, fetch a file;
  • a single UNIX socket is mounted into the container. The daemon answers 405 to anything that is not a GET.

How read-only access to Telegram is enforced: the session stays on the host, the agent only gets a socket

The session stays on the host. The agent gets a socket that only answers reads.

The agent is physically unable to send a message in my name. You can persuade it, trick it, or break it with a prompt injection hidden in somebody's message, but it simply has no "send" button. If I ask it to reply to someone, it writes a draft and I send it. As a bonus, the other person does not see their messages being read: no read receipts go out.

Work chats in Google are simpler, because there the permissions are cut down on Google's side: a service account with domain-wide delegation and a set of read-only scopes. There is no write path, neither in the code nor in the granted permissions.

Where the agent writes: Todoist and Google Docs

Now for access to the other systems. I use Todoist for personal tasks, so I connected it with an API token from its settings. Out of everything Todoist can do, the agent gets four actions: find labels, find tasks, create a task, add a comment. It cannot edit, complete or delete. It files, I sort.

I also like to group tasks of the same kind into one document, so that I can hand it to my development agent and implement, in one go, all 20 features that piled up over the past week. Convenient? Convenient. That is what Google Docs is connected for. The agent knows that when I ask it to collect the tasks with a certain label, it has to create a new tab in our shared document, with the date in its name, and put all the context there. The script can only add a tab. It does not touch existing ones, and it refuses if the name is taken. Then I edit the document and export it to PDF to hand over to Claude.

What the agent reads and what it may write

Reading is wide, writing is narrow, and there is nothing to send with.

Control stays with me

I deliberately keep quite a lot of control in my pipeline. The agent's instructions have a section called "Proactivity", and it begins with the words "There is none."

Here is how it goes. I see that relevant messages have piled up in a chat, I decide the agent will get through them faster than I would, and I write in the topic: "look at such-and-such chat for today". Then the agent:

  1. Reads the whole period, not a sample, threads included.
  2. Finds what I have to do or follow up on: requests addressed to me, my own "I'll do it, I'll take a look, I'll send it tomorrow", and things I asked other people to do.
  3. Checks whether such a task already exists.
  4. Shows me a numbered list: title, where it came from, how many files. On a separate line, what it decided was not a task, and why.
  5. Waits. I answer "all" or "all but the third" and fix the wording.
  6. Only then creates the tasks in the Inbox.

The agent marks every task it creates with an AI label, so I can see what was created by the agent and what by me.

Six steps from a chat to tasks: two by me, four by the agent

Two of the six steps are mine: the start and the approval.

Three problems I ran into

The most useful part of stories like this is not the architecture but what went wrong.

It paraphrased. On the very first day the agent started putting a neat summary of the conversation, in its own words, into the tasks. It sounds harmless until you realise that a week later you will be doing the task from a retelling, not from what the person said. Persuasion does not fix this. Now the agent only chooses the messages, and a script carries the text and the screenshots into the task:

tg.py quote <chat> 1231 1232 1240 --json | todoist.py comment <task> --stdin

The other person's words never pass through the model, so it cannot distort them. The instructions put it this way: "A paraphrase instead of the original is an error, even if it is accurate." The agent writes its own analysis as a separate, marked comment, so it cannot be mistaken for the conversation.

The screenshot arrived as a word. Instead of a picture, the task had a line saying "Attachments: image.png". Technically correct: there was an attachment. Now files travel down the same pipe as the text, and each one is attached to its own message.

A bill for "nothing changed". OpenClaw has a heartbeat: the agent wakes up on a schedule and checks whether anything needs doing. The first three days came to about $14, and a noticeable share of that went on wake-ups whose result was "nothing changed": each one is a full paid request to the model. The rule is simple now: anything that can be written as a shell script that always does the same thing is done by a systemd timer, not by a neural network. Syncing the agent's settings with git, for one, moved there.

And a small one for dessert: Todoist silently creates a new label for any word it does not know. Say "devops" to the agent, and devops moves in next to DevOps. So the agent is forbidden to create labels; it may only match against existing ones.

What exactly I delegate

All of this comes down to one thing. For me the AI agent is an addition to a productivity system I had already built. The "intelligence" of artificial intelligence does not take creative work away from me. It saves me the time spent hauling context between systems. The most intellectual thing it does is understand what I am asking for, find the tasks in a conversation and phrase the titles. For that, by the way, it runs on a smarter model than its neighbours: deciding what in a chat counts as a task is the one place where judgement is needed. Everything else is tools and scripts.

I think this is a good example of delegation. I am not sweeping the logic of my work under the AI rug; I hand over specific mechanical operations, one by one. And whatever does not require judgement stays with me.

The agent's setup as code

One important note. Setting up an agent is no great pleasure either. So this is how I do it. I have Claude Code, and together we build an Ansible project. In essence, it is a declarative description of the state of my server and my agent, listing point by point what to configure and how. It has about twenty roles by now: firewall, SSH, fail2ban, auditing, Docker, OpenClaw itself, the Telegram reader. All of it is applied with one command:

make apply    # bring the server to the described state
make verify   # check that it really is in that state

I like the second command more. It does not trust the configs, it checks everything with scripts on the server: it reads a message from inside the container, sends a POST to the socket and demands a 405 back, tries to read the Telegram session file as the agent and demands that the kernel refuse. Rules such as "read-only access" are checked by a test, not from my memory of how I set it up.

Two things are kept apart on purpose. The agent's character (instructions, memory, notes) lives in a git repository, and the agent can edit it itself. Its permissions (which tools it has, which model, who may write to it) live in Ansible, and the agent cannot write to them. Otherwise an agent that can commit will one day quietly widen its own powers. Persona in git, permissions in inventory.

When my hosting provider was hacked and keys leaked, I calmly deleted the server, revoked every access on the list and created new ones. The list did not come from my head either: every secret is named in one file, with a comment on where to get it. Then I brought up a fresh server, and Claude restored OpenClaw from my Ansible description exactly as it had been, in a matter of minutes.

So even Claude Code is not a magic genie that configures everything. It is a translator of my wishes into Ansible scripts. A kind of interactive documentation for Ansible and the external APIs.

The moral

The moral of the story is this. Study agents and tools, but delegate wisely! A good manager does not hand the work over to a contractor and walk away; they do the work themselves, just with someone else's hands. In the same way, you should bring your work down to clear, understandable, mechanical actions, which can then be offloaded to AI beautifully.

In short, for those deciding whether to let agents into their company:

  • Process first, agent second. An agent speeds up a system that already works. It speeds up chaos too.
  • Put the bans in permissions, not in the prompt. "Do not write to clients" should mean there is nothing to write with.
  • A human starts it and a human approves it. The agent proposes a list, a person says yes.
  • Everything the agent did is labelled. A month from now you will want to know where that task came from.
  • Keep the setup in code. Otherwise the first incident turns into archaeology.

And if you do not want to spend a lot of effort assembling this Lego set yourself, come to us. We will help you both structure your processes and automate them with AI agents: with permissions, checks and an off switch.

Write to presales@its.xyz

Got an X?

Start with the free discovery. In a week you'll know where your Z is.

Start discovery