Connect an agent to identity and secrets systems without handing it the keys
A least-privilege checklist for identity and secrets MCP servers, worked through on Okta, Bitwarden and Clerk plus 1Password's agent hooks: scope tools to read-only first, keep secrets out of model context, gate writes with a human, and keep audit logs.
Prerequisites
- A non-production tenant or a throwaway vault. Do not point this at a production identity provider or your own password vault first.
- An MCP client that can deny or ask per tool (the examples use Claude Code permission rules)
Identity providers and password managers are the systems where a wrong tool call costs the most: a deleted policy locks people out, an invited admin is a new attacker, and a read of a vault item puts a password into a model's context. Four tools from the directory sit in this area, and they make very different promises. This guide reads what each vendor actually documents, then gives one checklist that works for all of them.
Nothing here was installed or run. Every claim below comes from the vendor README or spec named in the sources, read on 29 November 2026. No Okta org, Bitwarden vault, Clerk account or 1Password account was used. Do your first run against a throwaway tenant or vault, never your production one.
What each tool documents
| Okta MCP Server | Bitwarden MCP Server | Clerk skills and MCP | 1Password Agent Hooks | |
|---|---|---|---|---|
| What it is | Official open-source server for Okta admin APIs (users, groups, apps, policies, logs) | Local server for a Bitwarden vault (CLI) and organisation admin (Public API) | Skills pack plus a hosted MCP server at mcp.clerk.com/mcp | Hook scripts that run before shell or tool use and check 1Password setup |
| Where it runs | You run it yourself with Docker or uv; README documents no hosted endpoint | Local use only (stdio); README says never host or expose it | Hosted by Clerk; sign in with a Dashboard account | Local scripts in your agent's hooks config |
| Least privilege | OAuth scopes in OKTA_SCOPES; tools without a granted scope are not registered | Not documented: no scope list, read-only mode or tool filter in the README. File tools need BW_ALLOWED_DIRECTORIES | Acts as you, limited by your workspace role | Not applicable: it validates, it does not grant |
| Secrets and the model | No secret-returning tools documented | Retrieval tools return vault items; README warns responses may reveal credentials | README says the server never returns secret keys | Hook checks that mounted .env files exist and are enabled; it does not itself keep secrets out of context |
| Human approval | Deletes and deactivations use MCP elicitation; fallback asks the model to relay | Not documented | Change-making tools are flagged so agents can ask first | A hook can deny a command; it is not an approval step |
| Logs | get_logs tool (scope okta.logs.read) reads Okta logs | get_org_events reads organisation events; README says to monitor logs | Per-call analytics go to Clerk; no user-facing audit log is described in the README | Opt-in local telemetry only |
The empty cells matter. Where a README is silent, treat the control as absent and add it on the client side (step 2).
1. Decide the tier before you connect
Pick the lowest tier that does the job.
- Read-only inspection. Listing users, reading logs, checking a policy. Safe enough for a first run in a throwaway tenant.
- Reversible writes. Creating a group or adding a member. Needs a human click per call.
- Destructive or privilege-changing writes. Deleting, deactivating, inviting admins, changing policies, approving devices. Keep these out of the agent's reach unless a person is present and approves each call.
- Reading secret values. Retrieving a password or TOTP code into the conversation. Avoid; see step 3.
2. Make the client enforce the tier
The vendor controls above are a first layer. Add your own in the MCP client, because a server that documents no gate cannot be trusted to have one.
Claude Code's permission rules match MCP tools as mcp__<server>__<tool> or mcp__<server>__*, and rules are evaluated deny first, then ask, then allow (per its permissions docs). A starting point for the Bitwarden server, assuming you named it bitwarden, with tool names taken from its README (not run here):
{
"permissions": {
"deny": [
"mcp__bitwarden__get",
"mcp__bitwarden__list",
"mcp__bitwarden__device_approval_approve",
"mcp__bitwarden__device_approval_approve_all",
"mcp__bitwarden__device_approval_deny_all",
"mcp__bitwarden__invite_org_member",
"mcp__bitwarden__reinvite_org_member",
"mcp__bitwarden__update_org_member",
"mcp__bitwarden__remove_org_member",
"mcp__bitwarden__update_org_policy",
"mcp__bitwarden__update_org_subscription",
"mcp__bitwarden__import_org_users_and_groups",
"mcp__bitwarden__delete",
"mcp__bitwarden__restore",
"mcp__bitwarden__delete_org_collection",
"mcp__bitwarden__delete_org_group",
"mcp__bitwarden__delete_send"
],
"ask": [
"mcp__bitwarden__create_item",
"mcp__bitwarden__edit_item",
"mcp__bitwarden__update_org_collection",
"mcp__bitwarden__update_org_group",
"mcp__bitwarden__update_org_member_groups",
"mcp__bitwarden__update_org_group_members",
"mcp__bitwarden__list_org_members",
"mcp__bitwarden__get_org_events"
]
}
}
This list is a template, not a complete one: the README names many more write tools (collection, group, folder, attachment, Send and move/confirm tools), so rebuild it from the tools your installed version really lists (the MCP Inspector, npm run inspect in Bitwarden's repo, shows them; see MCP Inspector). get and list are on the deny list on purpose: per the README they return vault items, which puts secrets in the conversation. If retrieval is the point of your setup, remove them knowingly, keep the rest of the deny list, and read step 3 first. restore and delete_org_* are denied because they change what the vault or organisation holds without a person reviewing it.
For Okta, do the equivalent in the server's own config first: the README says tools are registered only for scopes in OKTA_SCOPES and advises starting with the minimum set, for example okta.users.read okta.brands.read. It also says okta.<resource>.manage enables write operations and implicitly includes read, so a manage scope is never "read plus a little". Start read-only, and add a manage scope for one resource only when a person is watching.
For Okta's two auth methods, the README offers a Device Authorization Grant for interactive use and Private Key JWT for browserless use. The private-key path needs an API Services app with a key pair and an assigned admin role, so the app's admin role is a second limit on top of scopes. Prefer the interactive grant for a first run and give the app the narrowest admin role that works (an editorial judgment; the README only says to follow least privilege).
3. Keep secrets out of the model's context
Two different questions get mixed up here.
Credentials for the server itself. Bitwarden's config holds BW_SESSION, and for organisation features BW_CLIENT_ID and BW_CLIENT_SECRET, in the MCP client config. Its README says those files are sensitive, never to commit or share them, and notes that session tokens expire after inactivity. Its unlock tool takes no parameters and opens a native OS password dialog, so by the README's account the master password never crosses the MCP channel or reaches the model. Okta's README describes credentials managed through its auth flows and environment variables. The Clerk server uses a Dashboard sign-in rather than a pasted key.
Secret values the agent reads or uses. This is where the tools differ most.
- Bitwarden's
getandlistreturn vault data, and the README itself warns that "AI responses may inadvertently reveal sensitive information" and suggests a self-hosted or local model for sensitive data. If the model must not see a password, do not give it retrieval tools. - Clerk's README says its server never returns secret keys. That is a vendor statement, not something we tested.
- 1Password's mounted-
.envhook is a guard, not a broker: it checks that each configured.envis enabled and exists as a FIFO before the agent runs a command, and it fails open if 1Password cannot be queried. It does not claim to keep values out of context; treat it as a way to make commands run with secrets that a person has already mounted, and nothing more. - If you need a command to use a credential the model never sees, look at runtime isolation rather than a vault MCP server. The nono README says it keeps API keys outside the agent's sandbox with proxy-based injection and restricts a credential to approved tools (its example:
awscan use a credential,curlcannot). That is the README's claim; it was not tested here. Token vaults such as WorkOS Vault and Auth0 for AI Agents cover the delegated-token case in Agent auth and delegated access.
If you build your own server in this space, the MCP elicitation spec is explicit: servers must not use form-mode elicitation to request passwords, API keys, access tokens or payment credentials, and must use URL mode for such interactions. Do not collect a secret by asking the model to relay it.
4. Put a human on every write that matters
- Okta documents elicitation for destructive operations (deletes and deactivations). Clients that support it show the user a confirmation dialog where they can accept, decline or cancel. For clients that do not, the README says the tool returns a JSON payload "so the LLM can relay the confirmation request to the user", which means the model is in the loop; use a client with elicitation, or add an ask rule. The README documents confirmation for destructive operations only, so create and update calls are not covered. Gate those yourself.
- Clerk says change-making tools are flagged so the agent can ask before running them. The flag only helps if your client acts on it; add an ask rule for write tools as well.
- Bitwarden documents no confirmation step. Its tool list includes
device_approval_approve_alland member and policy management. Keep those on the deny list from step 2. - Never auto-approve from a single prompt. A person should see the tool name and arguments for each write.
5. Keep an audit trail you control
- Okta: the
get_logstool needsokta.logs.readand reads Okta's logs. Use a dedicated app registration for the MCP server so its actions can be told apart from a person's (an editorial suggestion, not from the README), and check logs through a path the agent cannot call. - Bitwarden: the README tells you to monitor API usage through your organisation's audit logs and to review logs periodically.
get_org_eventsis the agent-facing tool, so also check the logs outside the agent. - Clerk: the README describes analytics sent to Clerk for each tool call (tool name, success, your Clerk user ID, AI client, and where relevant the application ID and whether it was a dry run), without the tool's other inputs or results. That is telemetry about you, not an audit log for you. Decide whether you accept it before connecting.
- 1Password hooks: telemetry is opt-in and written locally only when
~/.config/1Password/telemetry-enabledexists; the hooks themselves make no network calls, per the README. - Whatever you use, log client-side too: record each tool call and the approval decision, and keep the log somewhere the agent cannot write.
6. Treat the server itself as untrusted code
- Bitwarden's documented config runs
npx -y @bitwarden/mcp-serverwithout a version. Pin an exact version you have read, or clone the repo and run the built file as its second option allows. See Install and vet a vendor skill pack for the review routine. - The MCP security best-practice docs say local MCP servers "may have direct access to the user's system" and may be reachable by other processes on the machine, and list malicious startup commands in client configuration as an attack. Review any MCP config before you accept it.
- They also describe scope minimisation: broad up-front scopes make a stolen token more damaging and audit trails less meaningful, which is the case for the narrow
OKTA_SCOPESabove. - Clerk's pack is an install-time choice.
npx skills add clerk/skillsinstalls skills only; the plugin routes also wire in the hosted MCP server. Its README says the license is MIT, but GitHub's license API showed no detected license on 29 November 2026, so read the license file before you redistribute it. - Output from these servers can contain attacker-controlled text (a user's display name, a log message, a vault note). Treat it as data, not instructions; see Screen tool output for prompt injection.
- Put the agent in a sandbox and restrict its filesystem; confine a coding agent's filesystem MCP shows how.
Pre-flight checklist
- Throwaway tenant or vault, no production data.
- Narrowest scopes or role the task needs; write scopes absent on the first run.
- Deny rules for privilege-changing and secret-reading tools; ask rules for every other write.
- Pinned, reviewed server version; no unreviewed
npx -yof an unpinned package. - No secret value in prompts, tool arguments or config files that are committed or shared.
- Server and agent run on your own machine or in a sandbox; a server whose README says local-only (Bitwarden's) is never exposed on a network.
- A client-side log of tool calls and approvals, plus the vendor's own logs, checked after the run.
- A rollback path: how to revoke the app registration, API key or session token if something goes wrong.
- Rate limits and costs understood. Okta's README notes that use of the server consumes Management API rate limits; vendor plans are separate from these free servers.
Rollout order
- Run the server against a throwaway tenant with read-only scopes and the deny list above.
- List its tools with the MCP Inspector and confirm they match what you expect.
- Ask for read-only reports and review the log.
- Add one write scope at a time, with an ask rule, and approve each call by hand.
- Only then consider unattended use, with Private Key JWT or an equivalent, a dedicated app and alerts on its activity.
What this guide does not cover
It does not test any server, and it does not rank them: Okta and Bitwarden are different products, and the table above compares documentation, not safety. For the OAuth side of connecting to remote servers, see Agent auth and delegated access and Agent identity and MCP authorization platforms. For what MCP authorization requires of a server you build, see the Model Context Protocol entry.
Directory entries in this guide
- Okta MCP Server: Official open-source local MCP server for Okta admin tasks (users, groups, apps, policies, brands) with OAuth device or private-key-JWT auth and scope-based tool loading. Apache-2.0.
- Bitwarden MCP Server: Local-only MCP server in the bitwarden GitHub org giving agents vault and organization-admin access through the Bitwarden CLI and Public API. GPL-3.0; README warns never to host it or expose it.
- Clerk Skills: Clerk's official Agent Skills pack and plugin for Claude Code, Codex, Cursor, Copilot CLI and Antigravity, bundling a hosted Clerk MCP server (mcp.clerk.com/mcp) with per-call analytics.
- 1Password Agent Hooks: 1Password's MIT-licensed hooks for Cursor, Claude Code, GitHub Copilot and Windsurf that validate 1Password setup (such as mounted .env files) before agents run shell or tool commands.
- nono: Open-source agent runtime security tool: kernel-enforced sandboxing for coding agents, their tools, credentials and skills, as one unprivileged binary on macOS, Linux and WSL2. Apache-2.0, pre-1.0.
- Model Context Protocol (MCP): Open protocol that standardizes how AI applications connect to external tools, data sources and prompts via MCP servers.
- MCP Authorization (OAuth 2.1 for MCP): The MCP specification's transport-level authorization flow for HTTP-based MCP servers, based on a subset of OAuth 2.1 and related RFCs.
- MCP Inspector: Official interactive developer tool for testing and debugging MCP servers in the browser, on the command line or in the terminal.
- WorkOS Vault: Developer-friendly enterprise key management (EKM) to encrypt and optionally store tokens, passwords, certificates, files and other customer data.
- Auth0 for AI Agents: Auth0's identity toolkit for AI agents: user authentication, delegated authorization, human-in-the-loop (CIBA) and fine-grained authorization for RAG.
Related
- Agent auth and delegated access, step by step (Guide)
- Agent identity and MCP authorization platforms (Comparison)
- Install and vet a vendor skill pack (Guide)
- Confine a coding agent's filesystem MCP access (Guide)
- Run agent-generated code safely in a sandbox (Guide)
- Screen tool and web output for prompt injection before your agent reads it (Guide)
- Let an agent send email safely through the Resend MCP server (Guide)
Sources
- okta/okta-mcp-server README, accessed
- bitwarden/mcp-server README, accessed
- clerk/skills README, accessed
- 1Password/agent-hooks README, accessed
- 1Password agent-hooks: mounted .env validation hook, accessed
- nolabs-ai/nono README, accessed
- MCP specification 2026-07-28, Elicitation, accessed
- MCP security best practices (2026-07-28), accessed
- Claude Code permissions, accessed
- Clerk MCP server docs, accessed