58 min read

How to Enforce Least-Privilege Agent Access for Enterprise Data Agents

Enforce least-privilege agent access: per-query authorization, short-lived scoped credentials, read/write and tenant separation, tested revocation.

How to Enforce Least-Privilege Agent Access for Enterprise Data Agents

An agent that holds one long-lived, over-broad credential is the hardest access problem in an enterprise data estate. Nobody can bound what it reaches, and nobody can revoke it quickly. Least-privilege agent access is the discipline of making every query carry its own authorization decision and its own short-lived proof.

Most organisations have not got there yet. Gravitee's State of AI Agent Security 2026 survey, a vendor survey of 750 senior technology leaders fielded in April 2026, found 48% of production agents running unsecured, derived from a mean monitoring coverage of 52%. The same survey found 54% of organisations had experienced or suspected an agent-related security or data-privacy incident in the past 12 months, with 34.9% confirming one. Both figures are self-reported, and "suspected" is not verified incidence. A single credential leak can carry the same weight: in October 2026, as reported by The Rundown, the coding tool OpenCode said hackers may have grabbed OpenAI and Anthropic account keys some users had saved, third-party reporting that is not independently confirmed.

What follows is a control path you can test. It covers per-query authorization, short-lived scoped credentials, read/write and tenant separation, revocation as a rehearsed path, and an audit record that survives scrutiny. Every control claim is sourced to OWASP, NIST, IETF RFCs or first-party cloud documentation, so you can check each one against the authority behind it.

Why the credential, not the prompt, is the real control point for least-privilege agent access

A prompt instruction is not a control because it lives inside the component it is meant to constrain. OWASP's AI agent security cheat sheet puts authorization in the execution component outside the agent's context, and states that a user_confirmed flag is insufficient: the component must verify the approval belongs to the current actor and the exact tool call, remains valid, and has not already been consumed. The same sheet requires per-tool permission scoping (read-only versus write, specific resources), fail-closed behaviour for unknown tools, and no wildcard permissions.

Hardcoded secrets in public GitHub commits New hardcoded secrets in public GitHub commits rose from 11 million to 28.65 million over five years. Hardcoded secrets in public GitHub commits. horizontal bar data: 2021 baseline 11; 2025 28.65.Source: GitGuardian State of Secrets Sprawl 2026 2026. Hardcoded secrets in public GitHub commits 2021 baseline 11 2025 28.65 Source: GitGuardian State of Secrets Sprawl 2026 (2026)

That maps onto NIST's zero trust architecture guidance, which splits the decision point into a Policy Engine that makes and logs the grant or deny, and a Policy Administrator that generates any session-specific token or credential. The Policy Enforcement Point sits at or immediately in front of the resource, not at a network perimeter, so an agent reaching a warehouse through a gateway is still unauthorized if the warehouse itself does not check.

A token proves who is asking; only a policy decision proves whether this query, on this resource, for this tenant, right now, should run.

Microsoft's least-privilege guidance for AI agents names the failure mode precisely: slow revocation and incomplete containment, which appear when disabling an agent is complex, tokens persist, keys are shared, or downstream systems do not re-check authorization.

What per-query authorization must evaluate before an agent runs a query

Per-query authorization evaluates five things before execution: the subject, the tenant, the action, the resource, and the request context. Each has a standards home, and the tuple is only as strong as its weakest field.

Tuple element

Field that carries it

Control that consumes it

Subject (agent instance plus acting user)

sub plus the act claim for delegation

OWASP execution-layer authorization

Tenant

authorization_details locations or identifier

OWASP data protection and privacy section

Action

actions (read, write, delete)

OWASP per-tool read-only versus write scoping

Resource

locations and datatypes

OWASP minimum-tool grant

Context (time, session age, approval state)

privileges and token lifetime

OWASP human-in-the-loop controls

Rich authorization requests supply the structure: authorization_details is a JSON array whose required type field determines the allowable contents, with optional locations, actions, datatypes, identifier and privileges, and the server must refuse unknown types with invalid_authorization_details. The RFC defines the container and the refusal rule, not what each field means for your API. Scope alone is a ceiling rather than a decision: the OAuth 2.0 framework lets the authorization server ignore the requested scope and requires it to return the granted scope when the two differ. OAuth 2.0 token exchange narrows further for the downstream service and records delegation in the act claim, but consumers must consider only the token's top-level claims and the current actor, treating prior actors as informational. No source documents a measured latency cost for per-query authorization, so test it against your own query mix before committing.

How to mint short-lived, narrowly scoped credentials and bound them

