Guardrails, permissions and governance for AI IT service desk agents

Permissions, approvals and rules for help desk agents in Okta, Entra ID and Intune: resets need an identity check outside the chat, admin roles need two people, and every grant has an end time.

· 9 min read

Build guardrails for an IT service desk agent by sorting what it does by whose access it changes. Reading and answering tickets runs free. Password and MFA resets, group grants, licence purchases, device wipes, offboarding and mailbox changes go through a person, or through a rule a person wrote in advance. Admin accounts, admin roles and sign-in policies stay with people, and two of them for anything privileged. Identity is checked outside the chat, never taken from what a caller types, and the agent holds its own narrowly scoped credentials, never an administrator’s.

Governance is the same thing written down: the list of actions, who may approve each, and a record showing every change had an approval and an end. This page covers agents that work in Okta, Microsoft Entra ID and Intune, Google Workspace, Jamf, ServiceNow or Jira Service Management, whether they answer chat, work a ticket queue or run as a workflow.

Sort every action by whose access it changes

Start with every tool the agent can call, and ask of each: if the person on the other end is not who they claim, what do they get? A ticket reply gives them nothing. A password reset gives them the account.

IT service desk agent actions with the action name they ask under, what can go wrong, and the guardrail to put in front of each
OptionAction nameWhat can go wrongGuardrail
Read, sort and answer ticketsAction nameticket.read, ticket.comment, ticket.categorizeWhat can go wrongLow. A ticket can carry a prompt injection, so it must not steer other tools.GuardrailRuns free. The ticket text is input from whoever wrote it, never an instruction.
Reset a password or MFA methodsAction nameidentity.password.reset, identity.mfa.resetWhat can go wrongThe main social-engineering path: a caller who is not who they say gets the account.GuardrailAsk, with a verification a person did outside the chat. Non-admin accounts only.
Reset an admin accountAction nameidentity.admin.*What can go wrongOne reset hands over the whole directory.GuardrailNever. People only, with stronger checks.
Add someone to a groupAction nameaccess.group.add_temporaryWhat can go wrongAccess that outlives the reason for it, and is never reviewed.GuardrailAsk, with the group owner and an end time; the removal is scheduled before access is added.
Grant an admin roleAction nameaccess.admin_role.grantWhat can go wrongStanding admin rights for an account that may itself be compromised.GuardrailTwo people, time-limited, through the directory's own just-in-time tool.
Buy a licence or a seatAction namelicense.purchaseWhat can go wrongSpend that renews every month until someone notices.GuardrailAllow a single seat with a monthly budget; ask above; deny large.
Lock or wipe a deviceAction namedevice.lock, device.wipeWhat can go wrongA wipe destroys data and cannot be undone. A false lost-device report is enough to trigger one.GuardrailAsk to lock; two people to wipe.
Offboard a personAction nameuser.disable, user.deleteWhat can go wrongDisabling the wrong person stops their work; deleting loses mail and files.GuardrailAsk to disable, from an HR record, not a ticket; never delete.
Delegate a mailbox or add a forwarding ruleAction namemailbox.delegate, mailbox.forward_externalWhat can go wrongQuiet, lasting access to someone else's mail.GuardrailAsk for delegation; never forward outside the company.
Change sign-in or network policyAction namepolicy.conditional_access.*, policy.firewall.*What can go wrongOne change can switch off MFA or open a port for everyone.GuardrailNever. Change management, by people.

One family per kind of effect lets one rule cover a family: identity.* for everything that hands over an account, policy.* for everything that changes the rules for everyone. Give admin accounts their own names, identity.admin.*, chosen by the tool from the directory’s roles, never by the model. See naming agent actions, and the tool risk checker sorts a list of tools into tiers like these.

What went wrong at help desks, and what standards ask

The 2023 help desk calls

In September 2023 MGM Resorts spent days with systems down after an attack the group known as Scattered Spider claimed. The group said it got in by social engineering; reports at the time described finding an employee on LinkedIn and calling the IT help desk as that person. In a filing with the SEC on 5 October 2023, MGM estimated the cost to its third quarter at about $100 million.

