Giving an AI agent write access: the controls it must never be able to switch off
Giving an AI agent a way to act is easy. Making sure it can never approve its own action is the work. When BetterQA gave its chat and operations agent a controlled way to read internal Slack channels and propose posts, the design question was not what it can do, but what it can never do alone. These are the controls we put in, and the questions they answer for any agent with write access.
Propose, never approve
Every Slack post the agent tries to make becomes an approval card in the main channel and on an approvals page, with plain approve and reject buttons. Nothing is posted at that moment.
On approval, a dedicated executor checks the channel again and posts the text exactly as it was stored. What the person approved is what is sent, and it never takes the normal tool path where the agent could have changed it. A card that cannot be delivered is retired, and the caller is told that nothing was queued. The agent can never approve its own card.
Ask of your agent: can it approve its own action, and does the thing that runs equal the thing that was approved?
Read only what is internal, and fail closed
The read tools refuse a channel if any one of six flags is anything other than the boolean false: shared, externally shared, pending external share, organisation-wide shared, direct message or group message. Missing or odd values are refused, not guessed. Direct-message ids are refused outright. Message text is fenced, the history limit is capped and results are redacted.
We checked this against a real public channel and a real private channel: all six flags came back as booleans. Ask: what does the agent do with a value it does not recognise?
Two keys that cannot be the same
The Slack tools live behind their own key that unlocks those tools and nothing else. The service refuses to start if the full key and the Slack key are the same value. A session created under one key and reused under another is refused. The full-access tool list no longer shows Slack tools at all, and the Slack-only key lists exactly four. Ask: if the narrow credential leaks, what can it do?
Prove each control by switching it off
Each of five build tasks had its own adversarial review. Mutation tests then switched off each piece in turn: the scope handoff, the internal-channel gate, the check at approval, the dedicated executor, the retirement of undelivered cards. Each broke named tests. A control nobody has seen fail is a hope.
A checklist for your own agent
- List what the agent must never do alone, and enforce it where the action happens.
- Check at the consequence: re-check the channel at approval, not only at proposal.
- Refuse the unknown. A value you do not recognise is a no.
- Give the agent a credential that unlocks its tools and nothing else.
- Watch each guard fail. Switch each part off and see a test go red.
Letting an agent act in your systems? BetterQA, a software testing company in Cluj-Napoca, tests what an agent can do alone and what it can never do alone. See our QA outsourcing service. The first month is a trial.