Back to blog
Ronald Kraijesteijn, Founder
·November 19, 2026·8 min read

An AI agent wants to change a master record. Which checks must it pass?

Home/Blog/An AI agent wants to change a master record. Which checks must it pass?
One write from an agent
PUT SUP-1002 · Payment terms 30 → 90 days
WrittenSaved at once. The audit log holds the old and the new value, under the agent's own account.
HeldThe entity needs approval. The agent gets 202 and a request number, and a person decides.
RefusedThe role may not touch the column, a business rule says no, or the record changed after the agent read it. Primentra saves nothing.
StoppedThe API is switched off, the key was regenerated, or the key made more than 300 calls in a minute.

Your team built an AI agent. It reads the mails from suppliers and wants to fix the supplier list itself: a new bank account here, new payment terms there. Now the question is on your desk. May it write to master data?

It may, when every change passes the checks a change by a person passes. There are seven, and you can test each one in a demo. For each check that Primentra has today, we say how it works and link the help page.

Can an AI agent change master data safely?

Yes, when it writes through the same door as your people. Behind that door it gets its own account, the rights of one role, your business rules, approval on sensitive entities, a refusal when the record changed, a line in the audit log, and a switch that stops it. An agent that writes straight into the tables gets none of these.

The seven checks, and what each one stops

CheckWhat it stopsTest it in the demo
1. Its own accountA shared key, and changes nobody can trace to the agentAsk who made the last change, and whether it was a person or the agent
2. The rights of one roleThe agent reads salaries, or changes a column it has no business inGive the agent a read-only role, then let it try to write
3. Your business rulesA value your rules refuse from a personSend a value that breaks a rule
4. A refusal when the record changedThe agent overwrites a change a person made after the agent read the recordChange the record between the agent's read and its write
5. Approval where money isA new bank account or price that no person looked atLet the agent change a record on an entity with approval
6. A line in the audit logA change you cannot explain or undoFind the agent's change, with its old value
7. A switch that stops itAn agent in a loop that keeps writingTurn the switch off while the agent runs

1. Give the agent its own account

An agent that signs in as a person, or with a shared admin key, makes the audit log useless. You see a name, and you cannot tell whether the person or the agent made the change.

An outside program connects to Primentra through the REST API, as an API user: a service account with a key of its own. Make one API user per agent. Primentra shows the key once and stores only a hash of it, and you can give the key an expiry date.

2. Give it the rights of one role, and no more

Start with read access. Add write access per entity once the agent has shown it gets the reads right.

An API user in Primentra takes part in the same roles and permissions as a person. Primentra leaves a column its roles set to None out of every record it reads. A write that names that column gets 403, and Primentra saves nothing.

3. Run the same business rules

The rules that stop a person from saving a bad value must stop the agent too. A rule that runs only in the screen is a rule the agent never meets.

Primentra runs its business rules on all five ways data gets in: typing in the grid, pasting, the REST API, file import and staging. None of the five skips them.

4. Refuse a write when the record changed

An agent reads a record, works for a few seconds, and writes. In those seconds a person can change the same record. Without a check, the agent's write wins, and the person's change is gone without a word.

The Primentra REST API gives each record a version. The agent sends that version back in the If-Match header. When the record changed in between, Primentra answers 412 and writes nothing. The header is optional, so tell whoever builds the agent to send it.

5. Put approval where the money is

Bank accounts, prices and payment terms are where a wrong value costs money. On those entities, a person approves each change before it counts.

In Primentra a create, an update or a delete through the REST API on an entity with approval goes to the approval queue. The agent gets 202 and a request number, and nothing changes until an approver decides. A submitter cannot approve their own request unless the entity allows it. Our post on approval across every route covers the five ways in.

6. Write a line for every change

After the fact, you must be able to say what changed, what it was before, and who changed it.

The Primentra audit log writes an entry for each save, in the same transaction as the change. Each entry shows the account and the old and new value of each changed field. Filter the log on the agent's API user to see everything it did, and export that as CSV, JSON or XLSX. Entries stay 90 days unless you set another period.

7. Keep a switch that stops it at once

Agents fail in loops. A prompt goes wrong, and the agent makes the same change on every record it finds. You want to stop it in seconds, without a release.

Primentra has three stops. The API switch in General Settings makes every call with an API key answer 503 at once. A new key for the agent makes its next call answer 401. And each key may make 300 calls a minute; past that, a call answers 429.

What should an agent not do alone?

Merge, load files, delete and approve. A mistake in any of them is large, or hard to take back.

ActionWhy a person does itWhat the agent gets
Merge duplicatesA merge removes a record. Everything that pointed at it moves to the record you keep.No Merge right. In Primentra a merge needs the Merge, Update and Delete rights.
Load a fileOne file can hold 50,000 rows. Nobody reviews that row by row.One record per call. Primentra refuses a file import on an entity with approval.
DeletePrimentra deletes for real. The record leaves the entity.No Delete right. The audit log keeps a full copy of each deleted record.
ApproveThe agent would check its own work.No Approver flag on its role.

A merge is the one to watch. Our post on merging duplicates shows what happens to the record that loses.

Which doors skip the checks?

Any door below the application. An agent with a database login writes straight into the tables, and no role, rule, approval or audit line sees it. So give the agent an API key, and never a SQL login.

Primentra has one such door by design: staging. A staged batch skips approval, because a nightly feed has nobody to press Approve. Business rules still run, and Batch History and the audit log keep the record. Writing to staging needs a SQL login from your database administrator, so keep the agent out of it. The If-Match check of step 4 also does not cover staging, file imports or the bulk API.

What about AI that only gives advice?

Advice is safer, because a person makes the change. The data can still leave your network, so ask which fields go and to whom.

In Primentra, AI assist in Lookalikes is off by default. It gives a second opinion on a group of possible duplicates and drafts a matching rule. It never merges, never dismisses a pair and never picks a value. It sends only the compared columns, and never a column the user may not see. The AI call log keeps the time, user, model, tokens and outcome of every call, and no record values.

Before the agent goes live

  1. Make an API user for the agent, with a read-only role.
  2. Run the seven tests from the table on a test database.
  3. Add write rights one entity at a time.
  4. Put approval on the entities with bank details, prices and payment terms.
  5. Agree who turns the API switch off, and try it once.

You can run the same tests on Primentra. The trial runs for 60 days on your own SQL Server.

Common questions

Can an AI agent change master data safely?

Yes, when each change passes the checks a change by a person passes: its own account, the rights of one role, the business rules, approval on sensitive entities, a refusal when the record changed, an audit line and a switch that stops it. In Primentra an agent connects as an API user, and these checks apply to it.

Can an AI agent approve its own change?

It must not. In Primentra a submitter cannot approve their own request unless the entity allows self-approval. Do not give the agent's role the Approver flag.

How do we see what an AI agent changed?

Give the agent its own API user. The Primentra audit log shows the account behind each change, with the old and the new value of each field. Filter the log on that account and export it.

How do we stop an AI agent at once?

Turn the API off in General Settings. Every call with an API key then answers 503. To stop one agent only, regenerate its key, and its next call answers 401.

More from the blog

We switched a leaver off. Forgot password switched them back on.5 min readApprove on Thursday, write Monday: what a stale approval request does to live data8 min readAudit trail retention: the audit log that deleted the answer on day 918 min read

Ready to migrate from Microsoft MDS?

Download Primentra and run it on your own server, or try the live demo first. All features included.

Download free trialTry demoCompare MDM tools