CISA and the FBI described the method in advisory AA23-320A, first published on 16 November 2023 and last revised on 29 July 2025. Scattered Spider posed as company IT and help desk staff to get employees’ one-time codes, and posed as employees to convince IT and help desk staff to reset passwords and transfer MFA to a device the attackers controlled.

Okta reported the same pattern on 31 August 2023. Between late July and mid-August, callers tried to convince customers’ service desks to reset all MFA factors of highly privileged users, mostly Super Administrators. With those accounts they reset other admins’ authenticators, in some cases removed MFA from sign-in policies, and added an identity provider of their own to impersonate users. Okta advised stronger, visual identity checks before a service desk resets anything.

An agent on the service desk meets the same caller, only faster and without a hunch that something is off. It also reads text a stranger wrote, which is how prompt injection arrives.

NIST SP 800-63B-4 on account recovery

NIST’s authentication guidelines, final in July 2025, treat regaining an account after losing its authenticators as account recovery (section 4.2). It may use saved or issued recovery codes, recovery contacts or repeated identity proofing; any other method needs a documented risk analysis, and every recovery must notify the subscriber. For an account at AAL2 it takes two recovery codes from different methods, a code plus a still-bound authenticator, or proofing identity again. A chat message saying “it’s me” is none of these.

SOC 2: CC6.2 and CC6.3

The AICPA’s Trust Services Criteria ask that new users are registered and authorised before credentials are issued, and that credentials are removed when access is no longer authorised (CC6.2). Access to data and functions is authorised, changed and removed based on roles and responsibilities, with least privilege and segregation of duties in mind (CC6.3). An auditor sampling access changes will ask who approved each. When an agent makes the change, the answer is the approval record: who decided, from which ticket, and when it ended.

ISO/IEC 27001:2022, control 5.18

Annex A control 5.18, access rights, asks that access rights are provisioned, reviewed, modified and removed according to your access control policy. An end time stated in the request and a removal booked before access is added turn “reviewed and removed” from a quarterly chore into something that happens on its own. More on the evidence auditors ask for is in audit evidence for AI agent access.

Check identity outside the chat

The caller controls everything in the conversation: the name, the urgency, the manager they mention, the screenshot of a badge. So the agent never decides who someone is. It reads the result of a check that happened somewhere the caller cannot write.

  • A check the caller cannot be talked into. A call back to the number HR holds, not the one in the ticket; the manager confirming on a video call; a person at the desk with ID; or a recovery code issued earlier. A person on the service desk records the check in the ticket system, and the reset tool reads it there.
  • Fresh and for this account. The tool refuses a check older than half an hour, or one recorded for someone else. Every reset also notifies the owner on a channel the caller did not supply, as NIST asks for every recovery.
  • Admins never through the agent. Okta’s 2023 warning was about Super Administrator resets. The tool looks up the account’s roles itself and refuses, and a deny rule backs it up.

The approver sees the same facts: who checked, how, the manager, how many methods the account had, when it last signed in. The trap of a reviewer nodding through a fluent story is covered in human-agent trust exploitation.

The agent’s own credentials

An approval means little if the agent can go around it.

  • Know what an application permission reaches in Microsoft Graph. With delegated permissions an app can do only what the signed-in person could, and Microsoft recommends them where they meet the need. An agent working a queue on its own uses application permissions, which reach any data the permission covers: User.ReadWrite.All as an application permission can update users with privileged admin roles. Pick the narrowest permission the task needs, and remember that a tool behind an approval is only as limited as the credential it runs with.
  • The smallest Entra role. Helpdesk Administrator resets passwords for non-admins and a short list of other roles. Authentication Administrator also resets MFA methods, for non-admins and some roles. Privileged Authentication Administrator can do it for anyone, including Global Administrators, so an agent should never hold it. Make admin roles time-limited through Privileged Identity Management.
  • An Okta service app, not an API token. OAuth service apps get tokens with scopes, such as okta.users.read or okta.users.manage, that live one hour. Okta says to assign an admin role to every service app, which then limits it to that role’s permissions; the Help Desk Administrator role can be limited to the groups it may manage.
  • One approval key per agent. In VariantGate a key can be scoped to the actions it may ask about: the service desk agent’s to ticket.*, identity.*, access.*, license.*, device.*, user.disable and mailbox.delegate, so a request under policy.* is refused before any rule. Rules match on the key, never on the name the agent gives itself.
  • No tool for what nobody should automate. An agent with no reason to edit conditional access gets no call that can. A rule is the second line. More in identity and privilege abuse.

