agentleFS
indykiteindykite/skills/indykite-authzen-list-policies/SKILL.md

indykite-authzen-list-policies

Skill4 starsChanged 4 months agoApache-2.0View on GitHub

List the ACTIVE KBAC authorization policies of the calling application agent's project at runtime via the IndyKite AuthZEN REST API (`GET /access/v1/policies`) - each policy returned as stored (inlined JSON object) with its tags, optionally narrowed with `?subject_type=`. Needs the `ReadAuthZConfigs` API permission on the AppAgent; no Service Account token, no user token. Use to show which rules currently apply, discover the actions / resource types / tags that exist for a subject type before asking for decisions, or pick `context.policy_tags` - "which policies apply to Person right now?", "what actions exist for Server?", "why 401 on /access/v1/policies?". Not for making decisions (indykite-authzen-evaluation / -evaluations), enumerating allowed actions / resources / subjects for a specific subject (indykite-authzen-search-*), or creating / updating / deleting policies (indykite-authzen-kbac-policies, Config API). Never lists ContX IQ policies.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not activate this skill when the user wants to:

    line 30
  2. Very specific:

    read the graph schema rather than the policies - indykite-data-schema.

    line 35
  3. Distinctive:

    If a prerequisite is missing, say so - an empty listing looks the same whether no policy exists or the wrong project's credential was used.

    line 43
  4. Distinctive:

    Only the calling agent's project.

    line 96
  5. Very specific:

    Choose policy_tags from tags: Only tags that appear here can select anything on an evaluation.

    line 104
  6. Distinctive:

    When this skill has been applied successfully:

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

IndyKite AuthZEN - list the project's active KBAC policies

GET /access/v1/policies lets an application agent read the ACTIVE KBAC (Knowledge-Based Access Control) policies of its own project at runtime. Each policy comes back exactly as it was stored through the Config API, inlined as a JSON object, together with its tags. It is a read-only runtime view of the rules the decision endpoints evaluate: no Service Account credentials, no policy IDs, no lifecycle operations.

It sits next to the other runtime AuthZEN endpoints under /access/v1, but answers a different question:

