ワンクリックで
fga
Query OpenFGA authorization tuples and explain why a user has (or doesn't have) a permission on an object
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Query OpenFGA authorization tuples and explain why a user has (or doesn't have) a permission on an object
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Author a new Fred agent capability (manifest + middleware) built on fred-sdk. Picks the right authoring lane, maps each runtime need to a middleware hook, wires entry-point registration, and enforces the capability boundary (never hand-edit union/registry hotspots, no capability code in control-plane, no runtime info in LLM tool signatures).
Safety-first review of an external pull request from an untrusted fork. Fetches the diff read-only into an isolated worktree, scans for supply-chain / exfiltration / CI-tampering threats, checks scope, then delegates correctness review. Never builds or runs the fork's code.
Pre-PR audit of the current branch — dead code, duplicate symbols, contract drift, leftover artifacts, import gaps.
Post-merge validation — check that both sides of a merge were fully integrated, nothing was silently dropped, and quality still passes.
Run make code-quality from the monorepo root, covering all modules. Never run it per-module.
Identify new code paths added in the current branch that have no test coverage. Reports gaps; does not write tests.
| name | fga |
| description | Query OpenFGA authorization tuples and explain why a user has (or doesn't have) a permission on an object |
| disable-model-invocation | true |
| user-invocable | true |
| allowed-tools | Bash, Read |
| argument-hint | <command> [args...] |
You help the user query and debug their OpenFGA authorization model using the fga CLI.
Always use these flags:
--api-url http://localhost:9080
--api-token Azerty123_
Store ID: Do NOT hardcode a store ID. Resolve it dynamically by running:
fga store list --api-url http://localhost:9080 --api-token Azerty123_ | jq -r '.stores[] | select(.name == "fred") | .id'
Use the returned ID as the --store-id value for all subsequent commands.
Store the three flags in a variable for convenience:
STORE_ID=$(fga store list --api-url http://localhost:9080 --api-token Azerty123_ | jq -r '.stores[] | select(.name == "fred") | .id')
FGA_FLAGS="--api-url http://localhost:9080 --api-token Azerty123_ --store-id $STORE_ID"
Read the authorization schema at fred-core/fred_core/security/rebac/schema.fga to understand the types, relations, and permission rules before answering.
List stored relationship tuples, optionally filtered.
# All tuples
fga tuple read $FGA_FLAGS
# Filter by object
fga tuple read $FGA_FLAGS --object <type>:<id>
# Filter by object + relation
fga tuple read $FGA_FLAGS --object <type>:<id> --relation <relation>
# Filter by user
fga tuple read $FGA_FLAGS --user <type>:<id>
Check if a user has a specific relation on an object (returns allowed: true/false).
fga query check $FGA_FLAGS <user_type>:<user_id> <relation> <object_type>:<object_id>
List all objects of a given type that a user has a relation on.
fga query list-objects $FGA_FLAGS <user_type>:<user_id> <relation> <object_type>
fga query list-users $FGA_FLAGS <object_type>:<object_id> <relation> <user_type>
Show the full resolution tree for a relation on an object.
fga query expand $FGA_FLAGS <relation> <object_type>:<object_id>
$ARGUMENTSParse the user's intent from $ARGUMENTS. Examples:
/fga read tuples for tag:abc → fga tuple read $FGA_FLAGS --object tag:abc/fga can user:xyz read tag:abc? → fga query check $FGA_FLAGS user:xyz read tag:abc/fga why can user:xyz read tag:abc? → Run check, then expand, then trace the tuple chain to explain the full resolution path/fga list objects user:xyz can read of type tag → fga query list-objects $FGA_FLAGS user:xyz read tag/fga who can read tag:abc? → fga query list-users $FGA_FLAGS tag:abc read userWhen the user asks why a user has a permission, follow this process:
fga query check ...fga query expand ...fga tuple read ... --object <object>Example output format:
user:alice → team_member of → team:engineering → owner of → tag:docs → read (via "team_member from owner" rule)
user, organization, team, agent, tag, document, resourceowner, editor, viewer, parent (tag/agent/resource ownership); team_admin, team_editor, team_analyst, team_member (team roles, AUTHZ-05); admin, platform_admin, platform_observer (organization)read, update, delete, share, process