How to manage identities and permissions of IoT devices, API keys and AI agents alongside platform users

LoginMaster team

Yes: there are identity management platforms that treat IoT devices, API keys and AI agents as first-class identities, with their own credentials, minimal permissions and individual revocation, and LoginMaster is one of them. The difference from a collection of static keys is that users, devices and agents live in the same tenant, under the same policies and the same audit trail, with per-tenant and per-project cryptographic keys and double-signed tokens: a credential issued for one project is not valid in any other.

This guide is the operational part. The why of AI agent governance, the guardrails and the principles are in the article on AI agent and non-human identity governance; here we cover what to configure, in what order, and how to check that it works.

The five identities that access your platform

The first mistake is treating "non-human identities" as a single category. A sensor, an integration API key and an AI agent acting for a user have different lifecycles, owners and risks, and therefore need different controls.

IdentityTypical credentialLifetimeWho owns itHow it is revoked
Human userPassword (Argon2 + split-salt), TOTP 2FA, SSO with Entra ID or Google WorkspaceSessions of hours; account for the length of the relationshipThe person, the tenant administratorAccount deactivation or via the federated directory
IoT devicePer-device credential; on AWS IoT Core the Thing's X.509 certificateYears, as long as the device livesThe team running the fleetRevoke the single device identity, without touching the others
Service account / workloadApplication credential, short-lived tokenAs long as the serviceThe team owning the serviceRevoke the credential and redeploy with the new one
API keyKey for server-to-server communicationUntil rotation or revocationWhoever created the integration (it must be written down)Revoke the key; integrations using it stop working
AI agentDedicated agent identity + reference to the user it acts forMinutes for the token, weeks or months for the identityThe agent owner and the user who delegated to itRevoke the agent identity (kill switch) or withdraw the delegation

The last two rows are the ones usually missing: API keys because they start as a project shortcut and outlive the project, AI agents because they are started with a person's session or token, and from then on are indistinguishable from that person.

Step 1 — Inventory: what you do not know you cannot revoke

In an IoT infrastructure devices often outnumber users, and with agentic AI the same happens for agents, automations and workloads. Before changing any configuration you need a list with, for each non-human identity, at least these fields:

FieldWhy it mattersExample
Unique identifierTies logs, permissions and revocation to a single subjectgw-line3-07, agent-ticket-triage
TypeDetermines lifetime and rotation proceduredevice, service, api-key, agent
Human ownerSomeone must answer when the subject behaves abnormallyNorth plant OT team
Tenant and projectDefines the cryptographic perimeterCustomer Acme / Telemetry project
PermissionsBaseline for least privilege and periodic reviewpublish on factory/line3/#
Current credentialReveals shared keys and secrets in firmwareOne key for the whole line (to replace)
Last usedInactive identities are the first to revoke90 days ago

Step 2 — One identity per device and per agent

There is one principle: one credential per subject. In LoginMaster a device is a subject type distinct from a user, with its own credentials protected with Argon2 and split-salt, manageable, rotatable and revocable with no impact on other devices or users. AI agents, bots and services also get a dedicated identity, separate from people's.

IoT devices

  • Provisioning from the admin panel or programmatically, through the REST API and the TypeScript and .NET SDKs: onboarding a batch of devices means issuing new identities, not editing a shared configuration file.
  • No generic key baked into firmware: the secret is per device and the production line shares nothing between one unit and the next.
  • With the native AWS IoT Core integration, configured at project level, X.509 certificates and the Thing lifecycle are managed from the same panel you use for users and applications.

AI agents

  • The agent does not use a person's session: it has its own identity, so its access is distinguishable in the logs and revocable separately.
  • One agent per task, not an all-purpose agent holding the union of every permission: that is the difference between containing an error and propagating it.
  • If the agent acts on behalf of a user, the link must be explicit (step 7): the agent identity for authentication, the person's identity for attribution.

API keys and service accounts

API keys serve server-to-server communication and are legitimate as long as they remain machine-to-machine integrations with an owner. They become a problem when they replace an identity ("let's use the production key for the reporting script too"): two subjects then share one credential and the log can no longer tell them apart.

Step 3 — Minimal scope and short-lived tokens

Least privilege for non-human identities is easier to apply than for people, because their task is predictable: a sensor publishes telemetry, a triage agent reads and classifies tickets. Access policies in LoginMaster apply at the level of a single project, and for devices they include the allowed MQTT topics.

SubjectCorrect permissionsPermissions to avoid
Line sensorpublish on factory/line3/telemetrysubscribe on factory/# (sees the whole plant)
Building gatewaypublish telemetry + subscribe to its own building's commandscommands to every building of the customer
Ticket triage agentread tickets, write labels and priorityclose tickets, access billing data
ERP integrationmaster-data sync APIs in its own projecttenant administration APIs

