# Principal Documentation > Official documentation for Principal by Palark (https://iamprincipal.io/): a self-hosted control plane for native production permissions across PostgreSQL, MariaDB, ClickHouse, MongoDB, Kubernetes, SSH hosts, Grafana, OpenSearch, and internal web apps. Built by Palark GmbH in Germany and not related to the "principal" entity of AWS IAM or Google Cloud IAM. Principal operates out of the data path: it creates, reconciles, and expires native roles directly in each target instead of proxying SQL or SSH traffic, pairs with bundled Dex SSO for Kubernetes and internal web apps, supports RFC 8693 token exchange for CI pipelines and MCP for AI agents, and exports audit evidence for DORA, NIS2, ISO/IEC 27001, PCI DSS, and SOC 2. Installation is one Helm chart on Kubernetes 1.29+ with PostgreSQL 15+. ## Overview - [Welcome](https://docs.iamprincipal.io/): Principal gives people access to databases, Kubernetes clusters and SSH hosts from one place, checks that the systems match, and records every change. - [What is Principal](https://docs.iamprincipal.io/overview/what-is-principal/): Principal is a self-hosted platform that manages access to databases, Kubernetes clusters and SSH hosts. You declare who gets which permissions. Principal creates native accounts and grants in each system, checks them for drift and records every change. - [How Principal works](https://docs.iamprincipal.io/overview/how-it-works/): The control loop, components and safety rules behind Principal access management. - [Deployment](https://docs.iamprincipal.io/overview/deployment/): Private Helm chart access, prerequisites, availability modes, PostgreSQL connection budgets and proxy settings. - [Supported systems](https://docs.iamprincipal.io/overview/supported-systems/): Targets, identity sources and sign-in methods. - [Supported versions](https://docs.iamprincipal.io/overview/supported-versions/): The versions of each target that Principal is tested on, and the versions it refuses when you add a target. - [Glossary](https://docs.iamprincipal.io/overview/glossary/): Core Principal terms. ## Get started - [Quick start](https://docs.iamprincipal.io/getting-started/): Connect an identity provider, add a test PostgreSQL server, apply a read-only group rule and check the result in Principal and psql. Plan about 30 minutes. - [API quick start](https://docs.iamprincipal.io/getting-started/api-quick-start/): Create a token and grant access with curl. - [Put an application behind the SSO gate](https://docs.iamprincipal.io/getting-started/sso-gate-api/): Discover a Kubernetes Ingress, adopt it, deploy the SSO gate and grant access via API. ## How-to guides - [How-to guides](https://docs.iamprincipal.io/how-to/): Step-by-step console and API guides by job. - [Onboard a new employee](https://docs.iamprincipal.io/how-to/onboard-a-new-employee/): Add a new employee, assign their groups and rules, and verify their target credentials. - [Offboard a person who leaves](https://docs.iamprincipal.io/how-to/offboard-a-person/): Close a departing user's target accounts, console access, API tokens and application sign-in, then verify nothing remains. - [Give temporary access](https://docs.iamprincipal.io/how-to/give-temporary-access/): Grant time-boxed access to a person or service account, adjust expiry while active and auto-revoke on end. - [Revoke access now](https://docs.iamprincipal.io/how-to/revoke-access-now/): Close one person's access to a target immediately, including group rules, and verify removal. - [See who has access to a target](https://docs.iamprincipal.io/how-to/see-who-has-access/): List every account on a target, trace its rules, and export an access review report. - [Show or rotate credentials](https://docs.iamprincipal.io/how-to/show-or-rotate-credentials/): Reveal your target password or kubeconfig, view a colleague's credentials as admin, or rotate a leaked password. - [Add people and groups by hand](https://docs.iamprincipal.io/how-to/add-people-and-groups/): Create users individually or up to 500 from emails, manage manual groups and create service accounts. - [Add a member to an organization](https://docs.iamprincipal.io/how-to/add-a-member-to-an-organization/): Grant console access to an organization with a built-in role and optional custom role. - [Create a rule](https://docs.iamprincipal.io/console/create-rule/): Give people, groups or service accounts access to a target from one form. - [Apply a rule](https://docs.iamprincipal.io/console/rule-details/): Preview target changes, apply a saved plan, stop a run or resolve apply failures. - [Change the permissions of a rule](https://docs.iamprincipal.io/how-to/change-a-rule/): Edit a custom rule, detach from a template, update a template's rules or merge a second template. - [Create a template](https://docs.iamprincipal.io/how-to/create-a-template/): Define a reusable permission set once and assign it to people or groups with rules. - [Move rules to a new template version](https://docs.iamprincipal.io/how-to/move-rules-to-a-new-template-version/): Edit a template, preview diffs and roll rules to the new version. - [Prepare a target](https://docs.iamprincipal.io/console/prepare-target/): Create Principal's service account on a database or Kubernetes cluster before adding the target. - [Add a target](https://docs.iamprincipal.io/console/add-target/): Connect a database, Kubernetes cluster or SSH host: choose engine, enter credentials and test. - [Bring an existing database under management](https://docs.iamprincipal.io/how-to/bring-a-database-under-management/): Connect a database in observe mode, discover accounts, adopt them into Principal and verify drift. - [Fix a difference between a target and its rules](https://docs.iamprincipal.io/how-to/fix-drift/): Detect drift, re-apply rules, remove extra access or mark a difference as expected. - [Finish an operation that waits for you](https://docs.iamprincipal.io/how-to/finish-a-waiting-operation/): Retry a failed job, answer a cleanup prompt or cancel a bulk action. - [Sign in](https://docs.iamprincipal.io/console/sign-in/): Sign in to the console or a Principal-protected application through an enabled method and confirm your second factor. - [Set up two-factor authentication](https://docs.iamprincipal.io/how-to/set-up-two-factor-authentication/): Enroll an authenticator app or security key and save your one-time recovery codes. - [Require two-factor authentication](https://docs.iamprincipal.io/how-to/require-two-factor-authentication/): Require everyone, or admins and chosen users, to enroll a second factor at next sign-in. - [Create an API token](https://docs.iamprincipal.io/how-to/create-an-api-token/): Issue a personal or organization bearer token for scripts, CI pipelines or AI agents. - [Replace or revoke an API token](https://docs.iamprincipal.io/how-to/replace-or-revoke-an-api-token/): Revoke a leaked token, rotate its secret, or take over an organization token. - [Let a program sign in with its own token](https://docs.iamprincipal.io/how-to/let-a-program-sign-in-with-its-token/): Trust an OIDC token on a service account for passwordless CI, pod or agent sign-in. - [Put a web application behind Principal sign-in](https://docs.iamprincipal.io/how-to/protect-a-web-application/): Protect a Kubernetes web app (such as Grafana) behind Principal sign-in so only matched users enter. - [Connect an identity provider](https://docs.iamprincipal.io/how-to/connect-an-identity-provider/): Sync users and groups from GitLab, GitHub, Google Workspace or LDAP so access follows group membership. - [Approve a sync that would remove people](https://docs.iamprincipal.io/how-to/approve-a-connector-sync/): Review a sync held by the 10% removal guardrail, then approve deletions or fix the cause. - [Delete a connector](https://docs.iamprincipal.io/how-to/delete-a-connector/): Remove a connector and decide whether synced people and groups stay. - [Get alerts in Slack](https://docs.iamprincipal.io/how-to/get-alerts-in-slack/): Send failed applies, drift and sync alerts to Slack, and subscribe to Activity views. - [Find who changed something](https://docs.iamprincipal.io/how-to/find-who-changed-something/): Trace a change in Activity: actor, time and result. - [Create an access report](https://docs.iamprincipal.io/how-to/create-an-access-report/): Generate a PDF, CSV or JSON report of current access and audit changes for compliance or reviews. - [Connect an AI agent through MCP](https://docs.iamprincipal.io/how-to/connect-an-ai-agent/): Connect Claude Code, Cursor or another MCP client to read or manage Principal. - [Give a CI pipeline a token that does one job](https://docs.iamprincipal.io/how-to/create-a-ci-token-with-its-own-role/): Create a single-purpose custom role and issue a short-lived organization token for CI. - [Grant access from an integration](https://docs.iamprincipal.io/how-to/grant-access-from-an-integration/): Grant access in one API call and report only after apply succeeds. - [Read a whole list through the API](https://docs.iamprincipal.io/how-to/read-a-whole-list/): Page through an API list via next_cursor until has_more is false. - [Connect a target in a private network](https://docs.iamprincipal.io/how-to/connect-a-target-in-a-private-network/): Reach a private target through a bastion host using an SSH key and tunnel. - [Create a custom role](https://docs.iamprincipal.io/how-to/create-a-custom-role/): Define a permission set and assign it to organization members, groups or API tokens. ## Concepts - [Organizations and roles](https://docs.iamprincipal.io/concepts/organizations-and-roles/): Every object belongs to one organization. Built-in, custom and direct group roles add up to define member access. - [Identities](https://docs.iamprincipal.io/concepts/identities/): The kinds of identities Principal manages, where they come from, how rules attach and what deletion does. - [Connectors](https://docs.iamprincipal.io/concepts/connectors/): How identity provider syncs update people, groups and access, stop mass removals and match existing accounts. - [Targets](https://docs.iamprincipal.io/concepts/targets/): A target is one managed system: database server, Kubernetes cluster or SSH host. Service-account rights, Managed vs. Observe mode, ownership boundaries and Kubernetes behavior. - [Rules and templates](https://docs.iamprincipal.io/concepts/rules-and-templates/): A rule binds one identity to permissions on one target. A template is a versioned permission set shared across rules. - [Temporary access](https://docs.iamprincipal.io/concepts/temporary-access/): A rule with a TTL grants personal access for 15 minutes to 30 days and deletes itself automatically at expiry. - [Plan and apply](https://docs.iamprincipal.io/concepts/plan-and-apply/): Principal changes targets in two steps: a plan previews exact operations and risk, and an apply runs them in the background. - [Discovery and adoption](https://docs.iamprincipal.io/concepts/discovery-and-adoption/): How discovery reads targets, why unmanaged accounts stay untouched and how adoption brings existing accounts under rules. - [Drift](https://docs.iamprincipal.io/concepts/drift/): How Principal detects target-rule differences, handles hand-granted access per engine and tracks acceptance. - [Credentials](https://docs.iamprincipal.io/concepts/credentials/): How Principal stores, rotates and delivers database passwords, kubeconfigs and Principal passwords. - [Audit](https://docs.iamprincipal.io/concepts/audit/): What the audit log records, who appears as actor, what stays out and how reports read it. - [Security](https://docs.iamprincipal.io/concepts/security/): How Principal protects sign-in, step-up actions, API tokens, credential reveals, AI agents and organization boundaries. - [Background operations](https://docs.iamprincipal.io/concepts/background-jobs/): How Principal runs long operations as background jobs: lifecycle, retries, restarts, retention, live updates and locking. ## Console reference - [Console tour](https://docs.iamprincipal.io/console/): Layout, navigation and shared controls across the Principal web console. - [Dashboard](https://docs.iamprincipal.io/console/dashboard/): Shows what needs a decision right now: failed applies, drift, unhealthy systems and recent operations. - [First setup](https://docs.iamprincipal.io/console/first-setup/): A new organization opens with a short wizard: connect a server, bring people in, give the first access and choose how often Principal checks. You can leave at any step and come back. - [People](https://docs.iamprincipal.io/console/people/): Users, groups and service accounts from connectors or created manually. - [Identity details](https://docs.iamprincipal.io/console/identity-details/): Side card for a person, group or service account in People: effective access, memberships, sign-in methods and actions. - [Connectors](https://docs.iamprincipal.io/console/connectors/): Import people and groups from your identity provider, monitor syncs and resolve duplicates. - [Resources](https://docs.iamprincipal.io/console/resources/): Targets (databases, Kubernetes, SSH hosts), SSH tunnels and SSH keys. - [Target details](https://docs.iamprincipal.io/console/target-details/): Discovered accounts, ownership, access patterns, databases and history for a target, plus Kubernetes applications. - [Applications](https://docs.iamprincipal.io/console/applications/): Protect web applications in Kubernetes clusters behind Principal sign-in and manage who gets in with rules. - [Token exchange](https://docs.iamprincipal.io/console/token-exchange/): Exchange a workload's OIDC JWT for an application token as a service account. - [Rules](https://docs.iamprincipal.io/console/rules/): Lists every access rule and its apply state. Open a rule for its access map, expiry and history. - [Templates](https://docs.iamprincipal.io/console/templates/): Reusable permission sets in the Templates tab of Rules & templates. Rules upgrade together to new versions. - [Drift](https://docs.iamprincipal.io/console/drift/): Lists differences between targets and rules. Apply rules to resync, remove unruled grants, or keep expected differences. - [Activity](https://docs.iamprincipal.io/console/activity/): Timeline of organization operations, changes and sign-in events. - [Reports](https://docs.iamprincipal.io/console/reports/): Generate PDF, CSV or JSON reports combining current access state and audit activity. - [Report file format](https://docs.iamprincipal.io/console/report-format/): CSV and JSON audit report schemas, jq queries and report API options. - [Notification channels](https://docs.iamprincipal.io/console/notification-channels/): Route Principal events to Slack channels, send tests and resend failed deliveries. - [Your access](https://docs.iamprincipal.io/console/your-access/): View and copy credentials for your own accounts. Members with the User role see only this page. - [Account security](https://docs.iamprincipal.io/console/account-security/): Sign-in methods, second factor and recovery codes (profile menu → Security). - [API tokens](https://docs.iamprincipal.io/console/api-tokens/): Personal and organization API tokens for scripts, CI and integrations. - [AI agents](https://docs.iamprincipal.io/console/ai-agents/): Connect Claude Code, Cursor and other MCP clients with scoped personal tokens. Open from profile menu or navigation → AI agents. - [Organizations](https://docs.iamprincipal.io/console/organizations/): Separate workspaces with their own members, built-in and custom roles, group roles and security policies. - [Installation health](https://docs.iamprincipal.io/console/installation-health/): Status of Principal's database, secret store, Dex, admission controller, jobs and org blockers. - [Sign-in page](https://docs.iamprincipal.io/console/sign-in-page/): Configure branding, copy, field hints, contact link and sign-in methods for all organizations. ## API reference - [API overview](https://docs.iamprincipal.io/api/): Base URL, auth, naming map, and conventions for the Principal REST API. - [Authentication](https://docs.iamprincipal.io/api/authentication/): Authenticate scripts with API tokens and browsers with session cookies and CSRF headers. - [MCP for AI agents](https://docs.iamprincipal.io/api/mcp/): Connect AI agents to Principal over Streamable HTTP MCP with an API token. - [Errors](https://docs.iamprincipal.io/api/errors/): Problem JSON format, error codes, validation rules, and conflict payloads. - [Lists and pages](https://docs.iamprincipal.io/api/lists/): Cursor pagination format, limit rules, and unpaged responses. - [Async operations](https://docs.iamprincipal.io/api/async-operations/): Long work returns 202 with a job ID. Poll until terminal and retry safely with Idempotency-Key. - [Permissions](https://docs.iamprincipal.io/api/permissions/): Permission and API token support per operation, generated from backend routes. - [Identities](https://docs.iamprincipal.io/api/endpoints/identities/): People, groups and service accounts: directory, group membership, effective access, credentials and MFA. - [Rules](https://docs.iamprincipal.io/api/endpoints/rules/): Rules (called policies in the API): permissions on targets, plans and apply. - [Templates](https://docs.iamprincipal.io/api/endpoints/templates/): Templates (called access templates in the API): versioned permission sets shared by rules. - [Plans](https://docs.iamprincipal.io/api/endpoints/plans/): Execute a saved plan exactly as planned, and nothing else. - [Apply runs](https://docs.iamprincipal.io/api/endpoints/apply-runs/): Execution history of rule applies: target, job, status and step results. - [Grants](https://docs.iamprincipal.io/api/endpoints/grants/): Create a rule and queue its apply in one idempotent call. - [Access profiles](https://docs.iamprincipal.io/api/endpoints/access-profiles/): Access patterns Principal discovers on a target and adopts into rules or templates. - [Targets](https://docs.iamprincipal.io/api/endpoints/targets/): Managed databases, Kubernetes clusters, SSH hosts and Kubernetes web applications. - [Applications](https://docs.iamprincipal.io/api/endpoints/applications/): Web applications on Kubernetes clusters: Ingress discovery, sign-in and URLs. - [Connectors](https://docs.iamprincipal.io/api/endpoints/connectors/): GitLab, GitHub, Google Workspace and LDAP connectors and sync runs. - [SSH tunnels](https://docs.iamprincipal.io/api/endpoints/ssh-tunnels/): SSH tunnels to reach private-network targets through a bastion host. - [SSH keys](https://docs.iamprincipal.io/api/endpoints/ssh-keys/): SSH key pairs for bastion tunnels: private key in OpenBao, public key on the bastion. - [Drift](https://docs.iamprincipal.io/api/endpoints/drift/): Drift checks comparing targets with rules: findings and fixes. - [Audit](https://docs.iamprincipal.io/api/endpoints/audit/): Organization audit log: events, filters, histogram and asynchronous reports. - [Notifications](https://docs.iamprincipal.io/api/endpoints/notifications/): Notification channels for Slack and SMTP email, subscriptions and delivery history. - [Dashboard](https://docs.iamprincipal.io/api/endpoints/dashboard/): Summary metrics and recent activity behind the console dashboard. - [Jobs](https://docs.iamprincipal.io/api/endpoints/jobs/): Cleanup tasks that revoke access when a rule or identity is removed. - [Activity](https://docs.iamprincipal.io/api/endpoints/activity/): The feed of operations with filter counts, and the bell of the signed-in person. - [Bulk actions](https://docs.iamprincipal.io/api/endpoints/bulk-operations/): One action on many picked rows: preview, confirm, progress and retry. - [Live events](https://docs.iamprincipal.io/api/endpoints/events/): Server-Sent Events stream pushing job, discovery, drift and apply updates to the console. - [Sign-in and session](https://docs.iamprincipal.io/api/endpoints/auth/): Console sign-in, sessions, MFA and internal Dex and Kubernetes endpoints. - [API tokens](https://docs.iamprincipal.io/api/endpoints/api-tokens/): Issue, rotate, take over and revoke API tokens, and read token policy. - [MCP](https://docs.iamprincipal.io/api/endpoints/mcp/): The Model Context Protocol endpoint through which AI agents use the API with a token. - [Organizations](https://docs.iamprincipal.io/api/endpoints/organizations/): Organizations, security policies, trusted networks, custom roles and group roles. - [Memberships](https://docs.iamprincipal.io/api/endpoints/memberships/): Organization memberships, roles and target memberships. - [Installation admin](https://docs.iamprincipal.io/api/endpoints/admin/): Installation health, maintenance, sign-in, jobs and operator attention. - [Catalog](https://docs.iamprincipal.io/api/endpoints/catalog/): Global reference data: canonical privilege lists per engine. - [Models](https://docs.iamprincipal.io/api/models/): All 630 request and response schemas of the API. Field types link to their models. ## Optional - [Full curated docs (llms-full.txt)](https://docs.iamprincipal.io/llms-full.txt): single-file Markdown bundle of curated guides, concepts, console reference, and API overviews - [Product overview](https://iamprincipal.io/): positioning, comparisons, and DORA access review guide - [Product llms.txt](https://iamprincipal.io/llms.txt): short product summary and comparison pages - [Live sandbox](https://demo.iamprincipal.io/): isolated Principal demo workspace, no sign-up - [Public GitHub overview & MCP setup](https://github.com/palark/principal): README, MCP client snippets, and public issue tracker - [Palark](https://palark.com/): the company behind Principal