AI · Automation · Engineering

AI Agent Access: Scope It, Broker It, Revoke It

By Lazar MilicevicNovember 7, 202610 min read
Server racks and network cables representing the infrastructure behind scoped AI agent access

The dangerous shortcut in an agent build is giving a worker the same integration credential as the application around it. It makes the first tool call easy. It also means a publishing agent, a research agent, and a maintenance job can become indistinguishable to the system they access, even when they should have different permissions.

I build unattended automation, including content pipelines that research, generate, and publish across multiple sites. In that kind of system, a prompt telling an agent to “only publish to this site” is not an access control. The boundary has to exist where the action executes.

What the agent security numbers actually say

The agent security gap is measurable, but the headline needs careful reading: a VentureBeat survey published in July 2026 found that 54% of its June respondents reported either a confirmed agent security incident or a near-miss. That is 18% reporting a confirmed incident and 36% reporting a near-miss, not 54% reporting confirmed incidents.

The survey covered 107 qualified respondents at organizations with more than 100 employees. In that group, 32% said every agent had its own scoped, managed identity. VentureBeat counted credential sharing somewhere in the agent fleet at 74 organizations, or 69%. That does not mean 69% of individual agents shared credentials. Respondents could also select overlapping identity patterns. Only 30% said they isolated high-risk agents in sandboxes.

These are useful warning signs, not a universal enterprise baseline. VentureBeat describes the June sample as self-selected and mid-market-skewed, and calls the results directional. Its subsequent survey waves produced different results with different respondent groups and questions. The October report, for example, reported 46% for an agent-caused incident or near-miss in the preceding 12 months. I would not present June’s 54% as the current rate, or infer from the survey that shared credentials caused the reported incidents.

What matters to my architecture decisions is narrower: organizations are putting agents in contact with real systems while agent-specific identity, permission, and isolation controls remain uneven. Those controls solve different problems. An agent identity tells me which worker acted. A scoped permission limits what it can do. Isolation limits what it can reach or affect if it misbehaves. None substitutes for the others.

Give the worker an identity, not the model a key

A scoped agent identity should name the workload that is allowed to request an action; it should not put a credential into the model’s context. I would separate the model’s proposed tool call from trusted application code that authenticates, authorizes, and executes it. The model should be able to propose publishing a draft, while a trusted component chooses the credential used to do so.

This distinction gets lost when a team says, “We gave the agent its own API key.” A dedicated key may improve attribution, but it is not least privilege if that key can read every customer record, publish to every site, and change integration settings. I define the permission boundary from the job outward:

Workload Necessary action Boundary I would enforce
Research worker Retrieve approved source material Read access to approved sources; no publishing permission
Drafting worker Produce draft content Access to the required context; no production write credential
Publishing worker Publish an approved item Write access to the intended site and content type
Performance worker Read search and content results Read-only access; no authority to alter published content

This is an architecture example, not a claim that every content system exposes permissions at exactly those levels. If a downstream API only offers a broad account credential, I cannot make that credential narrower by naming the agent. I have to put a narrower service in front of it, change the integration, or accept and document the remaining risk.

In BizFlowAI ContentStudio, research, writing, optimization, and publishing are separate kinds of work. That separation is useful for more than orchestration. It gives me a place to ask whether the component that reads performance data has any reason to hold publishing authority, or whether the component generating text should ever see a production secret. The answer to the latter is no.

This is also how I read Microsoft’s Agent ID documentation. It describes an agent identity as a special service principal that does not hold credentials itself; an agent identity blueprint can acquire tokens on its behalf. The implementation is platform-specific, but the principle travels: identify the agent, then have a trusted component acquire and use credentials on its behalf.

Put authorization at the tool boundary

The reliable place to enforce least privilege is the tool executor, immediately before it calls the downstream system. A prompt, a planner decision, or an earlier approval can supply context, but none should be the final authority for a side effect. The executor should check who requested the action, what resource it targets, and whether that action is permitted now.

For an agentic workflow, I would pass an action request as data rather than handing the model a general-purpose client:

model proposes:
  action: publish_content
  target_site: requested site
  content_id: draft reference

tool executor checks:
  agent identity matches the publishing workload
  target site is in the allowed scope
  draft is eligible for publishing
  requested action is permitted for this run

only then:
  acquire credential outside model context
  call publishing integration
  record the decision and result

The checks must use trusted values. If target_site comes from retrieved text, an email, or the model’s output, the executor must not treat it as proof of authorization. The allowed site comes from deployment configuration or another trusted source of policy. The model’s value is a request to compare against that policy.

I recommend avoiding broad tool interfaces such as “make an HTTP request” when the job only needs “publish this approved draft.” A narrow tool makes the permission review legible. It limits accidental capability growth when prompts change, and it gives me a sensible place to validate content state before an irreversible action.

OWASP’s prompt-injection guidance recommends keeping API-token handling in application code rather than providing tokens to the model, and restricting access to the minimum required. That advice matters because an agent routinely reads material it did not author: search results, documents, tickets, or web pages. Any of those can contain instructions aimed at the agent. I assume untrusted text will eventually tell a worker to change its plan. The tool boundary must remain valid when that happens.

There is an operational trade-off here. A tool executor adds code and policy maintenance. It can also expose an uncomfortable limitation in a vendor integration: the available credential may be broader than the business action. I would rather discover that during design than hide it behind a carefully worded system prompt.

Separate containment from permission