The pattern in code

Each risky tool asks, waits, and acts only on allowed: true. Pending, denied, expired and withdrawn all mean no, and so does an approval while agents are paused. One helper holds that for every tool, with the TypeScript SDK:

import { ApprovalClient } from "@variantgate/agent";
import { describe } from "@variantgate/agent/errors";
import type { ApprovalRequest, Decision, Outcome } from "@variantgate/agent/types";

// One client per agent, each with its own key, so a rule for one never covers another.
const approvals = new ApprovalClient({
  agent: "helpdesk-agent",
  apiUrl: process.env.VARIANTGATE_API_URL ?? "https://api.variantgate.com",
  key: process.env.VARIANTGATE_KEY ?? "",
});

type Answer = { go: true; decision: Decision } | { go: false; why: string };

/** Asks and waits. Only an approval without changes lets the agent act. */
export async function askAndWait(request: ApprovalRequest): Promise<Answer> {
  let asked: Decision | undefined;
  try {
    asked = await approvals.ask(request, 30);
    const decision = await approvals.waitForDecision(asked);
    if (!decision.allowed) {
      // Denied, expired, withdrawn, still pending at the end, or approved while paused.
      return { go: false, why: `the request is ${describe(decision)}` };
    }
    if (decision.changed) {
      // A person changed it before approving. This code can only do what it asked.
      await report(decision.id, "failed", "not done: the approval changed the request");
      return { go: false, why: "it was approved only with changes" };
    }
    return { go: true, decision };
  } catch {
    // No answer is not a yes. Take the request back so nobody approves it later.
    if (asked) await approvals.withdraw(asked.id).catch(() => undefined);
    return { go: false, why: "no answer could be had" };
  }
}

/** Reports how it went. Best effort: a failed report never undoes or repeats the action. */
export function report(id: string, outcome: Outcome, note?: string) {
  return approvals.reportOutcome(id, outcome, note).then(() => true, () => false);
}

/** The error's class only. Messages from other APIs can carry tokens and addresses. */
export const kindOf = (error: unknown) => (error instanceof Error ? error.name : "error");

The MFA reset tool refuses admin accounts before asking, reads the verification from the ticket system, and reads the account again after the yes: an approval for a plain account is not an approval for one that was given an admin role in the meantime. Once the reset has run it never throws, so the model has no reason to run it twice.

// Checks a person did outside the chat. A caller cannot talk their way into one of these.
const TRUSTED_CHECKS = ["callback-to-hr-number", "manager-on-video", "in-person-with-id"];
const CHECK_VALID_MINUTES = 30;