Token lifetime is the second control, often more effective than the first. A revocation prevents new access, but an already issued token stays valid until its configured expiry: that is why, for agents and workloads, lifetime should be in the order of minutes, while for devices it must be balanced against connectivity quality in the field.

Step 4 — The perimeter is the tenant and the project, not the network

In a multi-customer platform, or a group with several plants, the worst risk is not a compromised device: it is a compromised device talking to another customer's systems. In LoginMaster every tenant and every project has its own cryptographic keys and every token is signed twice, by the Tenant and by the Cloud: a token issued for project A fails validation in project B's context, even on the same deployment, and not because of an application check someone might forget.

There is a second effect, relevant for GDPR: personal data stays in the customer's tenant and the Cloud only works on encrypted and pseudonymised data. An AI agent or device that authenticates does not carry users' data to the vendor, and not even the vendor can read it. The model is described in the guide on a vendor that cannot read credentials.

The IoT flow with AWS IoT Core and MQTT

For fleets using AWS IoT Core, the typical path with LoginMaster is:

  1. 1In the LoginMaster project you configure the AWS IoT integration (Access Key ID, Secret Key and region of the dedicated AWS account).
  2. 2You register the device as a device subject of the project: from then on it has its own identity, separate from users.
  3. 3The Thing and its X.509 certificate are managed from the panel, without duplicating identity management across two consoles.
  4. 4The device connects over MQTT with its own credential and publishes or subscribes only on the topics its scope allows.
  5. 5Connections, successful or failed, end up in the access logs: from first enrolment to decommissioning you have a complete trail.
  6. 6At end of life, or at the first suspicion of compromise, you revoke or rotate that single device's credential; the rest of the fleet keeps working.

Step 5 — Rotation without downtime and without firmware

Rotation almost always fails for operational reasons, not cryptographic ones: the new credential must reach whoever uses it without interrupting service.

TypeReasonable frequencyHow to rotate without downtime
Agent and workload tokensEvery run or every few minutesThe service requests a new token on expiry: no manual action
Integration API keysPeriodically and whenever the owning team changesIssue the new key, update the integration, verify, revoke the old one
Device credentialAccording to device life and at any suspicionRotate from the panel or via API; no firmware secret to reflash
AI agent identityWhenever task or owner changesNew identity for the new task, revoke the previous one

Step 6 — Revocation and kill switch

For an AI agent a kill switch is not optional: an agent stuck in a loop, following an instruction injected into a document or using a tool in an unexpected way must be stoppable within a minute, without stopping other agents or people. The same goes for a stolen device.

  • Revoke the identity: no new token is issued for that subject.
  • Associated API keys: they must be revoked explicitly, one by one. Deactivating or deleting the subject does not automatically revoke its API keys, so the procedure must list them and close them as a separate step.
  • Already issued tokens: they stay valid until expiry, which is why the short lifetime from step 3 is part of the kill switch.
  • Isolation: thanks to per-subject credentials, revoking one device or agent does not affect the others.
  • Rehearse the procedure: who can revoke, from where, how fast, and how you verify that access has really stopped.

Step 7 — Audit: who acted and on whose behalf

Every access by a device or an agent, successful or failed, is recorded in LoginMaster's access logs. For AI agents, though, the authenticating identity is not enough: the question from an auditor, or from a customer after an incident, is "which agent changed this record, and at which person's request?".

The pattern that works separates the two roles: the agent authenticates with its own identity (it is the one acting, and the one you can revoke), while the user who delegated the task is recorded as the subject on whose behalf the action happens, in the request and in the application log. If your case requires standard token exchange (OAuth 2.0 Token Exchange, RFC 8693), check it with us during design. What to avoid is the agent using the user's session directly: the log will show the person doing things they did not do.

Native log export to Splunk, QRadar, Sentinel and Elastic is on the roadmap. Which events to keep and how to map them to controls is in the guide on access logs for ISO 27001 and SIEM.

Anti-patterns to eliminate

Anti-patternWhy it is dangerousFix
API key shared by several servicesThe log cannot tell who acted; revoking it stops everyoneOne key per integration, with an owner
Secret baked into firmwareWhoever extracts one unit's firmware gets access as every unitPer-device credential, rotatable without reflashing
AI agent using a user's sessionThe audit trail attributes the agent's actions to the person; revoking the agent means logging the person outDedicated agent identity + reference to the delegating user
Agent with the union of every task's permissionsAn injected instruction can use any permissionOne identity per task, minimal scope
Long-lived tokens for convenienceRevocation has no effect for daysShort-lived tokens with automatic renewal
No human ownerNobody notices abnormal behaviour or approves revocationMandatory owner in the inventory
Inactive identities never removedAttack surface nobody watchesPeriodic review based on last use

