IAM interview questions · IAM architectures
Machine identities and AI agents
The interview question“How do you manage service accounts, workloads and AI agents?”
In plain wordsRobots in the building get badges too: each with an owner, only the rooms they need, keys that expire quickly, and a camera on them.
Scenario 1 of 6
Non-human identities, managed like people
In plain words Agents, pipelines and services also need a badge, an owner, limited rights and someone watching.
Technical details
Machine identities outnumber humans. Each one needs an inventory entry, an owner, the minimum scopes, short-lived credentials and monitoring, just like a workforce identity.
Scenario 2 of 6
Laura asks the agent to handle a ticket
In plain words The agent works for Laura, but with its own badge and only the rights that task needs.
Technical details
Delegation via OAuth: the agent gets a token through token exchange with sub=laura and act=support-agent, audience = the MCP server, scopes tickets:read refunds:create. Tools validate the token like any API.
Scenario 3 of 6
A risky action needs a human yes
In plain words A ticket asks for a 5,000 euro refund. Above 50 euros the agent must stop and ask a person.
Technical details
Limits in scopes and policy, plus human-in-the-loop approval (for example CIBA-style back-channel confirmation) for high-impact actions. This is the main defence against prompt injection: the model can be fooled, the policy cannot.
Scenario 4 of 6
The pipeline deploys to production
In plain words The pipeline borrows a key that expires in minutes, instead of a password saved in the code.
Technical details
Dynamic secrets from a vault, issued per job, revoked after. No long-lived keys in repositories or CI variables; secret scanning as a safety net.
Scenario 5 of 6
A service with no secret at all
In plain words The service proves where it runs, and the cloud gives it a short ticket. Nothing to steal.
Technical details
Workload identity federation: the platform signs a token for the pod or function (OIDC, SPIFFE), the cloud trusts that issuer and returns short-lived credentials.
Scenario 6 of 6
Something goes wrong: switch it off
In plain words Every action is logged with both names, Laura and the agent. If it misbehaves, one click revokes its badge.
Technical details
Audit logs with subject and actor, anomaly detection on agent behaviour, and a kill switch: disable the client and revoke its tokens at the authorization server.
How it works
Inventory every non-human identity with an owner and a purpose. Replace static secrets with short-lived credentials: dynamic secrets from a vault for pipelines, workload identity federation for services in the cloud.
AI agents get their own identity, act for users through delegation (token exchange, sub + act), with narrow scopes and human approval for high-impact actions. Log both identities and keep a kill switch.
A concrete example
A support team adds an AI agent: it reads tickets for the operator, can refund up to 50 euros, above that asks a human; its token says sub=laura, act=support-agent. The deploy pipeline uses 15-minute cloud credentials, and no API key lives in the repository.
Mistakes to avoid
- Giving the agent a user’s password or a permanent admin API key.
- Service accounts with no owner and no expiry.
They may also ask you
- How do you find all the service accounts you already have?
- How do you defend against prompt injection?