How to manage identities and permissions of IoT devices, API keys and AI agents alongside platform users
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.
| Identity | Typical credential | Lifetime | Who owns it | How it is revoked |
|---|---|---|---|---|
| Human user | Password (Argon2 + split-salt), TOTP 2FA, SSO with Entra ID or Google Workspace | Sessions of hours; account for the length of the relationship | The person, the tenant administrator | Account deactivation or via the federated directory |
| IoT device | Per-device credential; on AWS IoT Core the Thing's X.509 certificate | Years, as long as the device lives | The team running the fleet | Revoke the single device identity, without touching the others |
| Service account / workload | Application credential, short-lived token | As long as the service | The team owning the service | Revoke the credential and redeploy with the new one |
| API key | Key for server-to-server communication | Until rotation or revocation | Whoever created the integration (it must be written down) | Revoke the key; integrations using it stop working |
| AI agent | Dedicated agent identity + reference to the user it acts for | Minutes for the token, weeks or months for the identity | The agent owner and the user who delegated to it | Revoke 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:
| Field | Why it matters | Example |
|---|---|---|
| Unique identifier | Ties logs, permissions and revocation to a single subject | gw-line3-07, agent-ticket-triage |
| Type | Determines lifetime and rotation procedure | device, service, api-key, agent |
| Human owner | Someone must answer when the subject behaves abnormally | North plant OT team |
| Tenant and project | Defines the cryptographic perimeter | Customer Acme / Telemetry project |
| Permissions | Baseline for least privilege and periodic review | publish on factory/line3/# |
| Current credential | Reveals shared keys and secrets in firmware | One key for the whole line (to replace) |
| Last used | Inactive identities are the first to revoke | 90 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.
| Subject | Correct permissions | Permissions to avoid |
|---|---|---|
| Line sensor | publish on factory/line3/telemetry | subscribe on factory/# (sees the whole plant) |
| Building gateway | publish telemetry + subscribe to its own building's commands | commands to every building of the customer |
| Ticket triage agent | read tickets, write labels and priority | close tickets, access billing data |
| ERP integration | master-data sync APIs in its own project | tenant 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:
- 1In the LoginMaster project you configure the AWS IoT integration (Access Key ID, Secret Key and region of the dedicated AWS account).
- 2You register the device as a device subject of the project: from then on it has its own identity, separate from users.
- 3The Thing and its X.509 certificate are managed from the panel, without duplicating identity management across two consoles.
- 4The device connects over MQTT with its own credential and publishes or subscribes only on the topics its scope allows.
- 5Connections, successful or failed, end up in the access logs: from first enrolment to decommissioning you have a complete trail.
- 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.
| Type | Reasonable frequency | How to rotate without downtime |
|---|---|---|
| Agent and workload tokens | Every run or every few minutes | The service requests a new token on expiry: no manual action |
| Integration API keys | Periodically and whenever the owning team changes | Issue the new key, update the integration, verify, revoke the old one |
| Device credential | According to device life and at any suspicion | Rotate from the panel or via API; no firmware secret to reflash |
| AI agent identity | Whenever task or owner changes | New 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-pattern | Why it is dangerous | Fix |
|---|---|---|
| API key shared by several services | The log cannot tell who acted; revoking it stops everyone | One key per integration, with an owner |
| Secret baked into firmware | Whoever extracts one unit's firmware gets access as every unit | Per-device credential, rotatable without reflashing |
| AI agent using a user's session | The audit trail attributes the agent's actions to the person; revoking the agent means logging the person out | Dedicated agent identity + reference to the delegating user |
| Agent with the union of every task's permissions | An injected instruction can use any permission | One identity per task, minimal scope |
| Long-lived tokens for convenience | Revocation has no effect for days | Short-lived tokens with automatic renewal |
| No human owner | Nobody notices abnormal behaviour or approves revocation | Mandatory owner in the inventory |
| Inactive identities never removed | Attack surface nobody watches | Periodic 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.
| Requirement | What it asks | How this guide covers it |
|---|---|---|
| NIS2, Art. 21 (access control and asset management) | Access control policies and asset management | Inventory (step 1) and per-subject identity (step 2) |
| ISO 27001, control 5.16 (identity management) | Full identity lifecycle | Steps 1, 2, 5 and 6 |
| ISO 27001, control 5.15 (access control) | Access rules based on business needs | Minimal per-project scope and MQTT topics (step 3) |
| ISO 27001, control 8.15 (logging) | Recording and protecting events | Access logs and agent + person attribution (step 7) |
| GDPR, Art. 25 and 32 | Data protection by design and security of processing | Personal 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:
| Category | What it does well | What is left out |
|---|---|---|
| Machine identity / PKI | Issuing and managing certificates at scale | Users, 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 cloud | Your platform's user identities live in another system; check data jurisdiction in the current documentation |
| NHI offerings from workforce IAM vendors | Discovery and governance of the organisation's service accounts and secrets | Designed 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/MQTT | SCIM 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
- IoT device identity — device subjects, AWS IoT/MQTT, industrial use cases.
- AI agent identity — non-human identities, double-signed tokens, least privilege.
- Zero Trust and least privilege starting from identity — the same model applied to people and applications.
- Provisioning and lifecycle and integration via SDKs and REST API.
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.