/** Clears one person's MFA methods so they can enrol again. Never for an admin. */
export async function resetMfa(ticket: Ticket, userId: string): Promise<string> {
  const user = await directory.getUser(userId);
  if (user.adminRoles.length > 0 || user.inRoleAssignableGroup) {
    return "Not reset: this is an admin account. Hand the ticket to the identity team.";
  }
  // Identity comes from the service desk's record, never from what the caller typed.
  const check = await itsm.getVerification(ticket.id);
  const fresh = check && minutesSince(check.doneAt) <= CHECK_VALID_MINUTES;
  if (!fresh || check.userId !== user.id || !TRUSTED_CHECKS.includes(check.method)) {
    return "Not reset: no recent check of this person on file. Ask the service desk to verify them.";
  }
  const answer = await askAndWait({
    action: "identity.mfa.reset",
    summary: `Reset MFA for employee ${user.employeeId} (${user.department}), ticket ${ticket.number}`,
    details: {
      employee: user.employeeId,
      ticket: ticket.number,
      "checked by": check.analystId, // an id, never a name or a phone number
      "check method": check.method,
      manager: user.managerEmployeeId,
      "methods registered now": user.methodCount,
      "last sign-in": user.lastSignInAt,
    },
    ttlSeconds: 30 * 60,
  });
  if (!answer.go) return `Not reset: ${answer.why}. Do not reset it another way.`;

  // Roles and methods can change while a request waits. Read them again just before acting.
  const latest = await directory.getUser(user.id);
  const sameAccount =
    latest.adminRoles.length === 0 && !latest.inRoleAssignableGroup && latest.methodCount === user.methodCount;
  if (!sameAccount) {
    await report(answer.decision.id, "failed", "not done: the account changed while waiting");
    return "Not reset: the account changed while waiting. Hand the ticket to a person.";
  }
  try {
    await directory.deleteMfaMethods(user.id);
    await directory.revokeSessions(user.id);
  } catch (error) {
    await report(answer.decision.id, "failed", `may have gone through: ${kindOf(error)}`);
    return "The reset may have partly happened. Tell a person on the service desk; do not retry.";
  }
  // The work is done. Nothing below throws, so the model has no reason to reset twice.
  // Tell the account's owner on a channel from their record, never one the caller gave.
  await directory.notifyOwnerOnFile(user.id, "mfa_reset").catch(() => undefined);
  await report(answer.decision.id, "succeeded", `ticket ${ticket.number}`);
  return "MFA cleared and sessions signed out. The service desk will guide the new enrolment.";
}

The group tool states the end time in the request and books the removal before it adds anyone, so access cannot outlive the approval even if the agent stops halfway. Its key is built from the group, the person and the end time, so a retry of the same grant is the same grant.

const MAX_HOURS = 72;

/** Adds a person to a group until a stated time, and books the removal before adding. */
export async function grantTemporaryAccess(ticket: Ticket, userId: string, groupId: string, hours: number) {
  if (!Number.isInteger(hours) || hours < 1 || hours > MAX_HOURS) {
    return `Not granted: ask for 1 to ${MAX_HOURS} whole hours.`;
  }
  const group = await directory.getGroup(groupId);
  if (group.grantsAdminRole || group.isPrivileged) {
    return "Not granted: admin access goes through the identity team, two people.";
  }
  if (await directory.isMember(groupId, userId)) return "Nothing to do: already a member.";

  // The end time is fixed now and stated in the request. Waiting for a yes never extends it.
  const until = new Date(Date.now() + hours * 3_600_000).toISOString();
  const answer = await askAndWait({
    action: "access.group.add_temporary",
    summary: `Add employee ${userId} to the group ${group.name} until ${until} (${hours} hours)`,
    details: {
      group: group.name,
      "group owner": group.ownerEmployeeId,
      "members now": group.memberCount,
      ticket: ticket.number,
      "ends at": until,
    },
    ttlSeconds: 60 * 60,
  });
  if (!answer.go) return `Not granted: ${answer.why}.`;

  const { id } = answer.decision;
  // A group can gain an admin role while the request waits. Approved was the group as it was.
  const groupNow = await directory.getGroup(groupId);
  if (groupNow.grantsAdminRole || groupNow.isPrivileged || groupNow.version !== group.version) {
    await report(id, "failed", "not done: the group changed while waiting");
    return "Not granted: the group changed while waiting. Hand the ticket to a person.";
  }
  // Someone else may have added them meanwhile; that access is not this grant's to remove.
  if (await directory.isMember(groupId, userId)) {
    await report(id, "failed", "not done: already a member by the time it was approved");
    return "Nothing to do: they were added another way while waiting.";
  }
  if (Date.parse(until) <= Date.now()) {
    await report(id, "failed", "not done: the approved window had passed");
    return "Not granted: the approved time is over. Ask again if it is still needed.";
  }
  // Book the removal first, so the access can never outlive the approval.
  const grantKey = `grant:${groupId}:${userId}:${until}`; // the same grant gets the same key
  try {
    await scheduler.scheduleRemoval({ groupId, userId, at: until, idempotencyKey: grantKey });
  } catch (error) {
    await report(id, "failed", `not done: removal not booked, ${kindOf(error)}`);
    return "Not granted: the removal could not be booked. Tell a person.";
  }
  try {
    await directory.addMember(groupId, userId, { idempotencyKey: grantKey });
  } catch (error) {
    await report(id, "failed", `may have gone through: ${kindOf(error)}`);
    return "The grant may have gone through; its removal is booked. Tell a person; do not retry.";
  }
  await report(id, "succeeded", `until ${until}`);
  return `Added until ${until}. The removal is booked.`;
}