Short-lived credentials for AI agents are bounded by platform ceilings you configure, not defaults you inherit. The published ranges differ by an order of magnitude, so the choice has to be documented rather than assumed.

Credential or timeout

Ceiling (seconds)

Source

AWS STS session, default

3,600

AWS STS session policies

AWS STS session, maximum

role setting (up to 43,200)

same

Google Cloud access token, default

3,600

Google Cloud short-lived credentials

Google Cloud access token, extended cap

43,200

same

NIST AAL2 session overall timeout

86,400

NIST's authentication and lifecycle guidance

NIST AAL2 inactivity timeout

3,600

same

Credential and session lifetime ceilings Credential and session lifetime ceilings, as plotted from the cited source. Credential and session lifetime ceilings. grouped bar data: Default session: AWS STS 3600, Google Cloud 0, NIST AAL2 0; Maximum session: AWS STS 43200, Google Cloud 0, NIST AAL2 0; Access token default: AWS STS 0, Google Cloud 3600, NIST AAL2 0; Extended cap: AWS STS 0, Google Cloud 43200, NIST AAL2 0; Overall timeout: AWS STS 0, Google Cloud 0, NIST AAL2 86400; Inactivity timeout: AWS STS 0, Google Cloud 0, NIST AAL2 3600.Source: AWS CLI sts assume-role reference 2026. Credential and session lifetime ceilings 0 25000 50000 75000 100000 AWS STS Google Cloud NIST AAL2 3600 0 0 Defaultsession 43200 0 0 Maximumsession 0 3600 0 Access tokendefault 0 43200 0 Extended cap 0 0 86400 Overalltimeout 0 0 3600 Inactivitytimeout Source: AWS CLI sts assume-role reference (2026)

AWS STS sessions run from 900 seconds up to the role's maximum session duration, default 3,600, and a session policy restricts the session to the intersection of the role's identity-based policy and the session policy, never granting more than the role holds. Google Cloud caps impersonated service-account access tokens at 3,600 seconds, raisable to 43,200 only by adding the service account to an organisation policy carrying the constraints/iam.allowServiceAccountCredentialLifetimeExtension constraint; OIDC ID tokens last one hour, and a self-signed JWT exp must be no more than 12 hours ahead. The NIST values are session timeouts, not token lifetimes, and SP 800-63B-4 sets them at SHOULD level while requiring the organisation to establish and document the limits it enforces. Microsoft's Entra Agent ID best practices add the identity layer: one unique identity per agent instance, never shared, client credentials for autonomous agents and on-behalf-of for interactive ones, and managed identities or certificates rather than secrets in production.

No source recommends a single correct lifetime. The honest position is that these are ceilings and floors to choose within, and the choice belongs in a control framework for enterprise agent deployment that records the number and the reason for it.

How to enforce read/write separation and tenant boundaries as separate identities and policy paths

Read/write separation for data agents and tenant boundaries for enterprise data agents are two different control paths, and they should not share an identity. OWASP's per-tool scoping already requires read-only versus write separation at the tool layer; the data platform layer needs its own enforcement, because a row policy filters what is visible, not what is writable.

Snowflake row access policies are schema-level objects that return only rows where the policy evaluates to TRUE, generate a secure inline view, and evaluate the expression using the role of the policy owner rather than the querying role, which supports segregation of duties between governance and data owners. A policy condition can join a mapping table to resolve the caller's tenant at query runtime. Unity Catalog row filters are SQL user-defined functions evaluated per row, bound with ALTER TABLE ... SET ROW FILTER, and the engine always makes the secure choice over optimization when the two conflict, which can affect performance; only one distinct row filter resolves at runtime per user and table. Both vendors converge on centralised policy authorship, and Databricks is the more prescriptive of the two, recommending catalog-level ABAC policies over per-table filters because higher-level admins define them and table owners cannot override or remove them. Neither page claims automatic tenant isolation.

Row policies isolate tenants only if the expression is correct and the engine is not bypassed.

Snowflake's own documentation notes that row access policies do not prevent rows from being inserted or visible rows from being updated or deleted, so write authority must be a separate grant. Teams evaluating architecture and governance for enterprise data agents can treat that split as the baseline requirement rather than an optional refinement.

How to make revocation a tested path rather than a feature

Revocation is a tested path when you can measure how long it takes and prove the token stops working. OAuth 2.0 token revocation requires support for refresh-token revocation, recommends access-token revocation, states that invalidation takes place immediately, and returns HTTP 200 whether the token was revoked or was already invalid. The same RFC qualifies that in practice there can be a propagation delay, that self-contained access tokens may need non-standardised backend interaction for immediate revocation, and that the endpoint is token-granular only: "revoke this user", "revoke this agent" and "revoke this tenant" are application-level policies you build.

