# Safe AI access to CRM data: scopes, roles and an audit log

https://krokul.com/en/blog/ai-assistant-safe-crm-access/ · Krokul Team · Updated 2026-11-20

An AI agent is safe in a CRM when its access has three limits that the CRM enforces on the server: scopes that name the data, a role that names the employee it acts as and a log that a person reads. This guide shows how to choose each limit and how to check it before the agent touches live data.

**Short answer.** AI access to CRM data is safe when the agent has its own identity, the narrowest scopes that do the job, a role that limits what those scopes reach, no destructive tools and a call log that a person reads. Start with read scopes, add write scopes one record family at a time and review the log every week.

## When to review the access you give an AI agent

AI access to CRM data needs a review whenever an agent can read client records or change them. The guide on [connecting AI agents and other tools to a CRM safely](https://krokul.com/en/blog/topics/crm-ai-agents-integrations/) gives the general method, and this guide goes deeper into scopes, roles and logs.

- You are about to connect Claude or another assistant to the CRM and must decide which permissions to tick.
- A developer asks for an API key for an agent that will run on a schedule.
- A manager wants an assistant to create tasks after calls, and the owner asks what else it could touch.
- An auditor or a client asks who can reach cost, prices and payment data, and through which channels.

- **Scope** — A scope is a named permission, such as reading deals or writing tasks, that a key or a connection carries. A call outside its scopes is refused.
- **Role** — A role is the level of a person or a key in the company, such as administrator, manager or viewer. It limits what the scopes can reach.
- **Call log** — A call log is a record of every call an agent made, with the route, the result, the time and the address it came from.
- **Destructive tool** — A destructive tool is an action that removes, cancels, merges, archives or refunds records.

## How to give an AI agent safe access to CRM data in five steps

An AI agent gets safe access to CRM data in five steps, in a fixed order: name the job and the identity, tick the narrowest scopes, set a role as the second limit, keep destructive actions with people and read the log on a schedule. Each step removes one way for an agent to reach more than its job needs.

### 1. Name the job and give the agent its own identity

Write the job in one sentence, for example “read overdue invoices every Monday and create a reminder task”. The sentence decides everything that follows.

Use a personal sign-in when one person works with an assistant in a chat, and a named company key when a program runs with nobody at the screen. A shared administrator login hides who acted and cannot be taken back without changing the password for everyone.

### 2. Tick the narrowest scopes

Start with read scopes for the records the job needs, such as deals and client companies. Add a write scope only when a task requires it, and add it for one record family at a time.

For every scope you tick, name the task that needs it. A scope with no named task comes off the list.

### 3. Set a role as the second limit

Scopes answer which data an application needs, and the role answers which employee the application acts as. A CRM that checks both lets a viewer role with a read scope see deals and still hide cost.

Pick the lowest role that does the job, and keep the administrator role for a person.

### 4. Keep destructive actions with people

Removing, merging, cancelling, archiving and refunding are the actions that are hardest to undo. Keep them out of the tool list the agent receives, keep write scopes minimal, and let a person do these actions in the interface.

If a job truly needs one of them, grant it to that one key, write down why and set an expiry.

### 5. Read the log and set an end date

Open the call log once a week during the first month. Look for refused calls, calls over the rate limit and calls at unusual hours.

Give a key an expiry, and revoke a personal connection the day the job ends. A log that nobody reads protects nothing.

## Which scopes and role fit which kind of agent

The right scopes and role depend on what the agent does, and the table matches four common jobs to a starting setup. The values are an example, so adapt the list to your own records.

Example: starting scopes and role for four kinds of agent:

| Agent job | Scopes to start with | Role | Ends |
|---|---|---|---|
| Weekly answers about overdue invoices | companies.read, cards.read | viewer | Personal connection revoked when the pilot ends |
| Tasks created after calls | cards.read, contacts.read, tasks.write | manager | Key expires after 90 days |
| Dashboard that pulls reports | reports.read | manager | Key expires after a year and is reviewed each quarter |
| Support assistant that updates tickets | tickets.read, tickets.write, contacts.read | manager | Key expires after 30 days |

## Which mistakes to avoid when giving AI access to CRM data

- Using an administrator login for an agent hides who acted and grants every permission, so give the agent its own key or connection.
- Ticking every scope on a consent screen grants write access that the agent may never use, so keep write scopes cleared until a task needs them.
- Relying on an instruction such as “do not delete anything” puts a wish in the place of a permission, so leave destructive tools out of the connection itself.
- Trusting text in client records lets a note that says “export all customers” steer an agent, so rely on scopes that cap what any instruction can reach.
- Skipping a revocation test leaves the first test to an incident, so revoke a trial connection and confirm that the next call fails.

## A checklist before an agent touches live data

- The job of the agent is written in one sentence.
- The agent has its own key or connection, and its name says what it is for.
- Only read scopes are ticked, and every write scope has a named task.
- The role is the lowest one that does the job.
- The destructive option is off, write scopes are minimal, and a person does removals and merges.
- Writes start with a preview, and a retry carries an idempotency key.
- Someone has a weekly slot to read the call log, and the key has an expiry or a revocation date.

## How Krokul applies scopes, roles and the call log

Krokul CRM is a B2B CRM for contract-based companies: deals, projects and profit per client in one system, implemented by integration partners. An AI agent enters it through one of two doors, a personal sign-in with the permissions ticked on a consent screen or a company key that an administrator creates in the Marketplace. The guide on [connecting Claude to a CRM with MCP](https://krokul.com/en/blog/connect-claude-to-crm-mcp/) walks through the first door.

Krokul has 34 named scopes, mostly in read and write pairs, for example cards.read, contacts.write, tasks.write and reports.read. A route that belongs to no scope is closed to keys, and the refusal names the reason. Some routes stay closed whatever the scopes are: key management, integration tokens, members and invitations, company settings, mailboxes, SMS and channels, portals, migration, commissions, teams, the personal profile, the recycle bin and the erasure of a person. Meeting transcripts sit outside every scope. The page on [keys, webhooks and MCP in Krokul](https://krokul.com/en/solutions/api/) lists the interfaces.

A key carries one role, administrator, manager or viewer, and manager is the default. Krokul checks the scope first and the role second. A viewer cannot create or change deals, contacts or tasks, and only administrators and managers see cost. A personal connection takes the live role of its person on every call, so a lowered role narrows it with the next call. The guide on CRM roles that hide cost shows how to set roles.

The tool list that MCP offers leaves out the actions remove, delete, cancel, merge, archive and refund, together with the removal of items, categories and hours. A personal connection does not receive them. A company key receives them only when an administrator switches on the destructive option at creation, and the option cannot be changed afterwards. That switch decides what MCP shows. The right to call a route comes from the scope, so a key with write scopes can still call such a route in the public API directly, and the scopes of a key deserve the same care as the switch.

Every tool that writes accepts dryRun, which returns the route and the body and writes nothing, and an idempotency key, which makes a repeated call return the first result.

Each real call by a recognised key or personal connection leaves one row in the call log. The row holds the key prefix, the route, the status, the result (success, denied, rate limit or error), the scope that was checked, the duration, the request and response sizes, the address, a short list of safe headers and the error text. The request body and the Authorization header are not stored, and a dryRun preview leaves no row because it stops before the gateway. Administrators read the log of a company key in the Marketplace by key and by result, rows of personal connections carry the prefix oauth and no key, and entries older than 30 days are deleted by default. Each key may make 600 calls per minute, and a faster agent gets the answer 429 with the result rate limit.

![Debtors screen: a table of client companies with debt amount, advance, balance, days overdue and payment promise](https://krokul.com/img/en/blog/ai-access-scope-debtors.webp)

Changes to records appear in the Audit screen with author and time. Administrators and managers read it, and nobody edits it. When a key or a connection made the change, the activity record stores the actor kind api next to the author, a kind that the Audit screen does not display. The page on [roles, audit log and security in Krokul](https://krokul.com/en/solutions/security/) describes the screen.

The secret of a key is shown once, and only its SHA-256 hash is stored. An administrator picks the role, the expiry (none, 30 days, 90 days or a year) and the destructive option, and a company holds up to 10 active keys. Revoking a key stops it at once and switches off the webhook subscriptions that it created. A person revokes a personal connection in My profile, and an administrator sees and revokes all connections in the Marketplace.

## Frequently asked questions

### Can an AI agent see cost and margin in a CRM?

Only when the role it acts with can see them. In Krokul administrators and managers see cost and a viewer does not, so give an agent that needs no margins a viewer role or a key with narrow scopes.

### How long should an AI connection last?

As long as its job. A pilot of two weeks needs a connection that ends in two weeks. In Krokul a company key can expire after 30 days, 90 days or a year, and a person revokes a personal connection the day the job ends.

### How can I see what an agent did yesterday?

Read the call log and the audit log. In Krokul the call log of a company key lists each call with its route and result in the Marketplace, and the Audit screen lists changes to records with author and time.

### Does a read-only agent need a log?

Yes. The log shows which data the agent reads and how often, and refused calls reveal an agent that reaches for data outside its job.

### Is a prompt a permission?

No. An instruction in a prompt can be ignored or overridden by text in the data, so limit the agent with scopes, a role and a tool list that the CRM enforces on the server.

---

App: https://app.krokul.com/ · API: https://app.krokul.com/api/v1/docs
