{"id":"AGT-043","title":"Just-in-time privileged access for agents","maturity":"documented","collection":"Agent identity","category":"Credentials","complexity":"High","intent":"Give agents that must perform administrative or high-impact work no standing privilege: they request elevation for a specific task, receive it for minutes through a vault or broker with approval where the tier requires, act through a recorded path, and lose it automatically.","summary":"Operations, security and DevOps agents often hold admin roles or vaulted passwords permanently. Give them zero standing privilege: elevation per task, approved by a person for high tiers, delivered through a vault or broker, recorded, and removed automatically when the task ends or the agent misbehaves.","problems":["Standing admin access for automation","Privileged credential exposure","Lateral movement by compromised agents","Audit of privileged actions","Production changes by agents"],"standards":["NIST SP 800-207 (Zero Trust Architecture)","NIST SP 800-53 AC-6 Least Privilege","CIS Controls v8 (5 Account Management, 6 Access Control Management)","OWASP Top 10 for Agentic Applications 2026 (ASI03 Identity and Privilege Abuse)"],"tags":["privileged access","PAM","just-in-time","JIT","zero standing privilege","ZSP","elevation","vault","session recording","break glass","admin roles","operations agent","DevOps agent","PIM","time-bound assignment"],"roles":["IAM architect","Identity engineer","Security leader","Platform engineering","AI engineering"],"industries":["Cross-industry","Financial services","Healthcare","Retail","Public sector"],"builds_on":["AGT-013","AGT-014"],"related":["AGT-004","AGT-016","AGT-036"],"authors":"Trevonix Innovation","reviewers":"Trevonix IAM architecture","version":"1.0","last_reviewed":"2026-11-25","published":"2026-11-25","og_image":"og-agt-043.png","sections":{"summary":[{"type":"bullets","content":"Agents get **no standing admin rights**. For a privileged task they **request elevation** with the task, target and duration; policy grants it, or a **person approves** for high-tier actions.\nElevation is delivered by a **vault or broker**: a short-lived role, a temporary credential, or a credential **injected into the session** so the agent never holds it.\nEvery privileged session is **recorded and attributable**, and privilege **expires automatically** at task end, on timeout, or when risk rises."}],"problem":[{"type":"paragraph","content":"Some of the most useful agents do privileged work: an operations agent restarts services and changes configuration, a security agent isolates hosts and disables accounts, a DevOps agent deploys to production, a database agent runs maintenance. The easy design gives them what a human operator would have, permanently: an admin role, a service account in the domain admins group, a vaulted password checked out once and cached.\n\nStanding privilege in an agent is worse than in a person. The agent runs all the time, takes instructions from content it reads, and can be steered by prompt injection or a compromised tool. A single bad instruction or stolen token then has administrator reach. Audits find privileged actions with no record of which task needed them or who agreed."}],"use_when":[{"type":"bullets","content":"Agents perform administrative tasks on infrastructure, directories, databases or SaaS admin consoles.\nAgents need vaulted credentials for legacy systems.\nRegulators or auditors expect privileged access management for all privileged identities."}],"avoid_when":[{"type":"bullets","content":"The agent's work never needs more than ordinary, narrowly scoped API access. Use task-scoped credentials (AGT-014) and a decision point (AGT-003)."}],"forces":[{"type":"bullets","content":"**Autonomy against oversight.** Approval for every elevation slows agents; none removes the point of PAM.\n**Speed of response against standing access.** Incident-response agents need privilege fast, at any hour.\n**Legacy systems.** Many targets still need passwords or SSH keys, not tokens.\n**Tool support.** PAM products added agent support in 2025 and 2026; coverage varies by target."}],"solution":[{"type":"paragraph","content":"Put a privileged access broker between agents and privileged targets. The agent identity holds no admin rights by default. When a task needs privilege, the agent (or its orchestrator) requests elevation with the task reference, target, actions and duration. Policy, based on the agent's tier and the action, grants it automatically for low-risk routine work or routes it to a person for approval. The broker then delivers the narrowest possible privilege: a time-bound role assignment, a temporary credential from a vault, or, preferably, credential injection into a proxied session so the agent never sees the secret. Sessions are recorded and tied to the task. Privilege ends on task completion, at the time limit, or immediately when the agent's risk rises or a kill switch is used."},{"type":"image","content":"No standing privilege: request, approve where needed, deliver narrowly, record, expire.","title":"Solution overview","media":"agt-043-solution.png","alt":"Diagram. Left: an operations agent with no admin rights receives a task: restart a payment service in production. Step 1: it requests elevation from the privileged access broker with task, target, actions and 30 minutes. Step 2: the broker's policy sees a tier 4 agent and a production target and ask"},{"type":"table","content":"Delivery method | Agent holds a secret? | Use for\nTime-bound role assignment | No; its own identity gains a role for minutes | Cloud and directory roles\nTemporary credential from a vault | Yes, briefly; rotated after use | Legacy systems that need passwords or keys\nCredential injection into a proxied session | No | Databases, SSH, admin consoles behind a broker\nEphemeral identity created for the task | Yes, for the task only | Cloud accounts and Kubernetes where supported","title":"How privilege is delivered"},{"type":"numbered","content":"**Remove standing privilege** from agent identities; inventory every admin role, privileged group and vaulted credential they hold.\n**Define privileged tasks** per agent: targets, actions, maximum duration and tier.\n**Write elevation policy:** automatic for low-risk routine tasks, human approval for high tiers or production, always deny for break-glass accounts.\n**Choose the delivery method** per target, preferring injection or time-bound roles over credential checkout.\n**Record sessions** and link them to the task and approval.\n**Expire automatically** at task end, on timeout, and on risk or kill-switch signals (AGT-016).\n**Review** elevations and approvals monthly; remove tasks agents no longer need.","title":"How it works"},{"type":"tip","content":"Incident-response agents need privilege at 3 a.m. Pre-approve narrow, well-tested actions (isolate a host, disable an account) with automatic elevation and immediate notification, and keep everything else behind approval.","title":"Pre-approve the urgent, narrow actions"}],"design_rules":[{"type":"numbered","content":"**No standing privilege for agents.**\n**Every elevation names a task, target, actions and duration.**\n**Approvals are independent of the agent's owner for its own actions** (AGT-036).\n**Inject or time-bind; check out credentials only when nothing else works.**\n**Every privileged session is recorded and attributable.**\n**Privilege ends automatically.**"}],"anti_patterns":[{"type":"table","content":"Anti-pattern | What goes wrong\nAgent in a permanent admin role \"because it runs all the time\" | Any prompt injection or token theft has admin reach\nVaulted password checked out once and cached by the agent | The vault becomes a formality; the password lives in the agent\nAgent's owner approves the agent's elevation | Self-approval; no independent check\nPrivilege without a task reference | Nobody can say why a privileged action happened\nSame broker policy for people and agents | Agents get human-length sessions they do not need"}],"benefits":[{"type":"bullets","content":"Compromised agents have no ambient admin rights.\nEvery privileged action is tied to a task, an approval and a recording.\nPrivileged credentials stay in the vault.\nConsistent PAM for people, machines and agents."}],"costs":[{"type":"bullets","content":"PAM licensing and broker deployment for agent targets.\nPolicy design for tasks, tiers and approvals.\nSome latency for approvals on high-tier actions.\nLegacy targets may need connectors or proxies."}],"tests":[{"type":"table","content":"Test | Expected result\nList admin roles and privileged groups held by agents | None standing\nAgent requests elevation for a tier 4 production task | Approval required; granted only for the requested duration\nAgent tries a privileged action without elevation | Denied\nPrivilege after task completion or timeout | Removed\nRisk alert during a privileged session | Session ended; privilege revoked\nReview a privileged session | Task, approver, recording and actions linked"}],"maturity_notes":[{"type":"paragraph","content":"**Documented.** Written from PAM practice and vendor documentation. Agent-specific privileged access features (agent gateways for MCP, agent identities as assignees, vaulted secrets for agents) arrived in 2025 and 2026 and several are early access."}],"faq":[{"type":"faq","content":"Not by themselves: approval prompts are for people. The agent or its orchestrator requests elevation through an API, and the approval goes to a person through the broker; or policy grants it automatically for low-risk tasks.","title":"Can an agent activate an eligible role itself?"},{"type":"faq","content":"Yes. Break-glass accounts are for people in emergencies. Agents should never hold or check them out; route agent emergencies through pre-approved, narrow elevations instead.","title":"Should agents ever use break-glass accounts?"}],"references":[{"type":"bullets","content":"[Microsoft Learn: Assign Microsoft Entra roles in Privileged Identity Management](https://learn.microsoft.com/azure/active-directory/roles/groups-pim-eligible)\n[Okta Help: AI agent resource connections (secrets and service accounts)](https://help.okta.com/oie/en-us/content/topics/ai-agents/ai-agent-secure.htm)\n[Ping Identity: PingOne Privilege Agent Privilege](https://docs.pingidentity.com/privilege/agent-privilege/mcp-gateway.html)\n[CyberArk: Secure AI Agents](https://www.cyberark.com/resources/product-insights-blog/cyberark-secure-ai-agents)\n[NIST SP 800-207: Zero Trust Architecture](https://csrc.nist.gov/pubs/sp/800/207/final)"}]},"recipes":{"ping":{"status":"documented","product_name":"PingOne Privilege Agent Privilege","summary":"Just-in-time, policy-controlled agent access to MCP and Git servers with session logs.","last_verified":"2026-11","blocks":[{"type":"numbered","content":"Use PingOne Privilege **Agent Privilege** to front MCP servers and Git servers with just-in-time, least-privilege access: configure the MCP Gateway, create MCP Server applications, and set policies on which tools, prompts and resources are available and for how long.\nReview **Session Logs** and **Activity Logs** for every agent session.\nFor time-limited policies, set start date and end date in the policy.","title":"Configure"}]},"okta":{"status":"documented","product_name":"Okta Privileged Access with AI agent resource connections","summary":"Vaulted secrets and service accounts retrieved through Okta with audit (early access).","last_verified":"2026-11","blocks":[{"type":"numbered","content":"Vault target credentials in **Okta Privileged Access** and connect the agent with a **Secret** or **Service account** resource connection (early access), so it retrieves credentials through Okta with audit.\nPrefer authorisation server connections with narrow scopes where the target supports tokens; Okta describes service account connections as less secure than authorisation server or vaulted secret connections.\nDeactivate the resource connection to remove access at once.","title":"Configure"},{"type":"bullets","content":"Secret and service account connections need the Okta Privileged Access security admin role and are not in the Okta for AI Agents Core SKU.","title":"Gotchas"}]},"entra":{"status":"documented","product_name":"Privileged Identity Management with agent identities","summary":"Time-bound role assignments for agents with approval routing. Written from Microsoft documentation.","last_verified":"2026-11","blocks":[{"type":"numbered","content":"In Privileged Identity Management, Microsoft Entra roles can be assigned to agent identities; prefer **time-bound active assignments** with start and end dates for agents, because eligible-role activation is designed for people.\nFor Azure resources, use time-bound role assignments scoped to the resource group or resource the task needs.\nRoute requests through an approval service (for example an access package with approval and short expiry) so a person approves high-tier elevations.\nAlert on any agent identity holding a privileged role outside PIM.","title":"Configure"},{"type":"bullets","content":"PIM needs Microsoft Entra ID P2 or ID Governance. PIM for app roles with agent identities was preview; how non-interactive agents activate eligible assignments was not documented.","title":"Gotchas"}]},"saviynt":{"status":"documented","product_name":"Saviynt privileged access with Zuma Access","summary":"Vaulting and time-bound access; confirm agent support.","last_verified":"2026-11","blocks":[{"type":"paragraph","content":"Saviynt's privileged access capabilities can vault credentials and grant time-bound access; combine them with Zuma Access for runtime decisions on agent tool calls. Confirm agent identity support for privileged sessions in your release."}]},"misc":{"status":"documented","product_name":"CyberArk Secure AI Agents and cloud-native ephemeral credentials","summary":"Zero standing privilege for agents through a gateway; short-lived cloud sessions.","last_verified":"2026-11","blocks":[{"type":"paragraph","content":"CyberArk Secure AI Agents (generally available from December 2025) applies zero standing privilege and least privilege to agents through a gateway for MCP-connected resources and logs agent actions. Cloud-native options include short-lived role sessions and per-task ephemeral credentials issued by the cloud provider."}]}},"slug":"agt-043-just-in-time-privileged-access-for-agents","updated_at":"2026-12-02T09:48:47.860Z","url":"https://patterns.trevonix.com/patterns/agt-043-just-in-time-privileged-access-for-agents","markdown_url":"https://patterns.trevonix.com/patterns/agt-043-just-in-time-privileged-access-for-agents.md","publisher":"Trevonix","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"}}