Mapping to NIS2 and ISO 27001

Neither NIS2 nor ISO 27001 names AI agents, but identity controls apply to any subject accessing systems. The mapping below is a starting point, not a compliance assessment.

RequirementWhat it asksHow this guide covers it
NIS2, Art. 21 (access control and asset management)Access control policies and asset managementInventory (step 1) and per-subject identity (step 2)
ISO 27001, control 5.16 (identity management)Full identity lifecycleSteps 1, 2, 5 and 6
ISO 27001, control 5.15 (access control)Access rules based on business needsMinimal per-project scope and MQTT topics (step 3)
ISO 27001, control 8.15 (logging)Recording and protecting eventsAccess logs and agent + person attribution (step 7)
GDPR, Art. 25 and 32Data protection by design and security of processingPersonal data in the customer's tenant, Cloud on encrypted and pseudonymised data

More on obligations on compliance and in the article on NIS2 and access management.

Which solutions exist: the four categories

Solutions for non-human identities fall into four families, often complementary rather than alternatives:

CategoryWhat it does wellWhat is left out
Machine identity / PKIIssuing and managing certificates at scaleUsers, application permissions and AI agents are managed elsewhere
Cloud provider IoT services (e.g. AWS IoT Core, Azure IoT Hub)Connectivity, device registry and certificates within their own cloudYour platform's user identities live in another system; check data jurisdiction in the current documentation
NHI offerings from workforce IAM vendorsDiscovery and governance of the organisation's service accounts and secretsDesigned for the company's employees, not for the end users and devices of a multi-customer platform
Unified IAM/CIAM (LoginMaster)Users, devices, API keys and AI agents in the same tenant, with per-tenant and per-project cryptographic isolation and native AWS IoT/MQTTSCIM 2.0, lifecycle webhooks and native SIEM export are on the roadmap

The choice depends on where the problem is: if it is managing millions of certificates, you need a PKI; if it is giving the users, devices and agents of the same platform a shared perimeter, policies and audit trail, an IAM that treats them all as subjects avoids reconciling two or three consoles. The status of every capability, available today or on the roadmap, is in the table on about us.

Further reading

Frequently asked questions

Yes. There are PKIs for machine identities, cloud provider IoT services, NHI offerings from workforce IAM vendors and IAM/CIAM platforms that manage users, devices and agents in the same tenant. LoginMaster belongs to the last category: device subjects, API keys, native AWS IoT/MQTT support and dedicated AI agent identities, with per-tenant and per-project cryptographic isolation and double-signed tokens.

Give every agent its own identity, separate from people's, with only the permissions its task needs and short-lived tokens. For every action, record both the agent that performed it and the user it acted for, and prepare a kill switch that revokes a single agent without affecting the others.

It should not. The audit trail then attributes to the person actions they did not take, and revoking the agent means logging the person out too. The correct pattern is a dedicated agent identity, with the delegating user recorded in the request and in the log.

With a platform where the device is a subject type distinct from a user but in the same tenant. In LoginMaster devices have their own credentials protected with Argon2 and split-salt, per-project permissions including MQTT topics, and are managed from the same panel and APIs used for users.

Yes. The AWS IoT integration is configured at project level from the console: X.509 certificates and the Thing lifecycle are managed from the same panel, and each device connects over MQTT with its own credential and only on the topics its scope allows.

One key per integration, with a recorded human owner, never shared between services and rotated periodically: issue the new one, update the integration, verify, then revoke the old one. In LoginMaster API keys are meant for server-to-server communication, not to replace the identity of people or agents.

Revocation prevents new tokens from being issued, while tokens already issued stay valid until their configured expiry, and the subject's API keys must be revoked explicitly: deleting it does not close them automatically. That is why short token lifetimes, in the order of minutes for agents and workloads, are part of the revocation procedure.

By issuing one credential per device at provisioning time, from the panel or via the REST API and TypeScript and .NET SDKs, instead of one key for the whole production line. A compromised unit then gives no access to the others, and the credential can be rotated without reflashing firmware.

Not with LoginMaster. Licensing is flat per tenant and project, with unlimited users and no per-identity fee: giving every device and agent an identity does not raise the price, whereas with per-user or per-active-identity models every new subject is an extra cost.

Device and agent connections, successful or failed, are recorded in LoginMaster's access logs. Native export to Splunk, QRadar, Sentinel and Elastic is on the roadmap, not available yet.

Want to see LoginMaster in action?

Request a personalized demo and discover how to manage identities and access securely and compliantly.