QuestionEndpointSkill
Which rules apply in this project right now?GET /policiesthis skill
Can X do Y on Z? (one / many)POST /evaluation(s)indykite-authzen-evaluation / -evaluations
Which actions / resources / subjects are allowed?POST /search/*indykite-authzen-search-action / -resource / -subject
Create, update, publish, or delete a policyConfig APIindykite-authzen-kbac-policies

When to use

Activate this skill when the user wants to:

  • see which KBAC policies are active in the project, from an application (not an admin) credential - "which rules apply to Person right now?";
  • discover the vocabulary a subject type can be asked about - the actions and resource.type values present in policies for Person - before building evaluation or search requests, e.g. for an AI agent that must not guess action names;
  • pick the policy_tags to send under context on an evaluation, from the tags that actually exist;
  • debug a 401 on /access/v1/policies - almost always the missing ReadAuthZConfigs API permission.

Do not activate this skill when the user wants to:

  • make a decision - indykite-authzen-evaluation / indykite-authzen-evaluations;
  • enumerate what a specific subject may do (actions, resources, subjects under current graph state) - the indykite-authzen-search-* skills; this listing shows the rules, not their outcome for a given node;
  • author, update, activate, or delete a policy, or needs policy IDs, names, ETags, INACTIVE / DRAFT policies, or CIQ policies - indykite-authzen-kbac-policies (Config API, Service Account token);
  • read the graph schema rather than the policies - indykite-data-schema.

Prerequisites

  • An IndyKite project with an AppAgent and AppAgent credentials (the token that goes into X-IK-ClientKey) - see the Credentials guide.
  • The AppAgent holds the ReadAuthZConfigs API permission. It is a separate permission from Authorization and is not granted to existing agents automatically: add it to the agent's api_permissions (POST / PUT /configs/v1/application-agents, Service Account token, or the Hub UI). The full permission-to-endpoint map is in the Environment guide.
  • At least one ACTIVE KBAC policy in the project - otherwise the listing is an empty results array, which is a normal 200.

If a prerequisite is missing, say so - an empty listing looks the same whether no policy exists or the wrong project's credential was used.

Steps

1. Call the endpoint

GET <API_URL>/access/v1/policies
GET <API_URL>/access/v1/policies?subject_type=Person

where API_URL is https://eu.api.indykite.com or https://us.api.indykite.com, matching the project's region. Authentication is the AppAgent credential in the X-IK-ClientKey header, as is, without any prefix. No request body, no user token - the project is derived from the credential.

The only parameter is the optional query subject_type: keep only the policies whose subject.type equals this node type (a valid node label such as Person or _Application, 2-64 characters, case-sensitive). Omit it to get every policy. A subject type no policy uses is not an error - it returns {"results": []}.

A runnable shell helper builds the authenticated request: scripts/list-policies.sh - pass the subject type as the optional argument, run with --print to preview the curl (host-pinned; token redacted).

2. Read the response

{
  "results": [
    {
      "policy": {
        "meta": { "policy_version": "2.0-kbac" },
        "subject": { "type": "Person" },
        "actions": ["CAN_DRIVE"],
        "resource": { "type": "Car" },
        "condition": { "cypher": "MATCH (subject:Person)-[:DRIVES]->(resource:Car)" }
      },
      "tags": []
    },
    {
      "policy": {
        "meta": { "policy_version": "2.0-kbac" },
        "subject": { "type": "_Application" },
        "actions": ["CAN_READ"],
        "resource": { "type": "Car" },
        "condition": { "cypher": "MATCH (subject) MATCH (resource:Car)" }
      },
      "tags": ["fleet"]
    }
  ]
}
  • results[] - one entry per policy; empty when nothing matches.
  • results[].policy - the policy definition as stored: the policy string given to POST /configs/v1/authorization-policies, parsed back into an object (no escaping to undo). Its shape follows meta.policy_version - meta, subject, actions, resource, condition (with cypher and an optional filter) appear exactly as authored.
  • results[].tags - the policy's tags, the values matched by context.policy_tags on evaluation. Always an array, [] when the policy has none.

What is (and is not) listed:

  • KBAC policies (2.0-kbac and 3.0-kbac) with status ACTIVE only - the same set the decision endpoints evaluate.
  • Only the calling agent's project; there is no project parameter.
  • No ContX IQ (1.0-ciq) policies, no policy id / name / timestamps / ETag - those live on the Config API.

The full field reference, error table, and jq recipes are in references/list-policies-reference.md.

3. Use what it tells you

  • Build requests from real values. Take actions[], resource.type, and subject.type verbatim into indykite-authzen-evaluation / search requests instead of guessing action names.
  • Choose policy_tags from tags. Only tags that appear here can select anything on an evaluation.
  • Spot required input_params. A $name inside condition.cypher is a partial parameter the decision call must supply under context.input_params.
  • Don't mistake it for a decision. A policy being listed says nothing about whether a given subject passes its condition - ask the evaluation or search endpoints for that.

Outcome

When this skill has been applied successfully:

  • GET /access/v1/policies (optionally with ?subject_type=) returns a results array of the project's ACTIVE KBAC policies, each with its stored policy object and tags, or an empty array when none match.
  • The AppAgent used holds ReadAuthZConfigs, and downstream evaluation / search requests use action names, resource types, subject types, and tags taken from the listing.

Files in this skill

  • references/list-policies-reference.md - endpoint, auth and permission, query parameter, response fields, error codes, troubleshooting, and jq recipes.
  • scripts/list-policies.sh - Bash helper that GETs /access/v1/policies with the right header and an optional subject_type (host-pinned; --print to preview).

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

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.