Identi PatternsAn initiative of The Identi Exchange

TIE-AGT-026DocumentedAgent identityRuntime authorisation

Context-aware access for agents: runtime, network and risk

Grant agents access only from the runtimes and networks they are supposed to run in, and only while their risk is acceptable, by checking those signals when tokens are issued, when requests arrive and, where possible, continuously.

  • EffortMedium
  • Version1.0
  • Reviewed
  • Updated
  • AuthorsTrevonix Innovation

In short#

  • Each agent has an expected context: the runtime it runs in, the networks it calls from, the device for computer-using agents, and an acceptable risk level.
  • Check context at three points: when the token is issued, when the request reaches the gateway, and in per-action decisions.
  • Rising risk blocks first and asks questions second; signals are shared so a block in one place takes effect everywhere.

Problem#

An agent's credential, or a token it holds, is only as safe as the place it is used from. Prompt injection, compromised dependencies and leaked configuration can all move an agent's authority somewhere else: a token copied into an attacker's script, an API key pasted into a personal tool, a computer-using agent running on an unmanaged machine. Without context checks, every system sees a valid credential and serves the request.

Human access learned this lesson long ago with conditional access on location, device and risk. Agents need the same, adapted: they have no device in the human sense, they cannot do MFA, and they run in clouds, pipelines and virtual desktops.

When to use it#

Use it when

  • Agents run in known runtimes: a cloud service, a cluster, a pipeline, a managed virtual desktop.
  • Agent credentials or tokens could be exfiltrated by prompt injection or supply-chain compromise.
  • You have identity risk signals for agents, or a gateway in front of agent traffic.

Avoid it, or add more, when

  • Agents that legitimately run anywhere, such as personal assistants on employees' own devices, need device-based controls on the person's session instead; network rules will only produce false blocks.

Forces#

  • Strictness against agility. Tight network rules break when platforms change egress addresses.
  • Coverage against capability. Identity providers offer few conditions for agents; much of the context must be checked at gateways.
  • Speed of response against false positives. Automatic blocks on risk stop attacks and occasionally stop healthy agents.

Solution#

Record each agent's expected context in the inventory: runtime and workload identity, egress networks, device (for computer-using agents) and risk tolerance from its tier. At token issuance, require workload-federated authentication (so tokens can only be minted from the real runtime) and apply the identity provider's agent policies, such as blocking risky agents or allowing only approved agents. At the gateway, check source network, mutual TLS or sender-constrained tokens, and that the agent is not on a deny list. In the decision point, use context attributes (runtime, network zone, risk, time) in per-action rules. Feed risk events between these points so a block in one place applies everywhere.

Diagram. On the left, an agent running in its expected runtime (a cloud service with a workload identity, egress from known addresses) and, below it, the same credential used from an attacker's machine. Three checkpoints: 1 token issuance at the identity provider: workload-federated authentication o
Expected context is checked at token issuance, at the gateway and in each decision; risk signals connect them.

Signals and checkpoints

SignalWhere it is checkedExample rule
Workload identityToken issuanceTokens only for authentication federated from the agent's runtime
Approved agentToken issuanceOnly agents with an approved attribute may access finance APIs
Agent riskToken issuance and PDPBlock when risk is high; require approval when medium
Source networkGatewayCalls only from the runtime's egress ranges or private endpoint
Proof of possessionGatewayToken must be DPoP-bound or mTLS-bound to the agent's key
Device and network (computer-using agents)Token issuanceAgent user sessions only from compliant managed desktops on a compliant network
Time and volumePDP and gatewayRate limits; no consequential actions outside business hours for tier 4

How it works

  1. Describe the expected context for each agent in the inventory, by tier.
  2. Make tokens hard to mint elsewhere: federate agent authentication to the runtime (TIE-AGT-014); remove secrets.
  3. Apply identity provider policies for agents: approved agents only for sensitive resources, block on high risk.
  4. Check at the gateway: network origin, sender constraint, deny list, rate limits.
  5. Use context in decisions: pass runtime, network zone and risk to the PDP for per-action rules.
  6. Connect the signals: route risk events to the identity provider, gateway and PDP; prefer standards such as the Shared Signals Framework where products support them.
  7. Start in report-only mode, tune, then enforce.

Design rules#

  1. Every agent has an expected context.
  2. Tokens should be impossible to mint outside the runtime.
  3. Check context at issuance, at the gateway and per action.
  4. Risk blocks first. Investigate after containment.
  5. Signals flow both ways between identity, gateway and PDP.
  6. Report-only before enforce.
  7. Review rules when platforms change egress or hosting.

Anti-patterns#

Anti-patternWhat goes wrong
Static API key usable from anywhereA leaked key works from any machine
Network rules only at the identity providerTokens issued in context are replayed from outside it
Conditional access that targets all agents with no exceptionsCloud agents with no device are blocked with no path to comply
Risk detected, nothing connectedThe identity provider flags the agent while the gateway keeps serving it
Blanket blocks on medium riskHealthy agents fail; teams switch the control off

Trade-offs#

Benefits

  • Stolen agent credentials and tokens are much less useful.
  • Faster containment when an agent becomes risky.
  • Consistent context rules for agents across identity provider, gateway and decisions.