The summary check holds a request whose summary disagrees with its details, so no allow rule approves it. An approval receipt goes further. Keep the directory credentials in a small reset service that demands one and checks, offline, that this action with these details was approved. An agent that asked about one account and then calls the reset for another is refused there.

Standing rules for a service desk workspace

Rules answer the routine at once and send the rest to the right person. Anything no rule covers, such as device.lock or user.disable, waits for a person.

  1. Always allow ticket.*, for helpdesk-agentReading, tagging and answering tickets changes no access, so it runs at once and still leaves a line in the record.
  2. Always ask about identity.*, for the service desk lead and an identity engineer, anyone after 15 minutesEvery password and MFA reset waits for a person who can see the verification record. Someone locked out should not wait all morning, so it escalates after 15 minutes.
  3. Never allow identity.admin.*Resets of admin accounts are the path the 2023 help desk attacks took. People do them, in person or on video, never an agent.
  4. Always ask about access.group.add_temporary, for the service desk leadAccess to a shared drive or an app group is routine but still access. The request names the group, the owner and the end time.
  5. Always ask about access.admin_role.*, two people, for the identity lead and securityAn admin role, even for an hour, needs two people (workspace owners can always decide routed requests too). One denial stops it.
  6. Always allow license.purchase up to €40, €300 a month, for helpdesk-agentOne seat of a standard app goes through at once, until €300 of seats have been approved by rule this month. A larger purchase waits for a person.
  7. Never allow license.purchase above €2,000A purchase that size goes through procurement. One that states no amount in euros is refused too.
  8. Always ask about device.wipe, two people, for the service desk lead and securityA wipe cannot be undone. Locking a lost laptop is quick and reversible, so the agent can ask to lock it first, which one person approves, while two people look at the wipe.
  9. Never allow user.deleteOffboarding disables. Deleting is done later, by a person, after the retention period and any legal hold.
  10. Never allow mailbox.forward_externalForwarding a mailbox outside the company is how mail gets stolen quietly. No ticket justifies an agent setting it up.
  11. Never allow policy.*Conditional access, MFA policy and firewall changes go through change management, written and reviewed by people.
The same rules as API bodies
# POST /v1/workspaces/{workspace_id}/rules, one call per rule
{
  "action": "ticket.*",
  "agent_key_id": "HELPDESK_AGENT_KEY_ID",
  "effect": "allow"
}

{
  "action": "identity.*",
  "deciders": [
    "USER_ID_OF_SERVICE_DESK_LEAD",
    "USER_ID_OF_IDENTITY_ENGINEER"
  ],
  "effect": "ask",
  "escalate_after_seconds": 900
}

{
  "action": "identity.admin.*",
  "effect": "deny"
}

{
  "action": "access.group.add_temporary",
  "deciders": [
    "USER_ID_OF_SERVICE_DESK_LEAD"
  ],
  "effect": "ask"
}

{
  "action": "access.admin_role.*",
  "approvals": 2,
  "deciders": [
    "USER_ID_OF_IDENTITY_LEAD",
    "USER_ID_OF_SECURITY_LEAD"
  ],
  "effect": "ask"
}

{
  "action": "license.purchase",
  "agent_key_id": "HELPDESK_AGENT_KEY_ID",
  "budget_amount": "300.00",
  "budget_currency": "EUR",
  "budget_period": "month",
  "effect": "allow",
  "limit_amount": "40.00",
  "limit_currency": "EUR"
}

{
  "action": "license.purchase",
  "effect": "deny",
  "limit_amount": "2000.00",
  "limit_currency": "EUR"
}

{
  "action": "device.wipe",
  "approvals": 2,
  "deciders": [
    "USER_ID_OF_SERVICE_DESK_LEAD",
    "USER_ID_OF_SECURITY_LEAD"
  ],
  "effect": "ask"
}

{
  "action": "user.delete",
  "effect": "deny"
}

