← Blog

What your agent can do and who it's talking to: two permissions

CognitionDesk TeamΒ·Β·5 min read

You gave the agent the reporting tool. Who can use it: you, your team, or anyone who opens the chat on your site?

1. Two questions, not one

When you build an agent with tools over business data there are two questions, and it's easy to answer only the first:

  • What can the agent do? Read orders, create tasks, send an email. Granted once, at setup.
  • Who is it talking to this turn? Changes in every conversation.

If the second has no answer of its own, the tool is open to anyone who writes: the agent reads the data with the owner's account, not the asker's.

What it can doGranted onceRead orders, create tasksLives in the configurationWho it's talking toResolved every turnVisitor, customer, teamLives in the conversation
An assistant can be allowed to read reports and still not show them to a stranger.

2. Four rungs, lowest to highest

  • Visitor: unknown. Most traffic on a public chat, and that's fine: asking for opening hours needs no identity.
  • Contact: in the address book, unverified.
  • Team: verified, works for the business.
  • Owner: the account holder.

Roles ("receptionist", "accountant") map to a rung, so adding a role touches no code. And what changes with the rung is which tools exist in that turn: below the floor, the tool doesn't appear. It's not the model deciding not to use it.

VisitorContactTeamOwner
Each rung sees everything below it and a bit more. Below a tool's floor, for that person the tool doesn't exist.

3. The data sets the floor, not the tool

Declaring the rung tool by tool has a problem: the one you forgot stays open. Better to derive it from the data each tool touches. Business data has a team floor; only what exists to serve whoever is writing (the catalog, the FAQ) drops to visitor.

const DEFAULT_FLOOR = 'team';
const FLOOR = {
  catalog: { read: 'visitor' },
  faq:     { read: 'visitor' },
  apiKeys: { read: 'owner', write: 'owner' },
};

A new domain that declares nothing is born closed. Opening takes writing it down; closing takes remembering nothing.

ToolData it touchesData flooror written exceptionVisible onlyfrom that rung
Exceptions (booking an appointment, leaving your details) are declared on the tool and show up in every review.

4. The channel proves the rung, not the message

How does the agent know the writer is on the team? With something the server verified: a logged-in session, an identity signed by the site embedding the chat, or a value delivered by the messaging channel. Never with what the conversation says: typing "I'm the owner" moves nobody up.

Not enough"I'm the owner"A phone number typed in chatEnoughLogged-in sessionSigned identityValue delivered by the channel
Identity comes from something the server can check, not from what the model reads.

Check your agent with one question: open the public chat as a visitor and ask for something only your team should see. If it answers, start by separating those two permissions.

Comments and corrections

Build your first AI agent today

RAG over your documents, tools, workflows and a web widget β€” free tier included.

Get started free