mcpField
I
indykite-authzen-search-subject

indykite-authzen-search-subject

github.com/indykiteSecurity447 installsUpdated 2d ago
Repository

About indykite-authzen-search-subject

A generic agent skill for querying IndyKite AuthZEN to find subjects of a specified type who may perform an action on a resource. It guides request construction and result analysis, but does not author policies or modify graph data.

Key features

  1. 01Build subject-search requests
  2. 02Submit authenticated API searches
  3. 03Interpret permitted subject results
  4. 04Troubleshoot empty or unexpected results
  5. 05Includes JSON example and Bash helper

Use cases

  1. 01List who may act on a resource
  2. 02Build access audit or reviewer views
  3. 03Investigate missing permitted subjects

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/indykite/skills --skill indykite-authzen-search-subject

After installing, type/indykite-authzen-search-subjectin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
search-subject-request.json
references/
search-subject-reference.md
scripts/
search-subject.sh

Details

From the project README

IndyKite AuthZEN - subject search

Subject search asks the AuthZEN endpoint: which subjects may perform a given action on this resource? Given a subject type, one resource, and one action, it returns the matching subject instances under the project's currently ACTIVE KBAC policies and current graph state.

It is one of three AuthZEN search endpoints, each pinning two of the three (subject, action, resource) parts and enumerating the third:

EndpointPinnedEnumeratesSkill
/search/actionsubject + resourceactionsindykite-authzen-search-action
/search/resourcesubject + actionresourcesindykite-authzen-search-resource
/search/subjectresource + actionsubjectsthis skill

This skill covers building and sending the request and reading the results. It does not author policies - the 2.0-kbac and 3.0-kbac policies these results are evaluated against are authored with indykite-authzen-kbac-policies.

When to use

Activate this skill when the user wants to:

  • list every subject of a type that may perform an action on a specific resource (e.g. "who can DEPLOY gpu-node-7?", "who can approve this document?");
  • build an audit or reviewer view of who currently has access to an item;
  • debug why an expected subject is or is not in a resource's permitted set.

Do not activate this skill for a single yes/no decision (indykite-authzen-evaluation), to enumerate actions or resources instead (the sibling search skills), or to author a policy or read/write graph data (search only lists subjects).

Prerequisites

  • One or more ACTIVE KBAC policies whose subject.type / resource.type and actions cover the question. If none exist, author them first with indykite-authzen-kbac-policies; search over an empty policy set returns {"results": []}.
  • An AppAgent with credentials configured for the calling application (Credentials guide).
  • The IKG populated with the candidate subject nodes and the resource node (and any relationships the policy conditions match).
  • Any partial parameters a candidate policy references, ready to pass under context.input_params.

If a prerequisite is missing, say so - an empty result set from a missing policy or absent node looks identical to a real "nothing permitted".

Steps

1. Pin the resource and the action; leave the subject a type

Subject search fixes the resource and the action, and searches across subjects of a given type:

PartFieldExample
subjectsubject.type onlyPerson (no id)
actionaction.namePROVISION
resourceresource.type + resource.idServer / gpu-node-7

Do not set subject.id - the subjects are what the search returns.

2. Build the request body
{
  "subject":  { "type": "Person" },
  "resource": { "type": "Server", "id": "gpu-node-7" },
  "action":   { "name": "PROVISION" },
  "context":  { "input_params": { "max_price": 80000 } }
}

Include context.input_params only if a candidate policy references a $name partial parameter; supply each key without the $, correctly typed. A location-routed 3.0-kbac policy on a composite IKG takes its logical location here too ({ "region": "east" }, a key of the project's alias_mapping); only subjects stored in that location can be returned, and a missing or unknown location is a 422 - see references/search-subject-reference.md. A ready body: assets/search-subject-request.json.

3. Send the search
POST <API_URL>/access/v1/search/subject

The endpoint authenticates the calling application (its AppAgent credentials - always required). A user access token is accepted too, but for subject search it typically has no effect on the result set (you are enumerating subjects, not acting as one). Which credential goes in which request header is covered by the Credentials guide.

A runnable shell helper builds the authenticated request: scripts/search-subject.sh — run with --print to preview the curl (host-pinned; tokens redacted).

4. Read the results
{ "results": [ { "type": "Person", "id": "grace" }, { "type": "Person", "id": "dennis" } ] }

Each results[] entry is a subject (type + id, the external_id) allowed the action on that resource. An empty results array is a normal 200 meaning no subject of that type is permitted - not an error.

5. Verify

Empty or surprising results usually trace to: subject.id accidentally set (it takes subject.type only), resource.id not being an external_id, the action not matching a policy, a $param missing/mistyped (loosening max_price widens the set), or the subject nodes being absent. Full checklist: references/search-subject-reference.md.

Outcome

When this skill has been applied successfully:

  • POST /access/v1/search/subject returns a results array of subject instances (type + id) allowed a given action on a specific resource, under current ACTIVE policies and graph state (an empty array means no subject of that type permitted — a normal 200).
  • The subjects returned are consistent with single-decision (/access/v1/evaluation) results for the same triples.

Files in this skill

Agent-specific notes

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). No Claude Code hooks, Cursor @-mentions, or Copilot workspace context are required.

References

Comments

Markdown supported