{
  "action": "mailbox.forward_external",
  "effect": "deny"
}

{
  "action": "policy.*",
  "effect": "deny"
}

Owners write rules under Rules in the app, or post these bodies while signed in. Replace the ids in capitals with your own.

When rules disagree the most cautious wins, so identity.admin.* is refused even though identity.* asks. Amount limits only work in the cautious direction: a licence stated in another currency, or with no amount, is not allowed by the €40 rule and is refused by the €2,000 one. Writing rules needs Pro, two-person approval needs Team, and routing and escalation need Business. The approval policy generator writes a first set from a checklist, and the rules reference has every option.

Who approves what

  • Resets: the service desk lead or an identity engineer, who can see the verification record. The manager confirms identity; they do not approve the reset.
  • Group access: the service desk lead, with the group’s owner and the end time in the request. A group that opens sensitive data deserves its own action name and a rule routed to its owner.
  • Admin roles and wipes: two different people, from the leads the rule names (security among them) or the workspace owners. Intune can require a second administrator for a wipe as well; see two-person approval.
  • Offboarding: started from the HR system, never from a ticket that says someone left. Disable first. Entra keeps a deleted user restorable for 30 days and Okta requires deactivation before a delete, which cannot be undone; the delete stays with a person after any legal hold.
  • Mailboxes: delegation asks, with the mailbox owner’s agreement recorded in the ticket. Forwarding outside the company is refused: MITRE ATT&CK lists forwarding rules as a way attackers collect mail (T1114.003).

If an agent starts going wrong, any member can pause every agent from the inbox. While paused nothing is allowed, whatever was approved, and only an owner can resume. A pause does not undo a reset already made: revoke sessions in the directory.

Checklist

  1. List every tool the service desk agent can call.
  2. Mark each: reads only, hands over an account, grants access, spends, destroys data, or changes policy.
  3. Give the agent its own app identity with the smallest role and scopes; never Privileged Authentication Administrator or Super Administrator.
  4. Make resets read a verification a person recorded outside the chat; refuse admin accounts in code.
  5. Make every risky tool ask, act only on allowed: true, and re-read the account before acting.
  6. Give every grant an end time, and book its removal first.
  7. Deny admin resets, deletes, external forwarding and policy changes.
  8. Two people for admin roles and wipes.
  9. Review grants, resets and who approved them every month.

Try a request in the playground before wiring anything up. The wider set of controls is in guardrails for AI agents.

Sources

  1. CISA and FBI: Advisory AA23-320A, Scattered Spider (16 November 2023, revised 29 July 2025)
  2. Okta Security: Cross-Tenant Impersonation, Prevention and Detection (31 August 2023)
  3. TechCrunch: Hackers claim MGM cyberattack as outage drags into fourth day (14 September 2023)
  4. MGM Resorts International: Form 8-K (5 October 2023)
  5. NIST SP 800-63B-4, Authentication and Authenticator Management (July 2025), section 4.2: account recovery
  6. AICPA: 2017 Trust Services Criteria (with revised points of focus, 2022), CC6.2 and CC6.3
  7. ISO/IEC 27001:2022, Annex A control 5.18: access rights
  8. Microsoft Learn: Privileged roles and permissions in Microsoft Entra ID (who can reset passwords and authentication methods)
  9. Microsoft Learn: Overview of Microsoft Graph permissions (delegated and application permissions)
  10. Okta Developer: Implement OAuth 2.0 for Okta with a service app (scoped tokens and admin roles)
  11. Okta Developer: OAuth 2.0 scopes for the Okta Admin Management API
  12. Okta Help: Standard administrator roles and permissions
  13. Microsoft Learn: Wipe devices with Microsoft Intune (and multiple administrative approval)
  14. Microsoft Learn: Restore or permanently remove a recently deleted user
  15. Okta Help: Deactivate and delete user accounts
  16. MITRE ATT&CK: T1114.003, Email Collection: Email Forwarding Rule

Try it without signing up

It opens in your browser with this case filled in. Nothing is sent anywhere.

Give your agents somewhere to ask.

Free for 100 requests a month. Sign in with your email and have a first request waiting a few minutes from now.

Start free