Privileged access management (PAM) usually begins with an inventory, and the inventory is rarely pleasant. There’s the admin password half the platform team knows, a DBA account someone created for a migration and never removed, and somewhere a cloud key pasted into a CI job that still works. Any of them works for whoever holds it, at any hour. When one gets used, the database log records the account name and nothing about the person.
What does privileged access management do?
Privileged access management (PAM) controls who can use privileged access, when, and what they can do with it, and it records every privileged session for audit. PAM in cybersecurity applies to people, such as admins, DBAs and SREs, and to non-human identities, such as service accounts, CI pipelines and AI agents, whenever they can change a system or read sensitive data.
NIST defines a privileged user as a user that is authorized, and therefore trusted, to perform security-relevant functions that ordinary users are not authorized to perform. A privileged account is a system account with the authorizations of a privileged user.
Those definitions describe accounts. The work happens at the moment of use. For each privileged action, you should be able to say who did it, why they had access at that hour, what they were allowed to run and what they actually ran. A team that reaches production through one shared login can’t answer the first, and without it the other three don’t mean much.
Types of privileged access
Ask who has privileged access and you’ll usually get a list of people with “admin” in their title. The accounts with the most reach are often the ones nobody thinks of as users: the application’s own database login, the token a deploy pipeline uses, the coding agent with a connection string in its environment.
A more useful test is what the access can do. If it can change a system’s configuration, get around its normal controls or read data that ordinary users can’t, it’s privileged. On a typical infrastructure team that includes:
- root and sudo on Linux hosts, and local Administrator on Windows servers
- database logins that can read customer tables, alter schemas or delete rows, including the ones kept around for production debugging
- broad cloud IAM roles, Kubernetes
cluster-adminand network device admin accounts - service accounts, API keys and CI/CD tokens, which tend to hold broad access and get reviewed less often than people
- break-glass accounts
- AI agents and scripts that run SQL, shell commands or API calls with real credentials
Break-glass accounts skip approval by design. Keep them anyway: a PAM program that removes the emergency path gets bypassed the first night production is down. Alert on every use and review each one afterwards.
How does privileged access management work?
Every PAM tool places a control point between privileged identities and the systems they reach. That point can be a password vault, an agent installed on each host, or a proxy that every privileged connection passes through. Whatever the architecture, privileged access management applies the same controls there: it brokers the credential, grants access just in time, limits what a session can run, and records each session against a named person.
Credential vaulting and brokering
Moving the admin password into a vault is usually the first step, and on its own it changes less than it seems. If engineers check the password out, it can end up in a shell history or a local config file, and it stays valid until someone rotates it. With brokering, the PAM system authenticates the person and then supplies the credential to the upstream connection itself. Nobody sees it. Rotating it doesn’t mean telling anyone, and someone leaving the company doesn’t leave with a working password. If a tool offers both checkout and brokering, broker.
Just-in-time access instead of standing privileges
An on-call engineer might need write access to the production database twice a quarter. A standing grant hands it over for every hour in between, to them and to anyone who steals their laptop. Just-in-time (JIT) access fixes the timing. It grants the privilege for one task and a limited time, usually after someone approves, and removes it automatically; pushed to the end state, where no person or agent holds standing privileges on a sensitive system, it becomes zero standing privileges (ZSP).
Least privilege on each action
The account an engineer connects as can almost always do more than the task needs. A database login that can run a SELECT can also run DROP TABLE, and approving the session approves both. Least privilege, restricting access to the minimum the task requires, has to be enforced below the login for privileged sessions: read-only by default, destructive statements blocked, sensitive columns masked. That only works if the control point parses the protocol. One of the example policies in Formal’s docs blocks INSERT, UPDATE, DELETE and DROP on any resource whose environment is production, and the client gets the reason back (“Write operations not allowed in production”) instead of a dropped connection.
Session recording and audit
Six weeks after a customer record changed, someone will ask who changed it, in which session, with which statement. The answer has to be captured at the time: the named person behind the session, the full query or command, and enough structure to search across thousands of sessions. For SSH, a replayable session recording helps. For databases, the statement log is the record. Live monitoring adds the option of ending a session while it’s still running.
Audit also looks backwards at grants. On a fixed schedule, compare who holds privileged access with who used it, and remove what went unused.
Vault, host agent or proxy
The architecture decides what a PAM tool can see. A vault controls the credential and has no view of the connection once it’s open. An agent on each host sees what happens on that host, at the cost of installing and updating it everywhere. A proxy in the connection path sees every query and command, so it can act on them, but only for protocols it understands; for anything else it’s back to controlling the connection.
For databases and Kubernetes, where a single statement does the damage, we’d put a proxy in the path. Formal is built that way, so weigh the opinion accordingly.
Why is PAM security important?
An attacker who phishes one engineer gets whatever that engineer’s laptop can reach, and if the laptop holds a standing production credential, that includes the production database. PAM security is important because it shrinks that reach. With no standing privileged access, a stolen laptop or a leaked token carries nothing live, and the privileged actions that do happen are each tied to a named person and recorded.
The same controls change what an incident looks like afterwards. With shared accounts, the honest answer to “who ran this?” is “someone on the team”. With per-person sessions and statement logs, scoping an incident is a search, and you can tell a customer which queries touched their data.
Auditors ask for that evidence too. NIST SP 800-53 control AC-6 (Least Privilege) has enhancements to restrict privileged accounts (AC-6(5)), review user privileges (AC-6(7)) and log the use of privileged functions (AC-6(9)).
PAM vs IAM
The question usually comes up as “is this product PAM or IAM?”, and the answer is often both. Identity and access management (IAM) covers every identity: accounts, single sign-on, MFA, roles and provisioning. Privileged access management covers the small share of that access that can do real damage, and adds controls at the moment of use that IAM doesn’t apply, such as brokered credentials, time-bound approval, statement-level policy and session recording.
| IAM | PAM | |
|---|---|---|
| Scope | Every user and application | Privileged users, privileged accounts and non-human identities |
| Main question | Who are you, and which apps and roles can you use? | Should you have this access right now, and what are you doing with it? |
| Typical controls | SSO, MFA, provisioning, role-based access | Credential brokering, JIT access, session recording, command and query controls |
| Access model | Mostly standing role assignments | Time-bound, approved, revoked automatically |
| Audit focus | Who holds which account or role | What each privileged session did |
Many identity platforms ship some PAM features, and PAM tools rely on an identity provider, which is why product classification rarely comes out clean. The division of labor is clearer: the identity provider settles who the person is, and the PAM layer takes that identity and decides whether this person should be on this database, running this statement, right now.
PAM vs PIM
PIM is best known as the name of a Microsoft Entra feature. Privileged identity management (PIM) governs which identities hold privileged roles: who is eligible, who can activate a role, for how long and with whose approval. In PAM vs PIM, the difference is what happens after activation. PAM also governs the session the role opens, with brokered credentials, command and query controls, and recording.
Where the access lives decides which one you need. When most of it is Entra-managed, PIM already handles much of the approval step, and the FAQ below says exactly where its documented scope ends. A self-managed Postgres server, or a Linux box people reach over SSH, has nothing to activate in Entra, so the approval and the session controls have to sit in the connection path.
Privileged access vs privileged account management
After a production table gets dropped, an inventory of privileged accounts tells you who could have done it. A record of privileged access tells you who did, in which session, with which statement.
That is most of the difference between the two terms. Privileged account management deals with the accounts: finding each one, vaulting and rotating its credentials, deleting the ones nobody uses. Privileged access management includes that work and governs each use as well, meaning who gets access, for how long, what they can run and what gets recorded. Vendors and analysts often treat the two as one, and both shorten to PAM.
Privileged access management for AI agents
The quickest way to let a coding agent query production is to put a database password in its environment. Many teams start there. From then on, every agent session holds standing access, the database sees one shared login, and nobody can say which person asked for which query. Agents also read untrusted content all day, so instructions hidden in a ticket or a web page (prompt injection) can steer what they run; agentic AI security maps those risks across every tool an agent uses.
The PAM controls carry over, with one change: the agent acts for someone. So each session needs two identities. The agent’s own should expire, like an OIDC token issued by its platform, instead of being a static secret (AI agent identity goes deeper), and the other is the person who started it, so a policy can check both. Access stays blocked until someone approves a specific task, then expires on its own. Approval doesn’t switch off the other rules: the agent’s queries still go through the read-only and masking policies a human’s would.
We document this end to end for Devin, a cloud coding agent, in a step-by-step guide. Devin’s OIDC token maps to a devin machine user, and the token’s requesting-user claim maps to the person who started the session. A policy blocks that machine user outright. The first query fails with “Devin is blocked by default; request JIT access”, so Devin triggers a workflow with a reason and a duration, which sends the person who started the session a Slack message asking them to approve.
On a yes, the workflow creates a time-bound suspension of the block. Its condition matches that person’s email and that Devin session ID, both read from verified token claims. The reason and duration come from Devin’s request and are shown to the approver, but they never go into the condition, because Devin controls the request and could inject into it. A second machine user runs the workflow, so Devin can’t create its own suspension, and a new Devin session needs a new approval.
How to implement privileged access management
Start where a stolen credential would hurt most: the production databases, hosts and cloud accounts that hold customer data, and the shared logins that reach them (database security covers the controls around the database beyond access). After that, the order of the steps matters more than the tooling. Access can’t be time-bound or reviewed per person until each session belongs to a person, and that can’t happen while people share a password.
- List every database, host, cluster, cloud role, service account and agent that holds privileged credentials, and who uses each one.
- Move shared passwords and keys into a broker, so people and agents sign in as themselves and never handle the upstream secret.
- Authenticate every session through your identity provider, including agents acting for someone.
- Replace standing production access with access that is time-bound and approved.
- Inside the session, default to read-only, block destructive statements and mask sensitive fields.
- Keep session logs, alert on risky activity, and review who holds privileged access on a schedule.
Application service accounts don’t fit step 4. The application can’t wait for a Slack approval, so its database login stays standing. Scope that login to what the application actually runs, keep it out of human hands, and alert on queries the application never sends.
How Formal handles privileged access management
We built Formal PAM on the Formal Connector, a protocol-aware reverse proxy that sits between users and protected resources such as Postgres, MySQL, Snowflake, MongoDB, SSH servers and Kubernetes clusters (Connector docs). Nobody signs in as a shared account: each engineer or agent authenticates as themselves and keeps using psql, ssh or kubectl. Upstream, the Connector signs in as a Native User: a password, SSH key, cloud IAM role or kubeconfig that only the Connector holds. An engineer can ask for a different upstream account by label, and a policy can refuse a label that isn’t assigned to them.
Policies written in Rego can block, mask, filter or rewrite requests and responses. Every session is logged; SSH and kubectl exec sessions are also recorded and given a risk score from 1 to 5, and an active session can be terminated from the Sessions page. Just-in-time access is a time-bound policy suspension of a default block, created by a Slack approval, an access request or the API.
One limit: Formal doesn’t document automatic rotation of upstream passwords. You update a Native User’s credentials yourself, or use a hook that fetches them from your secrets manager at connection time.
At Cursor, engineers hold no permanent production permissions. When an operational task needs production, they request just-in-time access for it.
If you’re comparing PAM tools, start with the best PAM solutions, ten tools on one set of criteria, then the one-to-one pages on CyberArk alternatives, Teleport, StrongDM and BeyondTrust. We wrote them, so read them as our view of the market.