Use this skill whenever the user needs to operate a Kubernetes cluster — list/inspect pods, deployments, statefulsets, daemonsets, replicasets, jobs, cronjobs, services, ingresses, endpoints, configmaps, secrets (names/keys only), PVCs/PVs/storageclasses, nodes, namespaces, and events; read pod logs; describe pods/nodes; pod/node top (metrics); read-only diagnostics / RCA (pod-health, workload-readiness); scale deployments/statefulsets; rollout status/history/undo/pause/resume and set image; delete pods/deployments/jobs; create/delete namespaces; and cordon/uncordon/drain nodes. Works with any kubeconfig-reachable cluster (standard Kubernetes, k3s, EKS, GKE, AKS). Always use this skill for "list k8s pods", "scale deployment", "kubernetes pod logs", "describe pod", "why is my pod crashing", "diagnose pods", "which deployments are unhealthy", "rollout undo", "set image", "top pods", "drain node", "cordon node", "restart deployment", "k3s", or "kubectl"-style tasks when the context is exp
Memory
identity-aiops
Try itUse this skill whenever the user needs to operate a Keycloak or authentik identity provider — a one-shot overview, realm settings, users with sessions/credentials/groups/lockout status, authentication and admin events, OAuth/OIDC clients, four flagship RCAs (login-failure/lockout-storm, stale access, client misconfiguration, MFA coverage), and governed writes (disable/enable a user, revoke sessions, require a password reset, replace redirect URIs, rotate a client secret). Always use this skill for "Keycloak", "authentik", "realm", "SSO users", "login failures", "brute force logins", "locked out users", "stale accounts", "service account misuse", "redirect URI", "PKCE", "implicit flow", "client secret rotation", "MFA coverage", "who has no 2FA" when the context is a Keycloak/authentik IdP. Do NOT use when the target is something other than a Keycloak/authentik identity provider (a hypervisor, storage appliance, backup product, container-orchestration cluster, firewall, database, or OT/i
What it does
Use this skill whenever the user needs to operate a Keycloak or authentik identity provider — a one-shot overview, realm settings, users with sessions/credentials/groups/lockout status, authentication and admin events, OAuth/OIDC clients, four flagship RCAs (login-failure/lockout-storm, stale access, client misconfiguration, MFA coverage), and governed writes (disable/enable a user, revoke sessions, require a password reset, replace redirect URIs, rotate a client secret). Always use this skill for "Keycloak", "authentik", "realm", "SSO users", "login failures", "brute force logins", "locked out users", "stale accounts", "service account misuse", "redirect URI", "PKCE", "implicit flow", "client secret rotation", "MFA coverage", "who has no 2FA" when the context is a Keycloak/authentik IdP. Do NOT use when the target is something other than a Keycloak/authentik identity provider (a hypervisor, storage appliance, backup product, container-orchestration cluster, firewall, database, or OT/industrial equipment) — route those to the appropriate other AIops-tools skill. Cloud IdPs (Okta, Entra ID, Auth0) are out of scope. Governed identity operations with a built-in governance harness (audit, policy, token budget, undo, risk-tiers).
The skill document
Identity AIops
Disclaimer: Community-maintained open-source project, not affiliated with, endorsed by, or sponsored by the Keycloak project, Red Hat, Authentik Security Inc., or the authentik project. Keycloak and authentik are trademarks of their respective owners. Source at github.com/AIops-tools/Identity-AIops under the MIT license.
Governed identity operations — 29 MCP tools across Keycloak (admin REST
/admin/realms/{realm}/...) and authentik (API v3 /api/v3/...), every one
wrapped with the bundled @governed_tool harness: a local unified audit log
under ~/.identity-aiops/, policy engine, token/runaway budget guard,
undo-token recording, and risk-tier labelling on the audit row. A per-target
platform field selects the API shape, so the same tools work on both IdPs and
one config can span a mixed estate. The Keycloak client secret / authentik API
token is stored encrypted (~/.identity-aiops/secrets.enc, Fernet +
scrypt) — never plaintext on disk.
Standalone: the governance harness is bundled in the package (
identity_aiops.governance) — no external skill-family dependency. Both platforms are free/self-hostable, so a self-hosted lab is the cheapest live check; verification status and the checklist are indocs/VERIFICATION.md.
What This Skill Does
| Group | Tools | Count | R/W |
|---|---|---|---|
| Realm / system | identity_overview, realm_info, list_identity_providers | 3 | read |
| Users / groups | list_users, user_detail, user_count, user_sessions, user_credentials, list_groups, group_members, user_lockout_status | 8 | read |
| Events | login_events, admin_events | 2 | read |
| Clients | list_clients, client_detail, client_sessions, client_session_stats | 4 | read |
| Flagship analyses | login_failure_rca, stale_access_audit, client_misconfig_audit, mfa_coverage_analysis | 4 | read |
| Writes | disable_user, revoke_user_sessions, require_password_reset | 3 | write (med) |
| Writes | enable_user, update_client_redirect_uris, rotate_client_secret | 3 | write (high) |
| Undo | undo_list, undo_apply | 2 | read + replay |
The four flagship analyses are transparent heuristics that report their numbers,
never a black-box verdict: login_failure_rca windows the failed-auth feed by
user/IP/client and separates password spray, targeted brute-force, a stale
stored credential, a misconfigured client, an expired-credential storm, and a
lockout storm; stale_access_audit flags dormant and never-used accounts,
interactive service accounts, and orphaned sessions; client_misconfig_audit
ranks clients by OAuth-BCP risk (wildcard/http redirects, secrets in public
clients, implicit flow, missing PKCE, password grant); mfa_coverage_analysis
reports second-factor coverage overall and per group.
Quick Install
uv tool install identity-aiops
identity-aiops init # wizard: pick platform (keycloak/authentik) + encrypted secret
identity-aiops doctor
When to Use This Skill
- Get a one-shot snapshot (
overview/realm_info/user_count) - Triage a login-failure or lockout storm (
login_failure_rca) → cause + action - Run an access re-certification (
stale_access_audit: idle users, never-logged-in accounts, service-account misuse, orphaned sessions) - Audit OAuth clients (
client_misconfig_audit: redirect URIs, PKCE, implicit flow, password grant) and fix them (update_client_redirect_uris) - Measure and close the MFA gap (
mfa_coverage_analysis,user_credentials) - Contain a compromised account (
disable_user+revoke_user_sessions+require_password_reset, all governed; re-enable is tagged high risk) - Rotate a leaked client secret (
rotate_client_secret, high risk, masked)
Do NOT use when the target is not a Keycloak/authentik IdP — route hypervisor, storage, backup, cluster, network/firewall, database, endpoint, or OT/industrial work to the appropriate other AIops-tools skill. Cloud IdPs (Okta, Entra ID, Auth0) are out of scope.
Related Skills — Skill Routing
| If the user wants… | Use |
|---|---|
| Keycloak / authentik identity ops | identity-aiops (this skill) |
| A non-identity platform (hypervisor, storage, backup, cluster, network device/controller, firewall, database, containers, endpoints, local LLM governance, compliance evidence) | the appropriate other AIops-tools skill (proxmox-aiops, truenas-aiops, ceph-aiops, veeam-aiops, k8s-aiops, network-aiops, fabric-aiops, firewall-aiops, postgres-aiops, container-host-aiops, endpoint-aiops, ai-guardian, compliance-aiops, …) |
| Cloud IdPs (Okta, Entra ID, Auth0) | out of scope for this tool |
Common Workflows
Each recipe starts from a read or one of the four RCAs and ends in a governed
write. The RCAs are MCP tools (login_failure_rca, stale_access_audit,
client_misconfig_audit, mfa_coverage_analysis) — call them through the MCP
server; the CLI covers the reads and the writes. Every CLI write accepts
--dry-run and otherwise double-confirms.
1. "We're being brute-forced — contain it"
identity-aiops overview→ how big is the failed-login feed right now, and is this one account or the whole realm?- MCP
login_failure_rca→ findings ranked with numbers, separating password spray from one IP, targeted brute-force on one account, a client failing with credential errors (a rotated secret not deployed), an expired-credential storm, and a lockout storm. identity-aiops events --type LOGIN_ERROR --user -n 200→ the raw failures behind the finding (authentik:--type login_failed).identity-aiops users showandidentity-aiops users sessions→ is the account already compromised, i.e. did any attempt actually succeed?- Contain:
identity-aiops users disable --dry-run, then for real (reversible — the fetched before-state is captured and anenable_userinverse recorded). identity-aiops users revoke-sessions→ kill live sessions. Irreversible (priorState only) — disabling alone does not end sessions already issued, so this step is what actually stops the attacker.identity-aiops undo list→ confirm the disable is reversible before you hand off.
Failure branch: if the RCA classifies it as a misconfigured client
rather than an attack (mass credential errors from one client id), do not
disable users — you would lock out legitimate people while the real fault is a
rotated secret that was never deployed. Go to recipe 3. If you disabled the
wrong account, identity-aiops users enable is high risk and
needs IDENTITY_AUDIT_APPROVED_BY + IDENTITY_AUDIT_RATIONALE, deliberately —
re-enabling reverses containment.
2. "Quarterly access re-certification"
- MCP
stale_access_audit(e.g.stale_days=90) → dormant users with day counts, never-logged-in accounts, service accounts being used interactively, and orphaned sessions. identity-aiops users list --search/identity-aiops users show→ confirm each candidate is genuinely the account you think.identity-aiops users sessions→ check for a live session before you touch a "dormant" account.- Confirm with the account owner or its manager. Then, per account:
identity-aiops users disable(reversible, undo-recorded). identity-aiops users revoke-sessionsfor the orphaned sessions the audit found (irreversible).- Re-run
stale_access_auditto confirm the list shrank as expected.
Failure branch: an interactive service account finding is not a
disable candidate — disabling it takes down whatever integration depends on
it. Trace the client first (identity-aiops clients show ,
identity-aiops clients list) and fix the integration to stop using
interactive login. If a disable breaks something unexpectedly,
identity-aiops undo apply replays the captured prior state.
3. "Harden the OAuth clients before the audit"
- MCP
client_misconfig_audit→ per-clientriskScorewith the evidence behind it: wildcard or plain-httpredirect URIs, a public client holding a secret, implicit flow enabled, missing PKCE, password grant allowed. identity-aiops clients show→ the full current client configuration, so you replace the right values.identity-aiops clients set-redirect-uris --uri https://app.example.com/callback --dry-run→ note that--uriis repeated and supplies the FULL new list, replacing what is there.- Re-run without
--dry-run: high risk, double confirm, requiresIDENTITY_AUDIT_APPROVED_BY+IDENTITY_AUDIT_RATIONALE. The prior URI list is captured, so undo replays it exactly. - If a secret leaked:
identity-aiops clients rotate-secret(high risk, irreversible, masked priorState) — then deploy the new secret everywhere that client is used. - Re-run
client_misconfig_auditto confirm the score dropped.
Failure branch: rotating a secret before the deployments are ready is how
you cause recipe 1's "misconfigured client" storm — every service using the old
secret starts failing authentication immediately, and rotation cannot be
undone. Stage the deployment first. If a redirect-URI replacement breaks a
login flow, identity-aiops undo apply restores the exact prior list;
this is why the URI change is reversible and the rotation is not.
4. "Show me who still has no second factor"
- MCP
mfa_coverage_analysis→ coverage percentage, the worst groups first, and the per-user gap list. identity-aiops users credentials→ what a specific user actually has configured, so you distinguish "no MFA" from "an enrolled factor the analysis could not see".identity-aiops overviewand realm settings → confirm the realm's brute-force protection and OTP policy actually require what you think they require.- Where a forced re-enrolment is part of the rollout:
identity-aiops users require-reset --dry-run, then for real (reversible — undo clears the pending requirement). identity-aiops undo list→ confirm each reset flag can be cleared if the rollout stalls.
Failure branch: if a user is blocked out by the reset requirement (no
working recovery path, or they cannot complete enrolment),
identity-aiops users require-reset --clear removes the pending
requirement, and identity-aiops undo apply does the same from the
recorded token. Do not chase a 100% coverage number by forcing resets on
service accounts — they have no interactive user to complete the flow, and the
stale_access_audit in recipe 2 is the right tool for those.
Governance & Safety
The skill delivers reads and writes and records them; it does not decide
whether a write is permitted. That is your agent's judgement, or the permission
of the account you connect it with (a Keycloak service account or authentik
token without manage-* scope — writes then fail at the server). There is no
read-only switch, policy file, or approval gate.
- Audit is the guarantee, and it is not bypassable. Every call — MCP and
CLI alike — lands an audit row in
~/.identity-aiops/audit.db(relocatable viaIDENTITY_AIOPS_HOME): params, status, and the risk tier. IDENTITY_AUDIT_APPROVED_BY/IDENTITY_AUDIT_RATIONALEare optional annotations recorded on the row (who/why); they are never required and never block.- Risk tier — a descriptive label on the audit row derived from
risk_level(enable_user,update_client_redirect_uris,rotate_client_secret= high;disable_user,revoke_user_sessions,require_password_reset= medium); it gates nothing. Writes support--dry-runand double confirmation at the CLI. - Reversible writes capture the real fetched before-state and record an
inverse descriptor (disable↔enable, reset-flag→clear, redirect-URI list
replay).
revoke_user_sessionsandrotate_client_secretare irreversible (priorState only; secrets recorded masked).
References
references/capabilities.md— full tool + platform + API-path referencereferences/cli-reference.md— CLI command referencereferences/setup-guide.md— onboarding, credentials, and connectivityreferences/agent-guardrails.md— running with a smaller / local model: the truncation and null-field contracts, the Keycloak-vs-authentik tool asymmetry, and a system prompt
Related skills
Use this skill whenever the user needs to operate a self-hosted observability stack on Prometheus (HTTP API + PromQL), Alertmanager, Grafana, or Grafana Loki (logs) — a one-shot overview, PromQL instant/range queries, label + series metadata, scrape-target health (up/down + why) and dropped targets, recording/alerting rule health, firing/pending alerts, Alertmanager alerts + silences, Grafana dashboards/datasources/folders, bounded Loki LogQL log reads (labels, query, error-tail), five flagship analyses (firing-alert RCA, target-scrape-health, alert-noise/flap, log-error-burst RCA, log-volume/cardinality) plus an alert->log cross-signal, and guarded writes (create/expire silence, create annotation, update/delete dashboard, reload Prometheus config). Always use this skill for "Prometheus", "PromQL", "Alertmanager", "Grafana", "Loki", "LogQL", "logs", "which targets are down", "scrape failing", "why is this alert firing", "root cause this alert", "firing alerts", "silence this alert", "n
Use this skill whenever the user needs to operate a managed-endpoint fleet (thin clients, VDI endpoints, centrally-managed devices) — a one-shot fleet health overview, endpoint inventory (list/get), a composite per-endpoint health score (which endpoints are worst?), login & boot sessions, login-storm analysis (detect morning login storms and rank the slowest login/boot contributors), patch/config drift (which endpoints deviate from the fleet baseline), and two guarded writes (assign a config profile, reboot an endpoint). Always use this skill for "endpoint fleet overview", "list managed endpoints", "which endpoints are worst", "endpoint health score", "rank endpoints by risk", "why is login slow this morning", "login storm", "boot time analysis", "patch drift", "config drift", "which endpoints are behind on patches", "assign a profile to an endpoint", or "reboot a thin client" when the context is an endpoint-management fleet. Do NOT use when the target is OT / industrial equipment (Mod
Use this skill whenever the user needs compliance evidence from the audit trails their governed AIops agents already write — mapping AI-agent infra-ops activity to HIPAA §164.312, PCI-DSS v4.0, SOC 2 TSC, or GDPR controls, producing a change-approval report, a gap analysis, an exceptions/anomaly report, or a hash-chain-sealed, tamper-evident evidence bundle. Always use this skill for "compliance evidence", "HIPAA / PCI-DSS / SOC 2 / GDPR evidence", "audit trail report", "coverage for control X", "which controls are we short on / gap analysis", "who approved this change / change-management evidence", "denied or errored ops / anomaly evidence", "seal / sign an evidence bundle", "prove this bundle wasn't altered", or "detect deleted audit rows". Do NOT use to scan or operate infrastructure and do NOT treat it as a GRC platform — it reads the local audit databases the OTHER AIops-tools write and converts them to evidence; for platform operations use those other AIops-tools. Evidence, not c
Use GCP without recurring browser OAuth
Use this skill whenever the user needs to operate a self-managed GitLab or self-hosted Gitea CI/CD server — a one-shot overview, server version and token identity, projects with storage statistics, pipelines/runs with jobs and trace tails, the runner fleet, merge/pull requests, branches, protection rules and releases, artifact inventories, four flagship RCAs (pipeline failures, runner health & queue, artifact/storage bloat, stale work), and governed writes (retry/cancel a pipeline, pause/resume a runner, delete artifacts, update branch protection). Always use this skill for "GitLab", "Gitea", "pipeline failed", "CI is red", "job trace", "runner offline", "jobs stuck in queue", "artifact storage full", "stale merge requests", "stale branches", "protect the default branch", "retry the pipeline", "cancel the pipeline", "delete old artifacts" when the context is a self-managed GitLab or Gitea instance. Do NOT use when the target is something other than a GitLab/Gitea CI/CD server (a hyperv