{"id":"TIE-AGT-003","title":"Externalised authorisation for agent actions","maturity":"reference-build","collection":"Agent identity","category":"Runtime authorisation","complexity":"High","intent":"Take the allow-or-deny decision for each agent action out of the agent and its prompt, make it in a policy decision point with full context, and enforce it at a gateway or the resource.","summary":"Scopes and roles say what an agent may ever do, not whether this action, for this user, now, is acceptable. This pattern sends each agent action to a policy decision point that returns permit, deny or permit-with-conditions, enforced outside the agent.","problems":["Excessive agency","Over-privileged agents","Inconsistent controls across agents","Accountability for AI actions","Audit evidence for AI governance"],"standards":["OpenID AuthZEN Authorization API 1.0","NIST SP 800-207 Zero Trust Architecture (PDP and PEP)","OAuth 2.0 Rich Authorization Requests (RFC 9396)","OWASP Agentic Top 10 ASI02 Tool Misuse and Exploitation","OWASP Agentic Top 10 ASI03 Identity and Privilege Abuse"],"tags":["policy decision point","PDP","policy enforcement point","PEP","externalised authorisation","fine-grained authorisation","ABAC","obligations","AuthZEN","runtime authorisation","API gateway","MCP gateway"],"roles":["IAM architect","Identity engineer","Security leader","Platform engineering","AI engineering"],"industries":["Cross-industry","Financial services","Healthcare","Retail","Public sector"],"builds_on":["TIE-AGT-001","TIE-AGT-002"],"related":["TIE-AGT-004","TIE-AGT-005"],"authors":"Trevonix Innovation","reviewers":"Trevonix IAM architecture","version":"1.0","last_reviewed":"2026-11-24","published":"2026-11-24","og_image":"og-tie-agt-003.png","sections":{"summary":[{"type":"bullets","content":"The agent **asks; it never decides**. Every consequential action becomes a request to a policy decision point (PDP): which agent, for which user, doing what, to which resource, in what context.\nThe PDP returns **permit, deny or permit with obligations**, such as \"get human approval\", \"step up the user\" or \"remove these fields\", plus a reason.\nA **policy enforcement point** (PEP) outside the agent, usually a gateway, carries out the decision. If the PDP cannot be reached, the action does not happen."}],"problem":[{"type":"paragraph","content":"Traditional access control answers a coarse question once, when a token is issued: may this client call this API with this scope? AI agents need a finer question answered every time they act: should *this* agent, acting for *this* user, perform *this* action on *this* resource, *now*? A payments scope cannot tell a £20 refund from a £20,000 transfer; a repository role cannot tell a test branch from a production deployment.\n\nTeams try to close the gap inside the agent: an instruction in the system prompt, a check in the tool code, a list of forbidden actions. Those controls run in the same place as the thing they are meant to control. A prompt injection, a model error or a developer shortcut bypasses them, and every agent ends up with its own slightly different version of the rules."}],"use_when":[{"type":"bullets","content":"Agents can take actions with real consequences: moving money, changing records, deploying code, sending messages, exporting data.\nThe same rules must apply to many agents, built by different teams on different platforms.\nDecisions depend on context that scopes cannot express: amounts, data classification, time, risk signals, approval state.\nYou need to show auditors exactly which rule allowed or blocked each action."}],"avoid_when":[{"type":"bullets","content":"The agent only reads public or low-sensitivity data, and scopes already express everything you need.\nYou cannot put an enforcement point in the request path. Fix that first; a PDP nobody consults protects nothing.\nYou hope a PDP will replace identity basics. It needs registered agents and delegated tokens to decide well (see TIE-AGT-001 and TIE-AGT-002)."}],"forces":[{"type":"bullets","content":"**Precision against latency.** Every decision adds a network call; agents may make many calls per task.\n**Central rules against local knowledge.** Security wants one policy; application teams know what their data and actions really mean.\n**Fail closed against availability.** Denying when the PDP is down is safe but can stop the business.\n**Expressiveness against reviewability.** Powerful policy languages can encode anything, and can become rules nobody can read."}],"solution":[{"type":"paragraph","content":"Split authorisation into three roles. The **PEP** sits in the request path, ideally a gateway in front of the APIs and tools the agent uses, and builds a decision request from the token, the request and context. The **PDP** evaluates versioned policies against that request and returns a decision with optional obligations and a reason. **Policy information points** supply facts the request does not carry, such as the agent's risk tier, the user's entitlements or the data's classification. The agent sees only the outcome."},{"type":"image","content":"The agent calls through an enforcement point; the decision comes from a policy decision point that sees the agent, the user, the action, the resource and the context.","title":"Solution overview","media":"tie-agt-003-solution.png","alt":"Diagram: an AI agent sends a request with a delegated token to a policy enforcement point (an API or MCP gateway). The gateway sends a decision request (subject: agent and user; action; resource; context) to the policy decision point, which reads facts from information sources: the agent registry, t"},{"type":"table","content":"Element | What goes in | Example\nSubject | The acting agent and the user it acts for | agent agt-refunds-prod (risk tier 2) acting for customer 4821\nAction | The operation, in business terms rather than HTTP verbs | refund.issue\nResource | What the action touches, with its attributes | order 99213, value £340, customer-owned\nContext | Facts about the moment | channel = chat, time = 23:40, user risk = low, approval = none yet\nDecision | permit, deny, or permit with obligations | permit with obligation `approval.required` because value > £250\nReason | Why, in a form both people and agents can use | `refund_over_agent_limit`","title":"What a decision request and response contain"},{"type":"numbered","content":"**Intercept.** The agent calls an API or tool through the PEP with its delegated token.\n**Describe.** The PEP validates the token and builds a decision request: subject (agent and user), action, resource and context.\n**Enrich.** The PDP pulls missing facts from information points: agent registry, entitlements, data catalogue, risk signals.\n**Decide.** The PDP evaluates the policies and returns permit, deny or permit with obligations, with a reason code.\n**Enforce.** The PEP forwards the call, fulfils the obligations (for example holds it for approval), or returns a structured denial the agent can explain to the user.\n**Record.** The PEP and PDP log the request, the policy version, the decision and the outcome under one correlation ID.","title":"How it works"},{"type":"code","content":"POST /access/v1/evaluation\n{\n  \"subject\":  { \"type\": \"agent\", \"id\": \"agt-refunds-prod\",\n                \"properties\": { \"on_behalf_of\": \"customer-4821\", \"risk_tier\": 2 } },\n  \"action\":   { \"name\": \"refund.issue\" },\n  \"resource\": { \"type\": \"order\", \"id\": \"99213\",\n                \"properties\": { \"amount_gbp\": 340, \"owner\": \"customer-4821\" } },\n  \"context\":  { \"channel\": \"chat\", \"approval\": \"none\" }\n}\n\n200 OK\n{ \"decision\": false,\n  \"context\": { \"reason\": \"refund_over_agent_limit\",\n               \"obligation\": \"approval.required\", \"approver_role\": \"team-lead\" } }","title":"Decision request and response in the shape of the OpenID AuthZEN Authorization API","language":"json"},{"type":"note","content":"The OpenID AuthZEN Authorization API 1.0, approved as a Final Specification in January 2026, standardises the request and response between PEPs and PDPs. Using its shape, even where your product has its own API, keeps enforcement points portable between decision engines.","title":"A standard interface between PEP and PDP"}],"design_rules":[{"type":"numbered","content":"**The agent never holds the rules.** Instructions in the prompt are guidance, not control. Enforcement happens outside the agent.\n**Describe actions in business terms.** `refund.issue` with an amount beats `POST /v2/refunds`; policies stay readable and survive API changes.\n**Decide on both identities.** Every request carries the agent and the user it acts for; policies can limit either.\n**Fail closed for consequential actions.** If the PDP cannot answer, deny. Allow cached or degraded decisions only for read-only, low-risk calls.\n**Return reasons and obligations, not just yes or no.** The agent can tell the user what happens next; the PEP knows what to do.\n**Version, test and review policies like code.** Every change has an owner, a test case and a record of which version made each decision.\n**One PDP, many PEPs.** Put enforcement at gateways and resources; keep decision logic in one place so all agents get the same answer.\n**Log every decision.** Request, policy version, decision, reason and outcome, joined by a correlation ID."}],"anti_patterns":[{"type":"table","content":"Anti-pattern | What goes wrong\nRules in the system prompt | A prompt injection or model error removes the rule; nothing outside the agent notices\nEach agent's own if-statements | Every team implements the rules slightly differently; nobody can say which rules are in force\nScopes as the only control | A refund scope permits every refund; amounts, data and context are invisible\nPDP consulted by the agent itself | The agent can skip the call, or call and ignore the answer\nFail open when the PDP is down | An outage, or an attacker who causes one, switches all controls off\nYes or no with no reason | Agents retry blindly or invent explanations for users; investigators cannot tell which rule fired"}],"benefits":[{"type":"bullets","content":"Consistent rules for every agent, whatever platform built it.\nDecisions that use amounts, data sensitivity, risk and approval state.\nA natural place for human approval, step-up and redaction.\nClear evidence of which policy version allowed each action.\nPolicies can change without redeploying agents."}],"costs":[{"type":"bullets","content":"Latency per decision. Keep the PDP close to the PEP and cache low-risk read decisions briefly.\nA new critical dependency: the PDP needs high availability and monitoring.\nPolicy engineering skills, and an owner for each policy.\nLicensing for a commercial PDP, or the effort to run an open-source one well."}],"tests":[{"type":"table","content":"Test | Expected result\nAgent requests an action below its limit | Permitted and logged with the policy version\nSame action above the limit | Denied, or permitted with an approval obligation, with a reason code\nSame action by a different agent with a lower risk tier | Decision reflects that agent's tier\nAgent calls the API directly, bypassing the gateway | Rejected by the API (wrong audience or network control)\nStop the PDP | Consequential actions are denied; the agent receives a clear \"try later\" response\nChange a policy and replay a recorded request | New decision matches the test case for the new version\nInspect the decision log for one action | Shows agent, user, action, resource, policy version, decision and reason"}],"maturity_notes":[{"type":"paragraph","content":"**Reference build.** Trevonix has built this pattern end to end with PingGateway as the enforcement point and Ping's authorisation engine as the decision point, in a lab tenant (November 2026). The Okta, Microsoft Entra, Saviynt and Open Policy Agent recipes are written from vendor and project documentation and have not yet been lab-tested by Trevonix."}],"faq":[{"type":"faq","content":"No. Scopes and roles still decide what an agent may ever do, and they are checked when the token is issued. The PDP decides whether a specific action, with its context, is acceptable now. You need both.","title":"Does this replace OAuth scopes and roles?"},{"type":"faq","content":"As close to the resource as you can while still seeing every call: an API or MCP gateway in front of the tools is usually the best place. Resources that hold the most sensitive data should also check decisions themselves.","title":"Where should the enforcement point sit?"},{"type":"faq","content":"Usually a few milliseconds when the PDP runs near the gateway. Cache read-only, low-risk decisions for seconds, never consequential ones.","title":"How much latency does it add?"},{"type":"faq","content":"Tell the agent, with a reason code, so it can explain the outcome to the user or take the next step, such as asking for approval. Never leave the agent to guess.","title":"What should the agent do when it is denied?"}],"references":[{"type":"bullets","content":"[OpenID Foundation: Authorization API 1.0 Final Specification approved](https://openid.net/authorization-api-1-0-final-specification-approved/)\n[OpenID AuthZEN Authorization API 1.0](https://openid.net/specs/authorization-api-1_0-final.html)\n[NIST SP 800-207: Zero Trust Architecture](https://csrc.nist.gov/pubs/sp/800/207/final)\n[PingGateway: PingOne Authorize integration](https://docs.pingidentity.com/pinggateway/2026/pingone/aam.html)\n[PingAuthorize: Statements](https://docs.pingidentity.com/pingauthorize/11.1/pingauthorize_policy_administration_guide/paz_statements.html)\n[Okta: Agent Gateway](https://help.okta.com/oie/en-us/content/Topics/ai-agents/agent-gateway.htm)\n[Saviynt: Intent-Aware Runtime Authorization for AI agents](https://saviynt.com/press-release/saviynt-expands-identity-security-for-ai-solution-with-intent-aware-runtime-authorization-for-ai-agents)\n[Open Policy Agent documentation](https://www.openpolicyagent.org/docs/latest/)"}]},"recipes":{"ping":{"status":"reference-build","product_name":"PingGateway with PingOne Authorize or PingAuthorize","summary":"PingGateway is the enforcement point and calls Ping's authorisation engine for each protected request through the PingAuthorizeFilter. Policies return statements that PingGateway turns into actions such as holding a request for approval.","last_verified":"2026-11","blocks":[{"type":"table","content":"Component | Role in this pattern\nPingGateway | The enforcement point: validates the agent's delegated token and asks for a decision on every protected route\nPingAuthorizeFilter | PingGateway filter that calls PingOne Authorize, or the PingAuthorize Sideband API, and enforces the result\nPingOne Authorize (or PingAuthorize) | The decision point: attributes, policies and statements (obligations)\nAPI service and API gateway records | Tell PingOne Authorize which API it protects and which gateway is calling\nRecent decisions | Visualises how each decision was reached, for testing and support","title":"Components"},{"type":"bullets","content":"Add PingOne Authorize to the PingOne environment, or have a PingAuthorize deployment with the Sideband API enabled.\nAgree action names and the attributes policies will need (agent ID, risk tier, on-behalf-of user, amount, data classification) before you write policies.","title":"Before you start"},{"type":"numbered","content":"In PingOne, go to **Authorization > API Services** and add an API service for the API the agent calls, with its base URL and the operations you want to control.\nGo to **Authorization > API gateways** and add a gateway record for PingGateway. Note its **Service URL** and create the gateway credential.\nIn the policy editor, define attributes for the agent, the user it acts for, the action and the resource, and build a policy for the API service. Add statements for obligations such as approval required, with a reason code.\nIn PingGateway, add a route for the API with a token validation filter followed by a **PingAuthorizeFilter** pointing at the gateway's Service URL and credential.\nSend a test call through PingGateway, then open **Authorization > Recent Decisions**, select the decision endpoint and check how the decision was reached.","title":"Configure the decision and enforcement points"},{"type":"bullets","content":"Earlier PingGateway releases document the PingOneApiAccessManagementFilter for this integration; current releases use the PingAuthorizeFilter. Use the filter documented for your PingGateway version.\nStatements are only useful if the enforcement point acts on them. Decide, per statement code, what PingGateway does, and deny when it meets a code it does not understand.\nPingGateway can also act as an enforcement point for PingAM policies (PolicyEnforcementFilter); for agent actions with business attributes, the PingOne Authorize integration is the better fit.","title":"Gotchas"},{"type":"bullets","content":"A permitted call reaches the API, and Recent Decisions shows the policy path that permitted it.\nA call that breaks a rule returns a denial with your reason code, and the API never sees it.","title":"Check it works"}]},"okta":{"status":"documented","product_name":"Okta for AI Agents with Agent Gateway","summary":"Okta controls which agent may reach which tool, for whom, at token time and through Agent Gateway. Business-rule decisions need an external decision point. Written from Okta's documentation; not yet lab-tested by Trevonix for this pattern.","last_verified":"2026-11","blocks":[{"type":"table","content":"Component | Role in this pattern\nAgent Gateway (Okta for AI Agents) | Identity-native proxy in front of MCP servers: verifies the agent, applies policy to each tool call and injects downstream credentials\nCustom authorization server policies | Coarse decisions at token time: which agent, which audience, which scopes, how long\nResource connections | Define which tools and resources each AI agent may reach\nExternal PDP (optional) | Fine-grained, context-rich decisions called from your gateway or API","title":"Components"},{"type":"numbered","content":"Register the agent under **Directory > AI Agents** and connect it to an Agent Gateway that fronts the MCP servers it uses.\nIn the gateway, add each MCP server and review its discovered tools; allow only the tools the agent's purpose needs.\nOn the authorization server used by the gateway, add access policy rules that limit scopes and token lifetime for the agent.\nFor decisions that need amounts, data classification or approval state, call an external PDP from the API or a gateway in front of it, using an AuthZEN-shaped request.\nUse the gateway activity view to confirm each tool call is attributed to the agent and the user it acts for.","title":"Configure"},{"type":"bullets","content":"Agent Gateway decides which agent may call which tool on whose behalf; it is not a general business-rule engine. Keep amount limits and similar rules in a PDP.","title":"Gotchas"}]},"entra":{"status":"documented","product_name":"Microsoft Entra Agent ID with Azure API Management","summary":"Entra controls which permissions an agent holds and can block risky agents at token time; per-action decisions need a gateway and an external decision point. Written from Microsoft documentation; not yet lab-tested by Trevonix.","last_verified":"2026-11","blocks":[{"type":"table","content":"Component | Role in this pattern\nAgent identity and permissions | Coarse control: which APIs and permissions the agent holds\nConditional Access for agents | Token-time block for agents, for example agents flagged as high risk\nAzure API Management (or another gateway) | The enforcement point in front of APIs and tools\nExternal PDP | Fine-grained decisions; Entra does not provide a general-purpose policy decision point","title":"Components"},{"type":"numbered","content":"Give the agent identity only the permissions its purpose needs (see TIE-AGT-001 and TIE-AGT-002).\nPut the agent's APIs and tools behind a gateway such as Azure API Management. Validate the Entra-issued token there (issuer, audience, the agent identity) before anything else.\nFrom the gateway, call your PDP with the agent, the user, the action, the resource and context, and enforce the result: forward, deny with a reason, or hold for approval.\nCreate a Conditional Access policy that blocks agent identities with high agent risk, so a compromised agent cannot get tokens at all.\nLog gateway decisions to the same workspace as Entra sign-in logs and join them on correlation ID.","title":"Configure"},{"type":"bullets","content":"Conditional Access for agent identities offers **Block access** as its only grant control; it is a token-time switch, not a per-action decision.","title":"Gotchas"}]},"saviynt":{"status":"documented","product_name":"Saviynt Agent Access Gateway","summary":"Saviynt's Agent Access Gateway evaluates agent actions at runtime against identity, context, policy and intent. Written from Saviynt's published material; not lab-tested by Trevonix.","last_verified":"2026-11","blocks":[{"type":"table","content":"Capability | Role in this pattern\nAgent Access Gateway | Runtime authorisation layer between agents and applications, data, APIs, tools and other agents\nIntent-Aware Runtime Authorization (IARA) | Evaluates each agent action on identity, context, policy and intent\nStatic and dynamic tool policies | Control which tools an agent may use, and under what conditions","title":"Capabilities used"},{"type":"numbered","content":"Onboard the agents and the tools and MCP servers they use into Saviynt's AI inventory, with owners.\nRoute agent traffic to protected tools through Agent Access Gateway.\nDefine static policies for which tools each agent may use, and dynamic policies for context such as data sensitivity or risk.\nReview decision logs with the agent's owner and tune policies before you switch from monitoring to blocking.","title":"Configure"},{"type":"bullets","content":"Agent Access Gateway and IARA were introduced in 2026; check availability, supported integrations and licensing for your tenant.","title":"Gotchas"}]},"misc":{"status":"documented","product_name":"Open Policy Agent","summary":"Open Policy Agent can serve as the decision point behind any gateway, with policies written in Rego. Written from project documentation; not lab-tested by Trevonix for this pattern.","last_verified":"2026-11","blocks":[{"type":"paragraph","content":"Open Policy Agent (OPA) is an open-source, general-purpose policy engine. Run it as a sidecar or service next to your gateway, write policies in Rego, and have the gateway send AuthZEN-shaped input."},{"type":"code","content":"package agents.refunds\n\ndefault allow := false\n\nallow if {\n    input.action.name == \"refund.issue\"\n    input.resource.properties.owner == input.subject.properties.on_behalf_of\n    input.resource.properties.amount_gbp <= 250\n}\n\nobligations contains \"approval.required\" if {\n    input.action.name == \"refund.issue\"\n    input.resource.properties.amount_gbp > 250\n    input.context.approval != \"granted\"\n}","title":"refunds.rego","language":"text"},{"type":"bullets","content":"Keep policies in source control with unit tests (`opa test`), and deploy them as signed bundles.\nTurn on OPA decision logs and ship them with the gateway's logs.","title":"Operate"}]}},"slug":"tie-agt-003-externalised-authorisation-for-agent-actions","updated_at":"2026-11-24T16:55:56.540Z","url":"https://exchange.trevonix.com/patterns/tie-agt-003-externalised-authorisation-for-agent-actions","markdown_url":"https://exchange.trevonix.com/patterns/tie-agt-003-externalised-authorisation-for-agent-actions.md","publisher":"Trevonix","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"}}