From indykite-skills
Author and manage an IndyKite KBAC (Knowledge-Based Access Control) authorization policy - a single subject type, an actions list, a single resource type, and a Cypher condition over the IKG - through the Config API (`/configs/v1/authorization-policies` - create / read / list `?type=kbac` / update / delete, ETag-guarded). Use when the user wants to write, publish, inspect, change the status of, update, or delete a `2.0-kbac` policy - e.g. "write a policy letting a Person PROVISION a Server within budget and publish it", "list the active KBAC policies", "deactivate this policy". This authors the rule; it does NOT make decisions - for "can X do Y on Z?" use indykite-authzen-evaluation (single) or indykite-authzen-evaluations (batch), and to enumerate allowed actions/resources/subjects use indykite-authzen-search-action / -search-resource / -search-subject. This is KBAC, not ContX IQ - for CIQ read/write data policies use the indykite-ciq-* skills.
How this skill is triggered — by the user, by Claude, or both
Slash command
/indykite-skills:indykite-authzen-kbacThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
KBAC (Knowledge-Based Access Control) is IndyKite's graph-driven authorization model. A KBAC **policy** declares *who* (`subject`) may perform *which* operations (`actions`) on *what* (`resource`), gated by a **condition** in Cypher (the Neo4j / openCypher graph query language) evaluated against the IKG — IndyKite's knowledge graph, a property-graph database. The policy itself renders no decisi...
KBAC (Knowledge-Based Access Control) is IndyKite's graph-driven authorization model. A KBAC policy declares who (subject) may perform which operations (actions) on what (resource), gated by a condition in Cypher (the Neo4j / openCypher graph query language) evaluated against the IKG — IndyKite's knowledge graph, a property-graph database. The policy itself renders no decision - it is the rule that the AuthZEN endpoints consult when a decision or search is requested.
This skill is the home of the KBAC policy lifecycle: writing the policy JSON and managing it through the Config API.
meta.policy_version: "2.0-kbac", a single subject.type, an actions list, a single resource.type, and a condition.cypher that binds the reserved variables subject and resource./configs/v1/authorization-policies: create (POST), read (GET /{id} or by name), list (GET ?project_id=…&type=kbac), update (PUT /{id} with an If-Match ETag), and delete (DELETE /{id}).INACTIVE or DRAFT policy is stored but ignored (DRAFT may even be invalid).Once a policy is ACTIVE, the runtime AuthZEN skills evaluate it:
| Need | Endpoint | Skill |
|---|---|---|
| One yes/no decision | /access/v1/evaluation | indykite-authzen-evaluation |
| Many decisions at once | /access/v1/evaluations | indykite-authzen-evaluations |
| Actions a subject may perform on a resource | /access/v1/search/action | indykite-authzen-search-action |
| Resources a subject may act on, given an action | /access/v1/search/resource | indykite-authzen-search-resource |
| Subjects allowed an action on a resource | /access/v1/search/subject | indykite-authzen-search-subject |
Activate this skill when the user wants to:
policy_version: 2.0-kbac, subject, actions, resource, condition.cypher);DRAFT and ACTIVE;?type=kbac to separate them from CIQ policies);indykite-authzen-evaluation decision or the indykite-mcp-server authzen_evaluate tool.Do not activate this skill when the user wants to:
indykite-authzen-evaluation / indykite-authzen-evaluations;-search-action / -search-resource / -search-subject;/configs/v1/authorization-policies endpoint also serves CIQ, distinguished by type=ciq) - use the indykite-ciq-* skills;PROJECT_GID - it becomes the policy's project_id.SERVICE_ACCOUNT_TOKEN - used for every /configs/v1/authorization-policies call.Person, Service, Namespace, etc.). A policy is restricted to a single subject type; if two subject types need the same action, write two policies.false.If any of these are missing, say so before writing JSON.
Every KBAC policy answers one shape of question. Pin down all four parts before writing JSON:
| Part | What it is | Example |
|---|---|---|
subject | The single node type making the request. | Person |
actions | One or more uppercase verbs the policy grants. | ["PROVISION"] |
resource | The single node type being acted on. | Server |
condition | A Cypher pattern + WHERE that must hold for a decision to be true. | price within budget |
Working example used throughout this skill:
A
Person(subject) mayPROVISIONaServer(resource) when the server's price is within a budget supplied at evaluation time.
The condition is a single cypher string. Two hard rules:
subject (matching subject.type) and a variable literally named resource (matching resource.type). At decision time the AuthZEN request's subject.id / resource.id are matched against each node's external_id.$name in the WHERE clause; the decision call supplies it under context.input_params (without the $). Here the budget is $max_price.MATCH (subject:Person), (resource:Server)
WHERE resource.property.price <= $max_price
For relationship-based rules, match the relationship instead of (or in addition to) a property check:
MATCH (subject:Person)-[:CAN_AFFORD]->(resource:Server)
For the full condition grammar (attribute references, multi-hop patterns, partial parameters) see references/policy-reference.md.
A KBAC policy has exactly these top-level keys: meta.policy_version ("2.0-kbac"), subject.type, actions, resource.type, and condition.cypher.
The Config API does not take the policy object directly - it takes a create envelope in which the policy is a stringified JSON value:
{
"name": "kbac-person-provision-server",
"display_name": "Person: PROVISION a Server within budget",
"description": "Allow a Person to PROVISION a Server when its price is within a budget supplied at evaluation time.",
"project_id": "<project-gid>",
"policy": "{ \"meta\": { \"policy_version\": \"2.0-kbac\" }, … }",
"status": "ACTIVE"
}
For readability the asset assets/policy-provision-server.json keeps policy as an object and project_id as a placeholder; the create step sets project_id and stringifies policy just before sending.
POST <API_URL>/configs/v1/authorization-policies
Authenticate with the Service Account token: Authorization: Bearer <SERVICE_ACCOUNT_TOKEN>.
# set project_id and stringify only the `policy` field, then POST
jq --arg pid "$PROJECT_GID" '.project_id = $pid | .policy |= tojson' assets/policy-provision-server.json \
| curl -X POST "$API_URL/configs/v1/authorization-policies" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SERVICE_ACCOUNT_TOKEN" \
-d @-
Or use the helper scripts/create-policy.sh, which sets project_id, stringifies the policy field, pins the IndyKite host, and redacts the token under --print.
A 201 Created returns the policy's id (a gid:…), audit fields (create_time, created_by, …), and an ETag header. Keep the id and ETag - update and delete need them. The policy participates in decisions only when its status is ACTIVE.
The same /configs/v1/authorization-policies path manages the policy lifecycle (all with the Service Account token):
GET /configs/v1/authorization-policies/{id} - returns the full record, including the stringified policy, status, tags, audit fields, and the current ETag.GET /configs/v1/authorization-policies/{name}?location={PROJECT_GID}.GET /configs/v1/authorization-policies?project_id={PROJECT_GID}&type=kbac - type=kbac returns only KBAC policies (use type=ciq for ContX IQ). List responses carry an empty policy string per item; read by id to get the body.PUT /configs/v1/authorization-policies/{id} with header If-Match: <etag> and a body of the fields to change (display_name, description, policy, status, tags). Use this to publish (status: "ACTIVE"), deactivate (status: "INACTIVE"), or hold as DRAFT, or to revise the condition. A new ETag comes back.DELETE /configs/v1/authorization-policies/{id} with header If-Match: <etag>.Full request/response shapes, response fields, and the ETag concurrency rules are in references/policy-reference.md.
When this skill has been applied successfully:
policy_version: "2.0-kbac", a single subject.type, an actions list, a single resource.type, and a condition.cypher binding subject and resource.INACTIVE / DRAFT), and its id and current ETag are known so it can be read, updated, or deleted.?type=kbac shows the policy, and an indykite-authzen-evaluation decision over a matching (subject, action, resource) triple reflects it.references/policy-reference.md - KBAC policy schema (meta, subject, actions, resource, condition.cypher, partial parameters, multi-action and relationship variants) and the Config API lifecycle (create / read / list ?type=kbac / update / delete, ETag concurrency, response fields).assets/policy-provision-server.json - runnable KBAC policy create envelope for the Person PROVISION Server example.scripts/create-policy.sh - Bash helper that sets project_id, stringifies policy, and POSTs the create envelope to /configs/v1/authorization-policies (host-pinned; --print to preview).This skill uses generic markdown instructions and works across all agents listed in the README. The agent needs to be able to issue HTTP requests (curl, an HTTP client, or the IndyKite Terraform provider - see References). No Claude Code hooks, Cursor @-mentions, or Copilot workspace context are required.
indykite_authorization_policynpx claudepluginhub indykite/skills --plugin indykite-skillsProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.