Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs: pam agents
Sheen Capadnganbeddf144875d
diff --git a/docs/cli/commands/pam-agentic.mdx b/docs/cli/commands/pam-agentic.mdxnew file mode 100644index 0000000000..7fb0e828a4--- /dev/null+++ b/docs/cli/commands/pam-agentic.mdx@@ -0,0 +1,161 @@+---+title: "pam agentic access"+description: "Run an AI agent against your PAM accounts through local, brokered connections"+---++```bash+infisical pam agentic access [flags] -- <agent command>+```++## Description++Open every PAM account the caller can launch as a local connection point, then start your agent. The agent connects to the accounts its task needs; the CLI never connects to an account itself, and no credential reaches the agent.++Claude Code, Codex, and Gemini receive their instructions in their own format. Any other agent, including one you developed, reads them from the file named by `INFISICAL_PAM_CONTEXT_FILE`, which every run exports.++Everything after `--` is the command that starts your agent. The separator is required whenever that command has flags of its own.++```bash+# a coding agent, with every account you can launch+infisical pam agentic access -- claude++# another coding agent, its own flags, two accounts+infisical pam agentic access --account prod/orders-db,prod/bastion -- codex --model gpt-5++# your own agent, unattended, as a machine identity+export INFISICAL_AUTH_METHOD=universal-auth+export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<client-id>+export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<client-secret>++infisical pam agentic access --reason "nightly triage agent" -- python triage_agent.py+```++<Note>+ For the full picture, including what the agent is told, what the sandbox does and does not protect, and how gated accounts behave mid-run, see [AI Agents](/documentation/platform/pam/ai-agents/overview). To open a single account for yourself instead, use [`infisical pam access`](/cli/commands/pam).+</Note>++## Flags++<AccordionGroup>+ <Accordion title="--account">+ Account to expose, as `folder/account`. Repeatable, and also accepts a comma-separated list. Defaults to every account you can launch.++ If you name an account that cannot be used, the command stops and says why.++ ```bash+ # Example+ infisical pam agentic access --account prod/orders-db --account prod/bastion -- claude+ ```+ </Accordion>++ <Accordion title="--duration">+ How long each PAM session may last, capped by the account's template. Supports Go duration format (e.g., `1h`, `30m`, `2h30m`).++ Default value: `1h`++ ```bash+ # Example+ infisical pam agentic access --duration 30m -- claude+ ```+ </Accordion>++ <Accordion title="--reason">+ Reason for access, recorded for audit. There is nobody to prompt here, so an account whose template requires a reason needs this flag.++ ```bash+ # Example+ infisical pam agentic access --reason "investigating INC-4021" -- claude+ ```+ </Accordion>++ <Accordion title="--agent">+ Override agent detection. Accepts `claude`, `codex`, `gemini`, or `generic`. Detection normally comes from the command name, so this is for a wrapper script or an unusual binary name. An agent of your own needs nothing here: it reads `INFISICAL_PAM_CONTEXT_FILE` regardless.++ ```bash+ # Example+ infisical pam agentic access --agent claude -- ./my-claude-wrapper.sh+ ```+ </Accordion>++ <Accordion title="--token">+ Run as a machine identity using an access token you already have. Service tokens are rejected.++ Set `INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN` (or `INFISICAL_TOKEN`) instead of passing the flag, so the token stays out of your shell history and out of process listings.++ ```bash+ # Example+ export INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN=<access-token>+ infisical pam agentic access -- claude+ ```+ </Accordion>++ <Accordion title="--auth-method">+ Authenticate as a machine identity with its own credentials instead of a ready-made `--token`. Accepts `universal-auth`, `kubernetes`, `azure`, `gcp-id-token`, `gcp-iam`, `aws-iam`, `oidc-auth`, `jwt-auth`, and `ldap-auth`.++ Prefer this over `--token` for a long run: the credentials are kept valid for its whole duration.++ Every input has an environment variable, and **secrets should go through the environment rather than a flag**:++ | Input | Flag | Environment variable |+ |---|---|---|+ | Auth method | `--auth-method` | `INFISICAL_AUTH_METHOD` |+ | Client ID | `--client-id` | `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID` |+ | Client secret | `--client-secret` | `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET` |+ | Machine identity ID | `--machine-identity-id` | `INFISICAL_MACHINE_IDENTITY_ID` |+ | Kubernetes token path | `--service-account-token-path` | `INFISICAL_KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH` |+ | GCP IAM key file path | `--service-account-key-file-path` | `INFISICAL_GCP_IAM_SERVICE_ACCOUNT_KEY_FILE_PATH` |+ | JWT (`oidc-auth`, `jwt-auth`) | `--jwt` | `INFISICAL_JWT` |+ | LDAP credentials | `--ldap-username`, `--ldap-password` | `INFISICAL_LDAP_USERNAME`, `INFISICAL_LDAP_PASSWORD` |++ ```bash+ # Example+ export INFISICAL_AUTH_METHOD=kubernetes+ export INFISICAL_MACHINE_IDENTITY_ID=<identity-id>+ infisical pam agentic access -- claude+ ```+ </Accordion>++ <Accordion title="--organization-slug">+ Scope the session to a sub-organization the machine identity can reach. Defaults to the organization the identity was created in.+ </Accordion>++ <Accordion title="--no-approval-request">+ Don't file [access requests](/documentation/platform/pam/access-requests/overview) for accounts that require approval. Those accounts stay unusable for the run.++ By default, a request is filed the first time the agent reaches for a gated account, and the account works once a reviewer approves it.+ </Accordion>++ <Accordion title="--no-sandbox">+ Run the agent without the sandbox, so nothing local restricts what it can read on this host. Keep the sandbox on wherever your operating system provides one; this flag is required on Windows, where none is available.++ See [The sandbox](/documentation/platform/pam/ai-agents/overview#the-sandbox) for what it covers.+ </Accordion>++ <Accordion title="--log-file">+ Where to write proxy logs while the agent runs.++ Default value: `~/.infisical/pam-agentic/access.log`++ ```bash+ # Example+ infisical pam agentic access --log-file /tmp/pam.log -- claude+ ```+ </Accordion>++ <Accordion title="--domain">+ Domain of your self-hosted Infisical instance. If not specified, defaults to Infisical Cloud.+ </Accordion>+</AccordionGroup>++## Account Types++Database, SSH, Kubernetes, and Windows RDP accounts are supported. See [Supported account types](/documentation/platform/pam/ai-agents/overview#supported-account-types).++## Error Messages++| Error | Cause | Solution |+|-------|-------|----------|+| `Invalid duration format` | Malformed `--duration` value | Use formats like `1h`, `30m`, `2h30m` |+| `cannot start the following accounts` | A named `--account` is unusable | Read the reason listed for each, or drop the flag to take every account you can launch |+| `requires a reason for access` | The account's template requires one | Pass `--reason` |+| `failed to check sandbox support on this host` | No sandbox available on this host | Install bubblewrap on Linux, or pass `--no-sandbox` deliberately |diff --git a/docs/cli/commands/pam.mdx b/docs/cli/commands/pam.mdxindex 1b4861a5f6..d80fb780a5 100644--- a/docs/cli/commands/pam.mdx+++ b/docs/cli/commands/pam.mdx@@ -1,6 +1,6 @@----title: "infisical pam"-description: "Securely access your infrastructure through Infisical's Privileged Access Management"+title: "pam access"+description: "Access a PAM-managed database, server, or cloud account from your terminal"---```bash@@ -9,32 +9,21 @@ infisical pam access <path> [flags]## Description-The `infisical pam` command provides brokered, credential-less access to your PAM-managed resources — databases, servers, and cloud accounts — through Infisical's Gateway.+Open one PAM-managed account for your own use, brokered through Infisical's [Gateway](/documentation/platform/gateways/overview) so you never handle its credentials. Requires `infisical login`.-All PAM commands require the user to be logged in via `infisical login`.+This single command handles every account type: the CLI adapts its behavior to whichever type the account's template defines (see [Account Types and Behavior](#account-types-and-behavior) below).-### Command Structure+<Note>+ To open several accounts at once for an AI agent, use [`infisical pam agentic access`](/cli/commands/pam-agentic) instead, which can also authenticate as a [machine identity](/documentation/platform/identities/machine-identities) so an agent can run unattended.+</Note>-```-infisical pam-└── access <path> # unified, path-based access to all PAM resources-```--## infisical pam access--Access your PAM-managed resources. This unified command handles every account type — the CLI adapts its behavior to whichever type the account's template defines (see [Account Types and Behavior](#account-types-and-behavior) below).--```bash-infisical pam access <path> [flags]-```--### Arguments+## Arguments| Argument | Description ||----------|-------------|| `<path>` | **Required.** Path to the PAM account in format `folder/account-name` |-### Flags+## Flags<Accordion title="--duration">Session duration. Supports Go duration format (e.g., `1h`, `30m`, `2h30m`).@@ -232,6 +221,10 @@ If your organization requires MFA for PAM access:3. CLI polls for up to 5 minutes for completion4. Access continues automatically after MFA verification+<Note>+ This is the only command that can satisfy an MFA requirement. [`pam agentic access`](/cli/commands/pam-agentic) does not support MFA-gated accounts yet, so reach those here.+</Note>+## Reason PromptingSome PAM policies require an audit reason. Behavior:diff --git a/docs/docs.json b/docs/docs.jsonindex 95f59f8c3c..d448564a35 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -1133,6 +1133,7 @@]},"documentation/platform/pam/access-requests/overview",+ "documentation/platform/pam/ai-agents/overview",{"group": "Credential Rotation","pages": [@@ -1195,7 +1196,10 @@"cli/commands/secrets","cli/commands/agent-proxy","cli/commands/dynamic-secrets",- "cli/commands/pam",+ {+ "group": "infisical pam",+ "pages": ["cli/commands/pam", "cli/commands/pam-agentic"]+ },"cli/commands/gateway","cli/commands/kmip","cli/commands/relay",diff --git a/docs/documentation/platform/pam/access-requests/overview.mdx b/docs/documentation/platform/pam/access-requests/overview.mdxindex 0e959cff0d..d1e56eb1e6 100644--- a/docs/documentation/platform/pam/access-requests/overview.mdx+++ b/docs/documentation/platform/pam/access-requests/overview.mdx@@ -6,6 +6,8 @@ description: "Require approval before a member can use a sensitive account."Some [accounts](/documentation/platform/pam/accounts/overview) are sensitive enough that simply having access to them should not be enough to use them. A production database or a domain admin account should be reachable only by people who are already trusted, but even for them, each individual use should clear an extra checkpoint. Access requests add that checkpoint: before a member can [launch a session](/documentation/platform/pam/sessions/overview) on a gated account, their access has to be approved.+The same checkpoint applies to [AI agents](/documentation/platform/pam/ai-agents/overview). An agent requests access as whoever started it, a person or a [machine identity](/documentation/platform/identities/machine-identities), and waits for an approver either way.+## How it worksApproval sits on top of the access a member already holds. Two layers apply to a gated account:@@ -53,6 +55,8 @@ graph TDOpen the folder and go to its **Approvals** tab. Add the users or groups who can approve requests for the folder's gated accounts.Approvers must be members of the folder, so the picker only offers people who already belong to it. An approver does not need use access to the account: approving is a governance action, not an access action.++ Only users and groups can be seated. Approving is a human sign-off, so a machine identity is never an approver, even one with Admin on the folder.</Step></Steps>@@ -98,6 +102,16 @@ graph LRRejected, expired, and revoked requests stay in the list so the audit trail stays complete.+## Requests from AI agents++An agent requests access on the same terms as a person, but from the [CLI](/cli/commands/pam-agentic) instead of the dashboard. A request from an agent running as a machine identity shows the identity's name in place of a requester's email; one from an agent you started yourself is filed under your own name.++When an agent reaches for a gated account, the request is filed for it automatically, and the account starts working on the agent's next attempt after you approve.++<Warning>+ Approving a request from an agent's identity means approving whatever that agent does with the access for the duration you grant. Keep those identities scoped to the accounts they need, and review the [session recordings](/documentation/platform/pam/sessions/session-recording).+</Warning>+## Frequently asked questions<AccordionGroup>diff --git a/docs/documentation/platform/pam/accounts/overview.mdx b/docs/documentation/platform/pam/accounts/overview.mdxindex 126c954b5a..6d28bb4cf2 100644--- a/docs/documentation/platform/pam/accounts/overview.mdx+++ b/docs/documentation/platform/pam/accounts/overview.mdx@@ -6,7 +6,7 @@ description: "Manage credentials for databases and servers."Accounts are the databases and servers you want to manage through PAM. Each account stores the connection details and credentials needed to connect — hostname, port, username, password, and so on.-When users connect to an account, they never see the actual credentials. The connection is proxied, credentials are injected automatically, and everything is recorded.+Whoever connects to an account never sees the actual credentials, whether that is a person or an [AI agent](/documentation/platform/pam/ai-agents/overview). The connection is proxied, credentials are injected automatically, and everything is recorded.## Account Types@@ -53,7 +53,7 @@ Accounts live inside [folders](/documentation/platform/pam/folders/overview). To## Connecting to an Account-Once an account exists, users with access can connect from the **Accounts** page:+Once an account exists, anyone with access can connect: people in the browser or through the CLI, [machine identities](/documentation/platform/identities/machine-identities) through the CLI.### Web Access@@ -80,6 +80,8 @@ The command outputs the local port to connect to. Then connect with your preferr| `--port` | Use a specific local port (otherwise one is assigned automatically) || `--reason` | Provide a reason (if required by the template) |+To let an [AI agent](/documentation/platform/pam/ai-agents/overview) reach an account, use [`infisical pam agentic access`](/cli/commands/pam-agentic) instead.+## Direct Account MembershipsMost access is granted at the folder level — if you have access to the folder, you have access to all accounts in it.@@ -88,10 +90,10 @@ But sometimes you need to grant access to just one account. For that, use direct1. Open the account and go to the **Permissions** tab2. Click **Assign Access**-3. Select the user/group, role, and optional expiration+3. Select the user, group, or machine identity, then set the role and an optional expiration4. Click **Add**-Direct memberships are for exceptions — a contractor who needs one specific database, or temporary elevated access to a single account.+Direct memberships are for exceptions: a contractor who needs one specific database, temporary elevated access to a single account, or a job that should reach one account and nothing else.## Next Stepsdiff --git a/docs/documentation/platform/pam/ai-agents/overview.mdx b/docs/documentation/platform/pam/ai-agents/overview.mdxnew file mode 100644index 0000000000..1146aee364--- /dev/null+++ b/docs/documentation/platform/pam/ai-agents/overview.mdx@@ -0,0 +1,247 @@+---+title: "AI Agents"+sidebarTitle: "AI Agents"+description: "Give an AI agent brokered access to your databases and servers without handing it a credential."+---++AI agents increasingly do work that needs privileged access: a coding agent tracing a bug through production data, or an agent you built yourself running a nightly task against a database. The usual way to arrange that is a connection string in the agent's environment, which leaves a long-lived credential sitting in a process that reads untrusted input all day.++**Agentic access** brokers that access instead. One command opens the [accounts](/documentation/platform/pam/accounts/overview) an agent is allowed to use, hands it instructions describing them, and starts it inside a sandbox:++```bash+infisical pam agentic access -- claude+```++From there the agent works on its own, and no credential ever reaches it. Any agent can be run this way: Claude Code, Codex, and Gemini are recognized by name and told what they can reach in their own format, and an agent you wrote yourself reads the same instructions from [an environment variable](#agents-you-build-yourself).++## How it works++Each account the agent may use is opened as a port on `127.0.0.1`. The agent connects to a port the way it would connect to any database or host, and the [Gateway](/documentation/platform/gateways/overview) on the far side supplies the real credential:++```mermaid+flowchart LR+ subgraph machine["Your machine"]+ direction TB+ subgraph box["Sandbox"]+ AGENT["AI agent<br/>no credentials"]+ end+ CLI["Infisical CLI<br/>one local port per account"]+ end++ GW["Gateway<br/>adds the real credential"]+ TARGET[("Your databases<br/>and servers")]+ INF["Infisical<br/>policies, approvals, recordings"]++ AGENT -->|"127.0.0.1:52431"| CLI+ CLI -->|"encrypted tunnel"| GW+ GW --> TARGET+ CLI -.->|"opens the session"| INF+ GW -.->|"records it"| INF+```++1. **The ports open first, and nothing is connected.** No [session](/documentation/platform/pam/sessions/overview) exists until the agent actually reaches for an account.+2. **The agent connects when its task calls for it.** That first connection is what opens the session, subject to the usual checks: role, duration, and [approval](/documentation/platform/pam/access-requests/overview).+3. **The Gateway holds the credential.** It injects it on the way to the database or host, so the agent authenticates to nothing and stores nothing.+4. **Everything is recorded**, attributed to whoever the run authenticated as, exactly like a person's session.++## Prerequisites++- The [Infisical CLI](/cli/overview) installed, and either `infisical login` completed or a machine identity to authenticate as.+- The Connector or Admin [role](/documentation/platform/pam/concepts/access-control) on the folders or accounts the agent should reach, held by whoever the run authenticates as.+- macOS, or Linux with [bubblewrap](https://github.com/containers/bubblewrap) installed. The sandbox comes from the operating system, so where one is unavailable the command refuses to start unless you [turn the sandbox off](#turning-the-sandbox-off) yourself.++## Who the agent runs as++An agent has no access of its own. It borrows the access of whoever starts the run, and that can be either of two things:++- **You.** Log in with `infisical login` and the agent uses your own access. Its sessions and any access requests are attributed to you, exactly as if you had opened them yourself. This is the normal way to work with a coding agent at your terminal.+- **A [machine identity](/documentation/platform/identities/machine-identities).** For an agent that runs with nobody watching, give it an identity of its own so its sessions and requests belong to it rather than to a person. See [Running unattended](#running-unattended).++Nothing else on this page changes between the two.++## Starting an agent++Everything after `--` is the command that starts your agent. By default it can reach every account you could launch a session on yourself, which is usually more than a single task needs, so narrow it with `--account`:++```bash+infisical pam agentic access --account prod/orders-db --account prod/bastion -- claude+```++<Tip>+ Give the agent the accounts the task needs, not everything you have. The instructions tell it to stay on the accounts it was given, but a smaller set is a smaller blast radius.+</Tip>++Before the agent starts, the run prints what it can reach:++```text+ Infisical PAM proxies ready for claude++ 127.0.0.1:52431 prod/orders-db (PostgreSQL)+ 127.0.0.1:52432 prod/bastion (SSH)+ 127.0.0.1:52433 prod/payments-db (PostgreSQL) [awaiting approval]++ Not started:+ prod/legacy-db: you don't have permission to launch sessions for this account++ Proxy logs: /Users/you/.infisical/pam-agentic/access.log+```++Anything left out appears under **Not started** with the reason, so no account goes missing silently. One reason worth knowing in advance: an account whose [template](/documentation/platform/pam/templates/overview) requires a reason needs `--reason` on the command line, since the agent owns the terminal and there is nothing to prompt.++Sessions are created lazily, on the agent's first connection to each account, so accounts it never touches produce no sessions at all.++### Supported account types++Agents can reach:++- **Databases** — [PostgreSQL](/documentation/platform/pam/accounts/postgresql), [MySQL](/documentation/platform/pam/accounts/mysql), [SQL Server](/documentation/platform/pam/accounts/mssql), [MongoDB](/documentation/platform/pam/accounts/mongodb), and Redis+- **Servers** — [SSH](/documentation/platform/pam/accounts/ssh), and [Windows](/documentation/platform/pam/accounts/windows) over RDP+- **Clusters** — [Kubernetes](/documentation/platform/pam/accounts/kubernetes)++Kubernetes accounts are set up for the agent automatically, so `kubectl` works inside the run without touching your own kubeconfig.++<Note>+ Accounts whose template requires **MFA** cannot be used here yet, whoever the run authenticates as. Reach those with `infisical pam access`, which prompts for MFA in the browser. Support for MFA in agent runs is planned.+</Note>++## How the agent is told++An agent that does not know these accounts exist will not use them, so every run writes an instruction document. It names the accounts the agent can reach, tells it that no credentials are needed because the Gateway supplies them, that everything it runs is recorded, and that it should not connect to anything else.++The document is delivered in whichever way the agent understands, so there is nothing to configure:++| Agent | How it arrives |+|---|---|+| `claude` | Passed to Claude Code directly. Your repo is untouched. |+| `codex` | A block in `AGENTS.md`, removed when the run ends. |+| `gemini` | A block in `GEMINI.md`, removed when the run ends. |+| Anything else | A block in `AGENTS.md`, removed when the run ends. |++Use `--agent` if your agent runs under a wrapper script and is not recognized by name.++### Agents you build yourself++You are not limited to the agents above. Every run exports **`INFISICAL_PAM_CONTEXT_FILE`**, the path to that same document, so an agent that follows no convention of its own can still be told what it may reach. Read the file and put it in front of your model:++```python+import os++with open(os.environ["INFISICAL_PAM_CONTEXT_FILE"]) as file:+ pam_context = file.read() # add this to your agent's system prompt+```++The variable is set for every run, so a wrapper around one of the agents above can read it too.++## The sandbox++Instructions tell the agent where to go. The sandbox is an additional layer aimed at keeping it away from your Infisical credentials: while your login stays unreadable, an agent cannot open sessions beyond the accounts, duration, and approvals the run was started with.++| The agent can | The agent should not be able to |+|---|---|+| Read and write in your working directory | Read your Infisical login or credential store |+| Use its own tools, subprocesses, and state | Open PAM sessions on other accounts |+| Reach the accounts listed when the run started | Use Docker or another container runtime |++Everyday development files such as `~/.aws`, `~/.ssh`, and `~/.kube` stay readable, so ordinary work like `git` over SSH keeps working. The sandbox is aimed at your access to PAM itself, not at every secret on the machine.++### How far the sandbox goes++The sandbox does real work. It closes the paths an agent would actually take to your Infisical credentials, it survives the agent's own subprocesses because the operating system enforces it, and nothing the agent can do from inside lifts it.++<Note>+ **It is still defense in depth, not a guarantee.** No operating system sandbox is airtight, and this one is not an exfiltration control either, since the agent keeps its own network access. An agent built or manipulated into hunting for secrets on the host may well be stopped, and may not be.+</Note>++Underneath it, PAM's own guarantees hold either way: the account's credential is never on the machine at all, every connection is a [session](/documentation/platform/pam/sessions/overview) you can watch and end, and access stays bounded by role, duration, and [approval](/documentation/platform/pam/access-requests/overview). For anything sensitive, [running the agent as its own scoped identity](#running-unattended) is what bounds the worst case.++### Turning the sandbox off++`--no-sandbox` runs the agent with no local boundary at all. Keep the sandbox on wherever your operating system provides one.++## Accounts that need approval++Sensitive accounts can be put behind [approval](/documentation/platform/pam/access-requests/overview), and an agent is held to that gate like anyone else. Such an account is still offered to the agent, marked `[awaiting approval]` in the list above, and stays unusable until a person clears it.++The first time the agent reaches for one, a request is filed and that attempt fails. Once a reviewer approves it, the agent's next attempt works, with nothing to restart. A grant that expires part-way through a long run behaves the same way: the agent waits rather than losing the account.++Pass `--no-approval-request` if you would rather nothing was filed on your behalf.++## Running unattended++Everything so far assumed you at a terminal. An agent that runs on a schedule or on a server should instead run as its own machine identity, so its sessions and access requests belong to it rather than to a person.++This is also the strongest way to run an agent you do not fully trust, watched or not: no human's credentials are part of the run at all, and the identity's scope becomes the ceiling on what the agent can reach.++<Steps>+ <Step title="Create the identity">+ Go to **Privileged Access Management → Access Control**, open the **Identities** tab, and click **Add Identity**. **Create** makes an identity that belongs to PAM; **Assign** adds one that already exists in your organization. Either way, choose **Product Admin** or **Product Member**, the two roles PAM offers.++ A new identity arrives with [Universal Auth](/documentation/platform/identities/universal-auth) attached, so its page has a **Client ID** and can generate a **Client Secret** right away. Attach a different [auth method](/documentation/platform/identities/machine-identities#authentication-methods) instead if the agent's host can authenticate itself through Kubernetes, AWS, GCP, Azure, OIDC, JWT, or LDAP.+ </Step>+ <Step title="Grant it access">+ Open the [folder](/documentation/platform/pam/folders/overview) the agent needs, go to **Permissions**, click **Assign Access**, and give the identity the **Connector** role on the accounts its task needs and nothing else. Set an expiration if the access is temporary.+ </Step>+ <Step title="Run the agent as the identity">+ Pass the credentials through the environment:++ ```bash+ export INFISICAL_AUTH_METHOD=universal-auth+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<client-id>+ export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<client-secret>++ infisical pam agentic access --reason "nightly triage agent" -- python triage_agent.py+ ```+ </Step>+</Steps>++<Tip>+ Use the environment rather than `--client-secret` and friends. A secret on the command line lands in your shell history and is visible to anything that can list processes. The CLI also strips its own variables before the agent starts, so the agent never inherits the credentials the run was authenticated with.+</Tip>++See the [CLI reference](/cli/commands/pam-agentic) for the other authentication methods and their variables.++For a sensitive workload, pair that with a **dedicated machine**: an isolated host or container holding nothing else worth taking, so even an agent that gets past every local defense finds only that one narrowly scoped identity. Its access is still bounded by role, duration, and [approval](/documentation/platform/pam/access-requests/overview), and everything it does is on record.++## Reviewing what the agent did++Because every connection is a normal PAM session, reviewing an agent's work is the same job as reviewing a person's. Each account it connected to has a [session](/documentation/platform/pam/sessions/overview) with its queries or commands in the [recording](/documentation/platform/pam/sessions/session-recording), attributed to whoever the run authenticated as. An identity has no email address, so its sessions and [audit log](/documentation/platform/pam/auditing) entries show **Machine Identity** where a person's email would appear.++## Frequently asked questions++<AccordionGroup>+ <Accordion title="An account is missing from the list">+ Check the **Not started** list, printed with every run, which gives the reason for each account left out. If the account is not there either, you cannot launch sessions on it: check your role on the folder or account.+ </Accordion>+ <Accordion title="An account stays stuck on awaiting approval">+ It is waiting on a person. Check the folder's **Approvals** tab: with no approvers seated there, no one can clear the request. After approval, the agent's next attempt works on its own.+ </Accordion>+ <Accordion title="Can an agent approve an access request?">+ No. Approving stays with people, whoever the agent runs as. It can file a request and wait for a user or group to clear it.+ </Accordion>+ <Accordion title="What does running as a machine identity change?">+ The attribution. Sessions and access requests belong to the identity rather than to you, and its roles decide what the agent can reach.+ </Accordion>+ <Accordion title="The command will not start on Linux">+ The sandbox is unavailable, usually because bubblewrap is missing or user namespaces are restricted on the host. The message says which. The command stops rather than quietly running your agent without a boundary. Fix the host if you can, or pass [`--no-sandbox`](#turning-the-sandbox-off) deliberately.+ </Accordion>+ <Accordion title="How do I cut an agent off quickly?">+ Remove its identity's role on the folder or account to stop it launching anything new, and terminate any live session from the **Sessions** page. For a gated account, revoking its grant on the folder's **Approvals** tab also ends its sessions right away.+ </Accordion>+</AccordionGroup>++## Next steps++<CardGroup cols={2}>+ <Card title="Access Requests" icon="key" href="/documentation/platform/pam/access-requests/overview">+ Require approval before an agent can use an account.+ </Card>+ <Card title="Access Control" icon="shield-halved" href="/documentation/platform/pam/concepts/access-control">+ The roles you grant an agent's identity.+ </Card>+ <Card title="Session Recording" icon="video" href="/documentation/platform/pam/sessions/session-recording">+ Review exactly what the agent ran.+ </Card>+ <Card title="CLI Reference" icon="terminal" href="/cli/commands/pam-agentic">+ Every flag for `pam agentic access`.+ </Card>+</CardGroup>diff --git a/docs/documentation/platform/pam/architecture.mdx b/docs/documentation/platform/pam/architecture.mdxindex 150fbb013b..b1b7b3199e 100644--- a/docs/documentation/platform/pam/architecture.mdx+++ b/docs/documentation/platform/pam/architecture.mdx@@ -1,10 +1,10 @@---title: "Architecture"sidebarTitle: "Architecture"-description: "How PAM connects users to your infrastructure securely."+description: "How PAM connects people and machines to your infrastructure securely."----PAM uses a proxy-based architecture. Users never connect directly to your databases or servers — everything goes through the [Gateway](/documentation/platform/gateways/overview). This keeps your infrastructure isolated while providing secure, auditable access.+PAM uses a proxy-based architecture. Nothing connects directly to your databases or servers: everything goes through the [Gateway](/documentation/platform/gateways/overview). This keeps your infrastructure isolated while providing secure, auditable access.## Components@@ -12,22 +12,25 @@ PAM uses a proxy-based architecture. Users never connect directly to your databa**Gateway** — a lightweight service you deploy in your private network. It proxies connections to your databases and servers, injects credentials, and records sessions.-**Client** — the user's browser (Web Access) or CLI. Connects to the Gateway through an encrypted tunnel.+**Client** — a user's browser (Web Access) or the CLI. Connects to the Gateway through an encrypted tunnel. An [AI agent](/documentation/platform/pam/ai-agents/overview) connects through the CLI, which holds the tunnel on its behalf.++**Actor** — the user or [machine identity](/documentation/platform/identities/machine-identities) the session belongs to. Permissions, policies, and the audit trail all follow the actor.## How a Connection Works-When a user connects to an [account](/documentation/platform/pam/accounts/overview):+When an actor connects to an [account](/documentation/platform/pam/accounts/overview):-1. **User requests access** — clicks Launch in the browser or runs the CLI command-2. **Infisical checks permissions** — verifies the user has a [membership](/documentation/platform/pam/concepts/access-control) with the right role-3. **[Template](/documentation/platform/pam/templates/overview) rules are enforced** — MFA, reason requirement, etc.-4. **Connection is established** — an encrypted tunnel is created between the client and Gateway-5. **Gateway fetches credentials** — retrieves them from Infisical-6. **Gateway connects to the target** — using the credentials-7. **Traffic flows through the Gateway** — user interacts with the database/server-8. **Session is recorded** — Gateway captures and uploads session activity+1. **Access is requested** — a user clicks Launch in the browser, or the CLI command runs+2. **Infisical checks permissions** — verifies the actor has a [membership](/documentation/platform/pam/concepts/access-control) with the right role+3. **[Template](/documentation/platform/pam/templates/overview) rules are enforced** — MFA, reason requirement, session duration+4. **Approval is checked** — a gated account also needs an approved [access request](/documentation/platform/pam/access-requests/overview)+5. **Connection is established** — an encrypted tunnel is created between the client and Gateway+6. **Gateway fetches credentials** — retrieves them from Infisical+7. **Gateway connects to the target** — using the credentials+8. **Traffic flows through the Gateway** — the actor interacts with the database/server+9. **Session is recorded** — Gateway captures and uploads session activity, attributed to the actor-The user never sees the credentials. The database/server never sees the user directly.+The actor never sees the credentials. The database/server never sees the actor directly.## Network Securitydiff --git a/docs/documentation/platform/pam/auditing.mdx b/docs/documentation/platform/pam/auditing.mdxindex f8ab1db8e0..828b6f7f02 100644--- a/docs/documentation/platform/pam/auditing.mdx+++ b/docs/documentation/platform/pam/auditing.mdx@@ -19,11 +19,13 @@ PAM logs every action — who accessed what, who changed what, and when. This auEach event includes:- **Timestamp** — when it happened-- **Actor** — who did it (user, email, IP address)+- **Actor** — who did it: a user (name, email, IP address) or a [machine identity](/documentation/platform/identities/machine-identities), named as it is named in your organization- **Action** — what was done- **Target** — what was affected- **Details** — relevant context (e.g., what changed)+An identity has no email address, so its events show **Machine Identity** where a person's email would be. Everything an [AI agent](/documentation/platform/pam/ai-agents/overview) does is logged the same way a person's activity is.+## Viewing Audit Logs1. Go to **Privileged Access Management → Audit Logs**@@ -51,7 +53,7 @@ Audit logs are retained according to your organization's policy. Events are immu**Change tracking** — Filter by event type to see configuration changes (template updates, membership changes).-**User activity reports** — Filter by actor to see everything a specific user did.+**Activity reports** — Filter by actor to see everything a specific user or machine identity did.## Next Stepsdiff --git a/docs/documentation/platform/pam/concepts/access-control.mdx b/docs/documentation/platform/pam/concepts/access-control.mdxindex 123aac32b6..5044ded371 100644--- a/docs/documentation/platform/pam/concepts/access-control.mdx+++ b/docs/documentation/platform/pam/concepts/access-control.mdx@@ -9,6 +9,8 @@ Access control in PAM happens at two levels:1. **Product membership** — being added to PAM itself (the "entry ticket")2. **Folder and account memberships** — being granted a role on specific folders or accounts (this is what lets you connect)+Users, groups, and [machine identities](/documentation/platform/identities/machine-identities) all go through both levels and hold the same roles, so everything below applies to all three unless it says otherwise. An [AI agent](/documentation/platform/pam/ai-agents/overview) runs as whoever started it, so it uses either a person's access or a machine identity's.+## Product MembershipBefore anyone can do anything in PAM, they need to be added as a product member. This is the "entry ticket" to PAM.@@ -29,12 +31,14 @@ Organization Admins can enter PAM as a Product Admin without being explicitly ad### Adding Product Members1. Go to **Privileged Access Management → Access Control**-2. Select the **Users** or **Groups** tab+2. Select the **Users**, **Groups**, or **Identities** tab3. Click **Add**-4. Select from users or groups that exist in your organization+4. Select from users, groups, or machine identities in your organization5. Choose **Product Admin** or **Product Member**6. Click **Add**+The **Identities** tab can also create a new machine identity for PAM instead of adding an existing one. See [AI Agents](/documentation/platform/pam/ai-agents/overview) for the agent workflow that uses it.+## Folder and Account MembershipsOnce someone is a product member, they still need to be granted access to specific folders or accounts. You do this by assigning them a **role** on a folder or account.@@ -60,13 +64,24 @@ You can assign roles at two levels:For folders:1. Open the folder and go to **Permissions**2. Click **Assign Access**-3. Select user/group, role, and optional expiration+3. Select a user, group, or machine identity, then set the role and an optional expiration4. Click **Add**For accounts:1. Open the account and go to **Permissions**2. Same process as above+The picker only offers members of PAM, so a machine identity has to be added on the **Access Control** page before it can be granted a role here.++### What Only People Can Do++Two things stay with users and groups:++- **Web Access.** Connecting in the browser is for users. Machine identities connect through the [CLI](/cli/commands/pam-agentic).+- **Approving [access requests](/documentation/platform/pam/access-requests/overview).** A machine identity can file a request, but only users and groups can approve one.++An account whose [template](/documentation/platform/pam/templates/overview) requires MFA also stays with people: a machine identity can never complete the challenge, and [agent runs](/documentation/platform/pam/ai-agents/overview) do not support it yet.+## Putting It TogetherHere's a typical setup:@@ -89,4 +104,7 @@ The Product Admin sets up the governance structure. The Folder Admin manages day<Card title="Accounts" icon="user-lock" href="/documentation/platform/pam/accounts/overview">Add accounts and manage account memberships.</Card>+ <Card title="AI Agents" icon="robot" href="/documentation/platform/pam/ai-agents/overview">+ Grant the same access to an AI agent.+ </Card></CardGroup>diff --git a/docs/documentation/platform/pam/concepts/pam-components.mdx b/docs/documentation/platform/pam/concepts/pam-components.mdxindex 3e4cba9480..0b4e2ae622 100644--- a/docs/documentation/platform/pam/concepts/pam-components.mdx+++ b/docs/documentation/platform/pam/concepts/pam-components.mdx@@ -8,7 +8,7 @@ Infisical PAM is built around four core components: accounts, folders, account t## Accounts-An **account** represents a single database or server you want to manage. You provide the connection details (host, port, database) and credentials (username, password), and Infisical stores them securely. Users connect through Infisical without ever seeing the underlying credentials.+An **account** represents a single database or server you want to manage. You provide the connection details (host, port, database) and credentials (username, password), and Infisical stores them securely. Whoever connects, a person or a machine, goes through Infisical without ever seeing the underlying credentials.Infisical supports databases (PostgreSQL, MySQL, MS SQL, MongoDB), servers (SSH, Windows), Kubernetes clusters, and AWS IAM roles.@@ -42,7 +42,7 @@ Every account uses a template of the same type. Infisical provides default templ## Memberships-**Memberships** determine who can access what by assigning users or groups a role on a folder or account.+**Memberships** determine who can access what by assigning a user, group, or [machine identity](/documentation/platform/identities/machine-identities) a role on a folder or account.| Role | Capabilities ||------|-------------|@@ -52,6 +52,8 @@ Every account uses a template of the same type. Infisical provides default templMemberships on a folder cascade to all accounts inside. For most cases, this is all you need. For exceptions, you can assign memberships directly on individual accounts.+Machine identities hold these same roles, which is how an [AI agent](/documentation/platform/pam/ai-agents/overview) reaches an account when it runs unattended. **Connector** is the usual choice.+[Learn more about Access Control →](/documentation/platform/pam/concepts/access-control)## Next Stepsdiff --git a/docs/documentation/platform/pam/concepts/session-lifecycle.mdx b/docs/documentation/platform/pam/concepts/session-lifecycle.mdxindex 3b27507aa1..21f9b3c9d3 100644--- a/docs/documentation/platform/pam/concepts/session-lifecycle.mdx+++ b/docs/documentation/platform/pam/concepts/session-lifecycle.mdx@@ -6,15 +6,20 @@ description: "What happens when you connect to an account."When you connect to an [account](/documentation/platform/pam/accounts/overview) through PAM, a **session** is created. The session tracks who connected, when, for how long, and what they did. Here's what happens at each stage.+An [AI agent](/documentation/platform/pam/ai-agents/overview) goes through the same stages, with the same checks and the same recording.+## Requesting AccessWhen you click **Launch Session** on an account from the **Accounts** page (or run the CLI command), PAM checks:1. **Do you have permission?** — You need a [membership](/documentation/platform/pam/concepts/access-control) (on the [folder](/documentation/platform/pam/folders/overview) or account) with the Connector or Admin role2. **[Template](/documentation/platform/pam/templates/overview) requirements** — If the template requires a reason, you'll be prompted to enter one. If it requires MFA, you'll need to verify your identity.+3. **Approval, if the account is gated** — A gated account also needs an active [access request](/documentation/platform/pam/access-requests/overview) grantIf everything checks out, the session is approved and you can connect.+An [AI agent](/documentation/platform/pam/ai-agents/overview) cannot be prompted, so it supplies its reason up front, and it cannot use an account that requires MFA yet.+## ConnectingOnce approved, the connection is established through the [Gateway](/documentation/platform/gateways/overview):diff --git a/docs/documentation/platform/pam/folders/overview.mdx b/docs/documentation/platform/pam/folders/overview.mdxindex 11bf8ededf..28b3aab1a8 100644--- a/docs/documentation/platform/pam/folders/overview.mdx+++ b/docs/documentation/platform/pam/folders/overview.mdx@@ -36,7 +36,7 @@ Once created, you can start adding accounts to it. But first, you'll probably wa## Managing Access-Access to a folder is controlled through **[memberships](/documentation/platform/pam/concepts/access-control)**. You assign users or groups a role, and that role determines what they can do.+Access to a folder is controlled through **[memberships](/documentation/platform/pam/concepts/access-control)**. You assign a user, group, or [machine identity](/documentation/platform/identities/machine-identities) a role, and that role determines what they can do.### Adding Members@@ -52,7 +52,7 @@ Access to a folder is controlled through **[memberships](/documentation/platform| Field | Description ||-------|-------------|- | **User/Group** | Who you're granting access to |+ | **User/Group/Identity** | Who you're granting access to || **Role** | What they can do (see roles below) || **Expires** | Optional expiration date for temporary access |@@ -74,11 +74,12 @@ When you assign a role on a folder, it applies to **all accounts** inside that fFor contractors or temporary team members, set an expiration when adding the membership. The access is automatically revoked when it expires — no manual cleanup needed.-### Groups vs Individual Users+### Users, Groups, and Machine Identities-You can grant access to individual users or to groups:+You can grant folder access to any of the three:- **Individual users** — straightforward, easy to audit- **Groups** — access follows group membership; when someone joins or leaves the group, their folder access updates automatically+- **Machine identities** — for unattended workloads, such as an [AI agent](/documentation/platform/pam/ai-agents/overview) on a schedule. **Connector** is the usual role, and time-bound access works here too.Groups are managed at the organization level and can sync from identity providers like Okta or Azure AD.diff --git a/docs/documentation/platform/pam/guides/team-access.mdx b/docs/documentation/platform/pam/guides/team-access.mdxindex 1f2c7a80b2..eb34022fe6 100644--- a/docs/documentation/platform/pam/guides/team-access.mdx+++ b/docs/documentation/platform/pam/guides/team-access.mdx@@ -68,4 +68,7 @@ To add another database, open the folder and click **Add Account**. Your team wi<Card title="Sessions" icon="display" href="/documentation/platform/pam/sessions/overview">View and manage team sessions.</Card>+ <Card title="AI Agents" icon="robot" href="/documentation/platform/pam/ai-agents/overview">+ Grant the same folder access to an AI agent.+ </Card></CardGroup>diff --git a/docs/documentation/platform/pam/overview.mdx b/docs/documentation/platform/pam/overview.mdxindex 35a4f15b7b..7161531428 100644--- a/docs/documentation/platform/pam/overview.mdx+++ b/docs/documentation/platform/pam/overview.mdx@@ -4,7 +4,7 @@ sidebarTitle: "Overview"description: "Manage and secure access to critical infrastructure like databases and servers with policy-based controls, session recording, and audit trails."----Infisical PAM lets you securely manage access to databases and servers. Users connect through a browser or CLI without ever seeing credentials — every session is recorded and auditable.+Infisical PAM lets you securely manage access to databases and servers. People connect through a browser or CLI, and so do [AI agents](/documentation/platform/pam/ai-agents/overview), running either as the person who started them or as a [machine identity](/documentation/platform/identities/machine-identities). Nothing ever sees the credentials, and every session is recorded and auditable.<Card title="Get Started" icon="rocket" href="/documentation/platform/pam/quick-starts/launch-first-session">New to PAM? Launch your first session in under 10 minutes.@@ -22,6 +22,9 @@ Infisical PAM lets you securely manage access to databases and servers. Users co<Card title="Access Control" icon="shield-halved" href="/documentation/platform/pam/concepts/access-control">Understand roles and permissions.</Card>+ <Card title="AI Agents" icon="robot" href="/documentation/platform/pam/ai-agents/overview">+ Let an agent work with real infrastructure, sandboxed and recorded.+ </Card><Card title="Architecture" icon="sitemap" href="/documentation/platform/pam/architecture">How Gateways proxy connections securely.</Card>diff --git a/docs/documentation/platform/pam/quick-starts/launch-first-session.mdx b/docs/documentation/platform/pam/quick-starts/launch-first-session.mdxindex cba833293f..18796e494d 100644--- a/docs/documentation/platform/pam/quick-starts/launch-first-session.mdx+++ b/docs/documentation/platform/pam/quick-starts/launch-first-session.mdx@@ -52,4 +52,7 @@ This quickstart walks you through connecting to a PostgreSQL database via PAM. Y<Card title="Team Access Guide" icon="users" href="/documentation/platform/pam/guides/team-access">Grant your team access to production databases.</Card>+ <Card title="AI Agents" icon="robot" href="/documentation/platform/pam/ai-agents/overview">+ Point an AI agent at the same account, sandboxed and recorded.+ </Card></CardGroup>diff --git a/docs/documentation/platform/pam/sessions/overview.mdx b/docs/documentation/platform/pam/sessions/overview.mdxindex c2bc1be9b0..59ea4a1b39 100644--- a/docs/documentation/platform/pam/sessions/overview.mdx+++ b/docs/documentation/platform/pam/sessions/overview.mdx@@ -4,7 +4,7 @@ sidebarTitle: "Overview"description: "View and manage active and past sessions."----Every time someone connects to an [account](/documentation/platform/pam/accounts/overview) through PAM, a session is created. The **Sessions** page shows all sessions — active and completed — so you can monitor who's connected and review what happened.+Every time a person or an [AI agent](/documentation/platform/pam/ai-agents/overview) connects to an [account](/documentation/platform/pam/accounts/overview) through PAM, a session is created. The **Sessions** page shows all sessions, active and completed, so you can monitor what's connected and review what happened.## Viewing Sessions@@ -14,22 +14,22 @@ Go to **Privileged Access Management → Sessions** to see the session list.|--------|---------------|| **Account** | Which account was accessed || **Folder** | Which folder it belongs to |-| **User** | Who connected |+| **User** | Who connected: a user, or a machine identity shown by name || **Status** | Active, Ended, or Terminated || **Started** | When the session began || **Duration** | How long it lasted (or has been active) |-Click on any session to see its details and recording.+Click on any session to see its details and recording. A [machine identity](/documentation/platform/identities/machine-identities) has no email address, so its sessions show **Machine Identity** wherever a person's email would appear.### FilteringUse the filters to find specific sessions:- **Status** — Active, Ended- **Account** or **Folder** — Narrow to specific resources-- **User** — Sessions by a specific person+- **User** — Sessions by a specific person or machine identity- **Date range** — Sessions within a time period-The search bar finds sessions by account name, folder name, or user email.+The search bar finds sessions by account name, folder name, or the actor's name or email.## Active Sessions@@ -47,7 +47,7 @@ Click on a session to see:## Terminating Sessions-If someone shouldn't be connected — security incident, policy violation, or they're stuck — you can terminate their session.+If something shouldn't be connected (a security incident, a policy violation, someone stuck, or an [agent](/documentation/platform/pam/ai-agents/overview) doing more than you expected), you can terminate the session.1. Find the active session2. Click on it to open details@@ -55,7 +55,7 @@ If someone shouldn't be connected — security incident, policy violation, or th4. Confirm<Warning>-The user is immediately disconnected. Use this for emergencies; normal sessions should end naturally.+Whoever is connected is disconnected immediately, person or machine. Use this for emergencies; normal sessions should end naturally.</Warning>## Next Stepsdiff --git a/docs/documentation/platform/pam/templates/overview.mdx b/docs/documentation/platform/pam/templates/overview.mdxindex 9ef752abb6..b6ebac7598 100644--- a/docs/documentation/platform/pam/templates/overview.mdx+++ b/docs/documentation/platform/pam/templates/overview.mdx@@ -1,7 +1,7 @@---title: "Account Templates"sidebarTitle: "Account Templates"-description: "Define the rules that apply when users connect to accounts."+description: "Define the rules that apply when someone connects to an account."---Templates define how [accounts](/documentation/platform/pam/accounts/overview) behave when someone connects — session duration limits, MFA requirements, which [Gateway](/documentation/platform/gateways/overview) to use, where to store [session recordings](/documentation/platform/pam/sessions/session-recording), and more.@@ -35,9 +35,13 @@ If you need different rules — say, 4-hour sessions with MFA for production —| Option | What it does ||--------|--------------|| **Require MFA** | Users must re-authenticate with MFA before connecting |- | **Require Reason** | Users must provide a reason before connecting |+ | **Require Reason** | A reason must be provided before connecting || **Max Session Duration** | How long someone can stay connected (in seconds) || **Command Blocking** | Regex patterns for commands to reject (one per line). Currently SSH only. |++ <Note>+ **Require MFA** puts an account out of reach of [AI agents](/documentation/platform/pam/ai-agents/overview), which cannot complete the challenge yet, and of [machine identities](/documentation/platform/identities/machine-identities), which never can. For accounts an agent needs, use a template without it and gate access with [approvals](/documentation/platform/pam/access-requests/overview) instead.+ </Note></Step><Step title="Configure system settings">| Option | What it does |