Skip to content

Your AI Tools Hold the Keys: Give Each Agent Only the Access It Needs

AI agents get wired into email, files, and payments. One over-powered key let attackers into an AI project's code. A plain guide to least access.

4 min read
Your AI Tools Hold the Keys: Give Each Agent Only the Access It Needs

When you connect an AI tool to your business systems, you hand it a key. It might be a login, an access token, or a connection you approve with a click. That key lets the AI read your email, open your files, update your customer list, or take payments on your behalf.

The more systems an AI tool can reach, the more valuable its keys become to an attacker. A recent incident at a software project shows what happens when one of those keys can open far more than it needs to.

What happened

According to The Hacker News, LiteLLM, an open-source software project for working with AI models, said in late October 2026 that a master key to its AI agent platform had been accidentally published to a public code repository in May. The team spotted the mistake and identified the exposed keys as needing to be revoked, but the master key wasn't revoked.

In October, an attacker used that key to get into the agent platform. There, they found a GitHub token the platform used so its AI agents could suggest code changes. LiteLLM said the token was "not scoped down" and was tied to its GitHub organization owner's account. That gave the attacker owner-level access to the organization's code repositories across the board. The attacker went on to take more credentials and publish a malicious version of LiteLLM's software, which was then pulled.

The AI agents only needed to suggest code changes. Their key could do almost anything.

The principle: least access

A single teal tap pouring one narrow stream into one small white basin, ConsultNation
Only the access the job needs

Security people call the fix "least privilege," or least access: give each tool only the access it needs for its job, and nothing more. It's an old idea. AI agents make it more urgent, because they're often connected to many systems at once and act without a person watching each step.

Here's what least access looks like in owner terms.

1. Read-only where possible

A pale limited tap with a thin stream beside a fuller teal tap, ConsultNation
Read-only where a thinner flow will do

If an AI tool only needs to read something, don't let it write or delete. An assistant that summarizes your inbox needs to read email, not send it. A reporting tool that pulls sales figures needs to view your accounting data, not change it.

When you connect a tool, look at the permissions it asks for. If it asks for more than the job needs, choose a narrower option if there is one, or ask why.

2. One key per job

Three separate taps on one supply pipe, each with its own basin, ConsultNation
A separate pass for each job

Don't reuse a single powerful login or token across several tools. Give each AI tool its own key, limited to its own job. If one key leaks, the damage stays limited to that one job, and you can revoke it without breaking the other tools.

In particular, avoid connecting AI tools through the owner's or an administrator's account. In the LiteLLM case, the token was tied to the organization owner's account, which is part of why it opened so much.

3. Expiry dates

A teal tap on a navy pipe marked with a row of countdown dots, some already empty, ConsultNation
Set an expiry, and renew on purpose

Where a service allows it, set keys to expire. A key with an expiry date limits how long a leaked one is useful. When it expires, renew it on purpose, and check that the tool still needs it.

4. A list of what's connected

Three tagged branch pipes hanging from a navy header, each tag blank, ConsultNation
A simple list of what is connected

Keep a simple list of each AI tool connected to your systems:

  • what it connects to

  • what it's allowed to do (read, write, send, pay)

  • whose account the key is tied to

  • when the key expires, if it does

  • who's responsible for it

Review the list a few times a year. Remove tools nobody uses anymore, and revoke their keys.

5. Revoke fast, and confirm it happened

A shut teal tap above a completely dry white basin, ConsultNation
Revoke it, then check that it stopped

The LiteLLM team caught the leaked key quickly. The problem was that the master key itself wasn't revoked. If a key is exposed, revoke it right away, then check that it actually stopped working. Don't assume.

Payments deserve extra care

An amber double-valve tap pouring a slim controlled stream into a small basin, ConsultNation
Payments sit behind a second turn

If an AI tool can move money, take refunds, or change prices, limit it tightly. Set spending limits where the service allows it, require a person's approval for anything beyond routine, and watch the activity log.

The takeaway

AI agents are only as safe as the keys they hold. Give each one read-only access where possible, its own key, an expiry date, and a place on your list of connected tools. Revoke quickly when something leaks. Protecting client data, including in the AI tools a business uses, is one of the principles ConsultNation works by.

Share

Get new articles by e-mail

A short e-mail when we publish something new. No spam; leave any time.

Have a project like this in mind?

Talk to our team — the first consultation is free.

Contact us