Costs and risks

  • Up-to-date records of runtimes and egress ranges.
  • Licensing for agent risk and network controls in some products.
  • Gateway configuration for network and sender-constraint checks.
  • Tuning to avoid false blocks.

Recipes#

How to build this pattern on specific products. Each recipe shows its own maturity and when it was last verified.

Ping Identity recipe

Ping Identity

PingOne Protect, Ping authorisation and PingGateway

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Agent detection risk, context-aware per-action decisions and gateway network checks. Written from Ping documentation.

Configure

  1. Use PingOne Protect agent detection to identify AI agents acting in user sessions and add the risk result to authentication journeys.
  2. Pass network zone, runtime and risk attributes to PingOne Authorize or PingAuthorize, and write per-action rules that step down or require approval as risk rises.
  3. At PingGateway, restrict agent routes by source address or mutual TLS and deny listed agents.

Okta recipe

Okta

Okta for AI Agents, custom authorization servers and Agent Gateway

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Key-bound agent authentication, narrow authorization server policies and inline gateway controls. Written from Okta documentation.

Configure

  1. Register agents with public keys so tokens can only be obtained with the agent's private key held in its runtime.
  2. On custom authorization servers, write access policy rules per agent client with the narrowest scopes and short lifetimes.
  3. Route agent tool calls through Okta's Agent Gateway to apply inline controls and revoke access when risk appears; use Okta for AI Agents threat detection signals to trigger review.
  4. Enforce network origin at your API gateway, as authorization server policies focus on client, grant and scopes.

Microsoft Entra recipe

Microsoft Entra

Microsoft Entra Conditional Access for agents, ID Protection and Global Secure Access

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Block risky or unapproved agents; device and network controls for computer-using agents; network security for Copilot Studio agent traffic. Written from Microsoft documentation; several conditions in preview.

What Conditional Access can do for agents

TargetConditions availableGrant
Agent identitiesAgent risk (preview) onlyBlock
Agents' user accounts (computer-using agents)Agent risk, agent execution environments (preview), device platforms, networkBlock, or require compliant device or compliant network where the agent runs on a managed endpoint

Configure

  1. Create a policy that blocks agent identities with high agent risk for all resources (start in report-only).
  2. Tag approved agents with a custom security attribute and create a policy that blocks all other agents from sensitive resources.
  3. For computer-using agents on Windows 365 Cloud PCs for Agents, target agents' user accounts, set Agent execution environments to scope the policy to endpoint sessions, and require a compliant device or compliant network (Global Secure Access client).
  4. For Copilot Studio agents, enable Global Secure Access for Agents in the Power Platform admin center and apply web content, threat intelligence and file filtering to their traffic.
  5. Federate agent blueprint credentials to managed identities so tokens can only be obtained from Azure runtimes.

Gotchas

  • Conditional Access for agents needs Entra ID P1 or P2 and Agent 365 licensing; network controls need Entra Internet Access.
  • Without the agent execution environments condition, device or network policies block cloud agents that have no device.

Saviynt recipe

Saviynt

Saviynt Agent Access Gateway

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Context and intent evaluation with behaviour baselining. Written from Saviynt's published material.

Saviynt's Agent Access Gateway evaluates each agent action against identity, context, policy and intent, and Saviynt builds behaviour baselines for agents. Use deviations from the baseline as risk input and block actions outside the agent's approved context at the gateway.

Cloud workload identity, private endpoints and SPIFFE recipe

Cloud workload identity, private endpoints and SPIFFE

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Runtime binding and network pinning outside the identity provider.

Cloud platforms provide the strongest runtime binding: managed or workload identities that cannot be used outside the platform, private endpoints for APIs, and egress controls that pin agent traffic to known addresses. SPIFFE/SPIRE adds workload attestation for Kubernetes and VMs.

Verification tests#

TestExpected result
Use a copied agent token from an unknown networkGateway rejects
Try to obtain a token without the runtime's workload identityAuthentication fails
Raise the agent's risk in a test tenantToken issuance blocked; gateway and PDP deny consequential actions
Computer-using agent on an unmanaged desktopBlocked by policy for agent users
Cloud-only agent with no deviceNot blocked by device rules (scoped out)
New egress range after a platform changeDetected in report-only before enforcement

Maturity and verification#

Documented. Written from vendor documentation and standards; Trevonix has not yet lab-tested context-aware agent policies end to end. Several agent conditions in identity products are in preview.

Frequently asked questions#

Can we require MFA for agents?

No. Agents cannot complete interactive controls such as MFA, so identity providers generally offer only block for agent identities. Use approvals and scope reduction in your PDP for graded responses.

Do device rules apply to agents?

For agents that operate a desktop (computer-using agents) on managed virtual machines, yes: device compliance and compliant network checks apply to the agent's user session. For cloud-native agents with no device, scope device rules out.

Related patterns and references#

Cite this pattern

Trevonix (2026). Context-aware access for agents: runtime, network and risk (TIE-AGT-026, version 1.0). Identi Patterns. https://exchange.trevonix.com/patterns/tie-agt-026-context-aware-access-for-agents-runtime-network-and-risk

Licensed under CC BY 4.0. Credit Trevonix and link to this page when you reuse it.

Patterns are guidance, provided as is and without warranty. Test in a non-production environment and check current vendor documentation before you rely on them. Read the full disclaimer.