Least privilege limits authorized actions; containment limits the damage from everything else the worker might do. For high-risk agents, I would combine permission limits with isolation because checks on a publishing tool do not, by themselves, restrict network access, file access, arbitrary code execution, or a compromised dependency.

The first containment decision is whether the agent needs an open-ended environment at all. A worker that classifies a document and returns structured data may only need a constrained tool interface. A worker that executes generated code or processes unfamiliar files has a different risk profile. I would isolate that execution environment, restrict what it can reach, and keep production credentials outside it. Isolation is not a reason to give the sandbox a powerful secret.

For privileged or difficult-to-reverse actions, I would add an approval boundary. OWASP also recommends human approval for high-risk or privileged agent actions. That does not mean placing a person in every unattended workflow. It means defining which actions cannot safely proceed on model judgment alone. Publishing routine approved content and changing an integration’s access policy should not take the same path.

A useful test is to imagine the agent accepting a malicious instruction embedded in a document it retrieves. Then I trace every way the agent could act on that instruction:

  • Can it call a tool outside its assigned job?
  • Can it choose another customer, site, or workspace as the target?
  • Can it reach a general-purpose network endpoint instead of the approved integration?
  • Can it write to a durable store that a more privileged worker will later trust?
  • Can it request a privileged action without an independent approval?

That last question is particularly important in multi-agent pipelines. Splitting work among agents does not create a security boundary if a low-trust research worker can write an instruction that a privileged publishing worker treats as an order. I would pass artifacts between workers as data, retain their provenance, and require the publisher to apply its own checks. The next agent should not inherit the previous agent’s authority merely because they share a workflow.

Design revocation before you need it

A separate identity earns its keep when I can disable one worker without shutting down every integration that shares its credential. Revocation is therefore a design test, not an incident-response task to postpone. I want to know which identity to disable, which sessions or tokens remain usable, and which queued actions might still execute.

The September VentureBeat survey offers a useful association, not proof of causation: among respondents reporting shared agent credentials, 30% said shutting an agent off would be slow or uncertain. Among respondents reporting a separate identity for each agent, 9% said so. The practical question for my system is whether its own shutdown path works under load and during failure.

For a scheduled or event-driven worker, I would verify revocation through the whole execution path:

  1. Disable new work. Stop the schedule or event consumer and reject new runs for that agent identity.
  2. Block execution at the tool boundary. A queued task must not be able to perform a write just because it was queued before the identity was disabled.
  3. Revoke or rotate downstream access. If multiple workers use one vendor credential, disabling the worker in my system does not invalidate that credential. That limitation needs an explicit response plan.
  4. Inspect in-flight work. Determine which actions completed, which failed, and which may have reached the downstream system without a recorded result.
  5. Reconcile state. Check the destination, not only the agent log. A timeout is not evidence that a publish or update did not happen.

This is where attribution becomes operational. I would log the agent identity, workflow run, requested action, target resource, authorization decision, and downstream result together. The logging policy should exclude raw credentials and sensitive source content rather than retaining them merely to make a trace convenient. The record should let me answer “what did this worker attempt?” without creating another place where secrets accumulate.

I would test the shutdown path with a queued write, not just an idle agent. If disabling the worker stops its next planning step but a previously scheduled tool call still publishes, the kill switch is incomplete. If the only way to stop it is to rotate a shared credential and break unrelated workers, the identity design is incomplete.

What I’d do first

I would start with the agent that can make the most consequential change, not the agent with the most elaborate prompt. Map its downstream credentials, list the resources those credentials can reach, and compare that list with the job it actually performs. The gap is the work.

Then I would move its side-effecting actions behind a narrow executor, give the workload an identifiable identity, and enforce resource scope at execution time. I would keep secrets out of model context, add approval where an action warrants it, and test both a malicious instruction in retrieved material and a shutdown while a write is queued.

That is the standard I use when thinking through autonomous systems: not whether the agent usually follows instructions, but whether the system remains bounded when it does not. If you are working through that boundary in an AI project, you can reach me at lamingsrb@gmail.com.

Frequently asked questions

Why shouldn't AI agents share an application's integration credentials?

I avoid shared credentials because they let workers with different jobs appear identical to the system they access. A research worker and a publishing worker should not have the same authority. I give each workload an identifiable, scoped way to request only the actions it needs.

Is giving an AI agent its own API key enough to enforce least privilege?

I treat a dedicated key as a possible improvement in attribution, not proof of least privilege. If that key can access every customer record or publish to every site, its permissions are still too broad. I define the allowed actions and resources around the worker's actual job.

Where should an AI agent's permissions be checked?

I enforce permissions in trusted tool-execution code immediately before it calls the downstream system. The executor checks which workload requested the action, which resource it targets, and whether the action is permitted at that point. A prompt telling the model to stay within scope is not an access control.

Should an AI model have access to production API credentials?

I keep production credentials out of the model's context. The model can propose an action, such as publishing a draft, while trusted application code authenticates, authorizes, and executes the request. This separates the model's proposed tool call from the authority to perform it.

What if a downstream API only provides a broad account credential?

I cannot narrow a broad credential simply by assigning it to a named agent. I would put a more restrictive service in front of the API, change the integration, or document and accept the remaining risk. The boundary must constrain what actually executes, not just what the agent is instructed to do.

Lazar Milicevic

Lazar Milićević

Senior Technical Engineer. I build AI automation, GenAI/LLM systems and cloud architecture — autonomous systems that run while you sleep. Founder of BizFlowAI.

Building something hard with AI or automation? I am open to talk.

Get in touch

← All posts