Microsoft's guidance turns that into a test list: disabling the agent, rotating credentials, invalidating tokens, and removing stale permissions, with privileges made time-limited through just-in-time entitlements, short-lived tokens or approvals. It also proposes two metrics worth adopting as acceptance criteria: mean time to revoke or disable an agent identity including token invalidation, and the percentage of production agents with a unique identity and a named accountable owner. Because short lifetimes, not revocation calls, are the reliable bound on stale access, treat the token lifetime as the outer limit and the revocation test as proof that the inner path works.

What an agent audit trail must record, and what it should minimise

An agent audit trail must establish six things per event and must not store the credentials it is auditing. NIST SP 800-53 AU-3 requires audit records to establish what type of event occurred, when, where, the source, the outcome, and the identity of any individuals, subjects or objects associated with it.

AU-3 element

Agent-specific field

What

tool call name and policy decision (grant or deny)

When

timestamp in UTC

Where

resource identifier and tenant

Source

agent instance identity plus acting user from the act claim

Outcome

executed, refused, or failed

Identity

accountable owner and delegated subject

OWASP's monitoring and observability section adds logging of all agent decisions, tool calls and outcomes, anomaly detection, per-session token and cost tracking, and a redaction key list covering password, api_key, token, secret and credential. NIST's log management guide records the compliance gap: the original syslog standard offers no features for preserving the confidentiality, integrity and availability of logs, while AU-9 requires protecting audit information from unauthorised access, modification and deletion and alerting on such attempts. A plain-syslog pipeline is therefore a control gap, not a preference.

Leaked credentials remain the reason this matters. GitGuardian's State of Secrets Sprawl 2026, vendor scan data covering calendar 2025, found 1,275,105 leaked secrets for AI services, an 81% increase over 2024, against 28.65 million new hardcoded secrets in public GitHub commits. More than 64% of secrets confirmed valid in the 2022 dataset were still valid and exploitable when retested in January 2026.

Frequently Asked Questions

What is least-privilege agent access?

Least-privilege agent access means every agent query is authorized against a policy decision at execution time and carries only the permissions that query needs. It combines per-tool scoping, a per-query policy decision, and a short-lived credential, so no single artifact grants standing access to a data estate.

Do short-lived tokens fix an over-broad agent role?

No. A short-lived token bounds how long a permission lasts, not how wide it is. AWS session policies restrict a session to the intersection of the role's identity-based policy and the session policy and cannot grant more than the role holds (AWS STS session policies), so an over-broad role stays over-broad for the life of every token minted from it.

Is a sandbox enough to contain an agent?

A sandbox limits where an agent can reach, but it is not the authorization decision. NIST places the enforcement point at or in front of the resource and requires the resource to be reached through it (NIST SP 800-207), so a sandbox that fronts an unguarded warehouse leaves the warehouse unguarded.

How long should an agent credential live?

No source recommends a single number. NIST SP 800-63B-4 requires the organisation to document the inactivity and overall session time limits it enforces (NIST's authentication guidance).

Do row access policies give us tenant isolation?

They give you row filtering, which is one part of isolation. Snowflake evaluates the policy with the policy owner's role and does not prevent inserts or updates to visible rows (Snowflake row access policies), so tenant isolation also needs separate write grants and an enforcement point the engine cannot bypass.

How do we prove revocation works?

Test it as a path, not a setting. Microsoft recommends exercising agent disablement, credential rotation, token invalidation and stale-permission removal, then measuring mean time to revoke including token invalidation (Microsoft's least-privilege guidance for AI agents). RFC 7009 returns HTTP 200 for an already-invalid token, so confirm the token fails at the resource, not just at the revocation endpoint.

Conclusion

The control path holds together only when all five layers are present: a policy decision outside the agent's context, a credential bounded by a documented lifetime, separate identities for reads and writes, tenant filtering enforced at the engine, and a revocation path you have timed. The evidence stops short of a recommended lifetime or a measured per-query cost, so your acceptance criteria have to come from your own environment: mean time to revoke, share of production agents with a unique identity and named owner, and a revocation test that proves the token fails at the resource. Start by inventorying every agent credential that outlives a working day, then evaluate a governed data-agent architecture against those criteria before you widen any agent's access.

About the publisher. Singdata is a Singapore-headquartered company that develops data agents on top of its AI-native lakehouse, and it sells that platform to enterprises. It therefore has a commercial interest in how enterprises run and govern data agents, so weigh its perspective with that in mind. The guidance above does not depend on Singdata's products.

Related Articles