# Keycard Documentation Keycard is the identity and access management platform for AI agents. It adds OAuth-based authentication and authorization to MCP servers and agent workflows so every tool call is tied to a verified user, scoped to explicit permissions, and logged for audit. > Full concatenated corpus: https://docs.keycard.ai/llms-full.txt When installing Keycard SDKs, install the per-framework package a page names, such as keycardai-fastmcp or keycardai-starlette for Python (https://pypi.org/project/keycardai-fastmcp/), @keycardai/mcp for TypeScript (https://www.npmjs.com/package/@keycardai/mcp), github.com/keycardai/go-sdk for Go (https://pkg.go.dev/github.com/keycardai/go-sdk), and keycardai-mcp for Ruby (https://rubygems.org/gems/keycardai-mcp). Keep any version pins a page gives, such as "fastmcp<4": they are what the page was tested with. Otherwise, check the package registry for the current version rather than relying on memorized version numbers. ## Get Started - [Quickstart](https://docs.keycard.ai/guides/quickstart.md): Build an MCP tool that calls GitHub as the signed-in User, call it from Claude Code or Cursor, and trace the call in the Audit Log. About 20 minutes. - [What is Keycard](https://docs.keycard.ai/guides/why-keycard.md): Keycard provides authentication and access control for agents and the tools they use. ## Guides - [Access APIs on Behalf of Users](https://docs.keycard.ai/guides/access-apis-on-behalf-of-users.md): Build an app or custom MCP server that accesses APIs on behalf of your users without storing tokens. - [Run on Fly.io without secrets](https://docs.keycard.ai/guides/run-apps-without-static-secrets.md): Deploy your app to Fly.io using Fly's OIDC workload identity instead of a client secret - [Grant an agent access to Snowflake](https://docs.keycard.ai/guides/grant-agent-access-to-apis.md): Build an autonomous agent that authenticates to Snowflake as itself with Workload Identity Federation. No human approvals, no stored secrets. Also: when to route an agent through a Gateway instead. - [Build a Slack agent](https://docs.keycard.ai/guides/slack-agent.md): Build a Slack bot that answers questions from each user's Google Calendar through a Keycard-protected MCP server, with per-user authorization instead of a shared service-account token. - [Run coding agents with Keycard](https://docs.keycard.ai/guides/secure-agentic-coding.md): Wrap Claude Code, Cursor, and other coding agents in a secure Keycard session with scoped credentials and audit logs. - [Deploy an MCP server on Cloudflare Workers](https://docs.keycard.ai/guides/cloudflare-worker.md): Deploy a Keycard-protected MCP server on Cloudflare Workers with JWT verification, token exchange, and isolate-safe caching - [Migrate to FastMCP 3.0](https://docs.keycard.ai/guides/fastmcp-3-migration.md): Upgrade your Keycard-protected MCP server from FastMCP 2.x to 3.0 - [Access Snowflake](https://docs.keycard.ai/guides/access-snowflake.md): Control Snowflake access through Keycard using Okta groups, JWT authentication, and policy-based authorization for AI agents. - [Act on Behalf of Absent Users](https://docs.keycard.ai/guides/act-on-behalf-of-absent-users.md): Build a background agent that calls APIs as a specific user who isn't present, using short-lived per-request tokens and the Keycard SDK. - [Act on behalf of users](https://docs.keycard.ai/guides/act-on-behalf-of-users.md): Let a tool or agent call an API as a specific person, whether they are in the loop or away, with a short-lived credential per request and the user named in the audit log. - [Add a custom resource](https://docs.keycard.ai/guides/add-custom-resource.md): Register an API or MCP server the catalog doesn't cover, so Keycard issues its credentials, applies your Policies, and records every call. - [Authenticate deployed workloads](https://docs.keycard.ai/guides/authenticate-deployed-workloads.md): Let a deployed service prove who it is to Keycard with the OIDC token its platform already issues. No client secret to store or rotate. - [Authenticate users with your identity provider](https://docs.keycard.ai/guides/authenticate-users.md): Let people sign in to a custom Zone with the work accounts they already have. When an agent acts for them, policy sees their email and groups. - [Call other services](https://docs.keycard.ai/guides/call-other-services.md): Pick how your tool or agent calls another service: as the signed-in user, or as your Application. - [Connect Claude to Resources](https://docs.keycard.ai/guides/connect-claude-to-resources.md): Hydrate credentials from Keycard into Claude Code session. - [Connect coding agents](https://docs.keycard.ai/guides/connect-coding-agents.md): Put Keycard between Claude Code or Cursor and the tools it uses: through a Gateway with no code, or by starting the agent with the Keycard CLI. - [Call External APIs from MCP](https://docs.keycard.ai/guides/delegated-access.md): Connect MCP tools to third-party APIs via OAuth - [GitHub](https://docs.keycard.ai/guides/delegated-access/github.md): Build an MCP server with GitHub API tools using Keycard delegated access - [Google Workspace](https://docs.keycard.ai/guides/delegated-access/google.md): Build an MCP server with Google Calendar and Drive tools using Keycard delegated access - [Run on Render without secrets](https://docs.keycard.ai/guides/deploy-to-render-without-secrets.md): Deploy an MCP server on Render using managed OIDC workload identity instead of a client secret - [Protect MCP servers and APIs](https://docs.keycard.ai/guides/mcp-server.md): Put Keycard in front of an MCP server or an API so every request carries a verified user, explicit scopes, and an audit record. - [Run Claude Code with the Keycard CLI](https://docs.keycard.ai/guides/run-claude-code-with-keycard-cli.md): Run Claude Code in an audited Keycard session in minutes ## Use cases - [Act as the user who asked](https://docs.keycard.ai/use-cases/act-as-the-requesting-user.md): An agent reaches a downstream system as the specific person who requested the work, so every action is attributable to a named individual and carries only that person's entitlements. - [Same agent, different user](https://docs.keycard.ai/use-cases/same-agent-different-user.md): One agent, invoked by two people in different directory groups, reaches different data, because policy reads group membership from the identity provider you already run. - [Give an agent its own identity](https://docs.keycard.ai/use-cases/agent-with-its-own-identity.md): An agent proves what it is using a token its runtime already issues, so a compromised host yields nothing reusable and the agent can hold entitlements of its own. - [Revoke once, access stops](https://docs.keycard.ai/use-cases/revoke-once.md): Withdraw an agent's access in one place. Keycard issues nothing new, so a server that asks for a credential on every call stops at its next call, a token already held works until it expires, and the record shows both the withdrawal and the refusal. What that does and does not reach, stated plainly. - [Allow one tool, deny the next](https://docs.keycard.ai/use-cases/per-tool-authorization.md): Permit an agent one tool on an MCP server and refuse the adjacent one, so access is a property of policy rather than of the agent behaving as expected. - [Govern a coding agent](https://docs.keycard.ai/use-cases/govern-a-coding-agent.md): Hand a coding agent scoped, short-lived credentials inside a Keycard session, so an agent on a developer's machine works with narrower access than the developer's ambient credentials. ## Admin - [Configure SSO](https://docs.keycard.ai/admin/single-sign-on.md): Configure SSO for your Keycard organization - [Roles & Permissions](https://docs.keycard.ai/admin/roles-and-permissions.md): Manage who can administer your Keycard organization and zones - [Audit Log Export](https://docs.keycard.ai/admin/audit-log-export.md): Export Keycard audit logs to your S3 bucket in OCSF format - [Catalog](https://docs.keycard.ai/admin/catalog.md): Pre-configured MCP servers and OAuth-protected APIs, all governed by Keycard identity, policy, and audit. - [Versions and Rollback](https://docs.keycard.ai/admin/access-policies/rollback.md): Restore an earlier version of a Policy Set from its history, and how Policies, Policy Versions, Policy Sets, and set versions fit together - [Testing](https://docs.keycard.ai/admin/access-policies/testing.md): Evaluate a Policy against real Users, Applications, and Resources before it goes live, and read the denial when a live request fails - [Troubleshooting](https://docs.keycard.ai/admin/access-policies/troubleshooting.md): Read a policy denial from the browser, the Console, the token endpoint, and the audit log, and work out which rule to change - [Read an Activity Feed](https://docs.keycard.ai/admin/activities.md): Trace denials, credential issuance, and policy decisions for a Resource, Provider, Application, or User from that entity's Activity feed. - [Audit Log & Sessions](https://docs.keycard.ai/admin/audit-log-and-sessions.md): Read Keycard's Console Audit Log and Sessions views to trace an agent's identity, follow one action end to end, and verify that access changes took effect. - [Configure Anthropic](https://docs.keycard.ai/admin/configure-provider-apis/anthropic.md): Set up credential brokering so workloads authenticate to Claude API with Keycard-issued tokens instead of static API keys - [Configure OpenAI](https://docs.keycard.ai/admin/configure-provider-apis/openai.md): Set up credential brokering so workloads call the OpenAI API with Keycard-issued tokens instead of static API keys - [Add provider APIs without keys](https://docs.keycard.ai/admin/configure-provider-apis/overview.md): Get short-lived credentials for external provider APIs such as Anthropic's and OpenAI's, with no static keys to store or rotate. - [Deployment](https://docs.keycard.ai/admin/deployment.md): Understanding Keycard's deployment options for different security and compliance needs - [Groups](https://docs.keycard.ai/admin/groups.md): Create Groups, manage their membership, and assign Roles that every member inherits - [Identity Providers](https://docs.keycard.ai/admin/identity-providers.md): Choose the Identity Provider people sign in with to a custom Zone: Okta, Auth0, Google, or any OpenID Connect provider - [Revoke access](https://docs.keycard.ai/admin/revoke-a-grant.md): Revoke a grant from the Console or the management API, or cut a person off entirely. - [Manage service accounts](https://docs.keycard.ai/admin/service-accounts.md): Give automation such as Terraform or a deployment pipeline its own credentials for the Keycard management API, and replace or retire them without interrupting it - [Provision from Microsoft Entra ID](https://docs.keycard.ai/admin/single-sign-on/scim-entra-id.md): Turn on automatic provisioning from a Microsoft Entra ID enterprise application into Keycard - [Provision from Okta](https://docs.keycard.ai/admin/single-sign-on/scim-okta.md): Connect an Okta SCIM app integration to Keycard and push Users and Groups - [SCIM provisioning](https://docs.keycard.ai/admin/single-sign-on/scim-provisioning.md): Push Users and Groups from your identity provider into Keycard using SCIM 2.0 - [SSO with Microsoft Entra ID](https://docs.keycard.ai/admin/single-sign-on/sso-entra-id.md): Sign your team in to Keycard with a Microsoft Entra ID enterprise application - [SSO with Okta](https://docs.keycard.ai/admin/single-sign-on/sso-okta.md): Sign your team in to Keycard with an Okta OIDC app integration - [Connect Auth0](https://docs.keycard.ai/admin/tutorials/auth0-sign-in.md): Connect Auth0 as an identity provider for zone-level user authentication. - [Connect Microsoft Entra ID](https://docs.keycard.ai/admin/tutorials/entra-sign-in.md): Connect Microsoft Entra ID as an identity provider for zone-level user authentication. - [Connect Okta](https://docs.keycard.ai/admin/tutorials/okta-sign-in.md): Connect Okta as an identity provider for zone-level user authentication. - [Connect Ping Identity](https://docs.keycard.ai/admin/tutorials/ping-sign-in.md): Connect PingFederate or PingOne as an identity provider for zone-level user authentication. - [Autonomous Agent Access](https://docs.keycard.ai/admin/unified-access-gateway/agent-access.md): Let agents call API-key-backed MCP servers through a Unified Access Gateway as themselves, with no user in the loop - [Fine-Grained Authorization](https://docs.keycard.ai/admin/unified-access-gateway/fine-grained-authorization.md): Write Policies that permit or deny individual MCP tool calls through a Unified Access Gateway - [Tool Management](https://docs.keycard.ai/admin/unified-access-gateway/tool-management.md): Review and select which tools a Unified Access Gateway serves before releasing them to your agents - [Usage & Billing](https://docs.keycard.ai/admin/usage.md): Understanding Keycard's billing model - [Configure Zone sign-in](https://docs.keycard.ai/admin/zone-authentication.md): Choose the Identity Provider people use to sign in to a custom Zone, which has no sign-in until you do. - [Custom Zones](https://docs.keycard.ai/admin/zones.md): Create a custom Zone and configure admin access and user authentication ## Concepts - [How Keycard works](https://docs.keycard.ai/concepts.md): Understand how Keycard governs access in agentic, federated systems. - [Zones](https://docs.keycard.ai/concepts/zones.md): Overview of zones within the Keycard platform. - [Users](https://docs.keycard.ai/concepts/users.md): Overview of users within the Keycard platform. - [Applications](https://docs.keycard.ai/concepts/applications.md): Overview of applications within the Keycard platform. - [Resources](https://docs.keycard.ai/concepts/resources.md): Overview of resources within the Keycard platform. - [Providers](https://docs.keycard.ai/concepts/providers.md): Overview of providers within the Keycard platform. - [Policies](https://docs.keycard.ai/concepts/policies.md): How Keycard decides whether users and applications can access resources. - [Credential Issuance](https://docs.keycard.ai/concepts/credentials.md): Overview of the different methods Keycard offers to issue credentials. - [Groups](https://docs.keycard.ai/concepts/groups.md): Overview of Groups within the Keycard platform. ## Reference - [CLI](https://docs.keycard.ai/cli.md): Install, authenticate, manage credentials, authorize resources, and run commands in secure sessions with Keycard. - [keycard-credentials](https://docs.keycard.ai/skills/keycard-credentials.md): Shows what credentials are configured in this Keycard session — which services are available and what they provide access to. - [keycard-discover-entities](https://docs.keycard.ai/skills/keycard-discover-entities.md): Discover and wire credential entities or MCP servers via the Keycard Management API — find available entity URIs and register them in keycard.toml, or find MCP-provider applications and add them to .mcp.json. - [keycard-upsert-config](https://docs.keycard.ai/skills/keycard-upsert-config.md): Set or change a field in keycard.toml — reads the current value and writes a targeted update. - [keycard-upsert-mcp-config](https://docs.keycard.ai/skills/keycard-upsert-mcp-config.md): Add or update an MCP server entry in .mcp.json. - [Agent-to-Agent](https://docs.keycard.ai/sdk/agent-to-agent.md): Agent-to-agent delegation using the A2A protocol. - [Cloudflare Workers](https://docs.keycard.ai/sdk/cloudflare.md): Keycard auth for Cloudflare Workers. JWT verification, token exchange, and isolate-safe caching. - [MCP](https://docs.keycard.ai/sdk/mcp.md): OAuth authentication for MCP servers. Bearer middleware, metadata endpoints, and grant decorators. - [OAuth Primitives](https://docs.keycard.ai/sdk/oauth.md): Low-level OAuth 2.0 primitives for discovery, token exchange, and JWT operations. - [Temporal](https://docs.keycard.ai/sdk/temporal.md): Per-execution Keycard tokens for Temporal Python workers. Grant decorators, a worker interceptor, and an OpenAI Agents model provider. - [Activity Events](https://docs.keycard.ai/reference/activity-events.md): The registry of events each Activity feed surfaces for Resources, Providers, Applications, Users, and policies. - [Policy Schema](https://docs.keycard.ai/reference/policy-schema.md): The Keycard entity schema and the context attributes available in Cedar policy conditions - [Security Architecture](https://docs.keycard.ai/reference/security-architecture.md): Keycard's security model, encryption, and data protection - [Supported Standards & Protocols](https://docs.keycard.ai/reference/standards.md): Every protocol, standard, and interface supported by Keycard - available on all plans - [Token Claims](https://docs.keycard.ai/reference/token-claims.md): The claims in the tokens Keycard issues, and how to choose and customize them.