From keycard-cli
Answer questions about the active Cedar policy and diagnose tool blocks — read-only; does not modify the policy. TRIGGER when: user asks what tools are allowed, whether a specific tool is permitted (e.g. "Can I use X?", "Am I allowed to use X?", "What's my policy?"), why a tool was blocked, or reports "a tool was just blocked." DO NOT TRIGGER when: user wants to change, add, or remove a policy rule (→ `keycard-upsert-policy`); user asks general questions about Cedar concepts without reference to their active policy.
How this skill is triggered — by the user, by Claude, or both
Slash command
/keycard-cli:keycard-query-policy [policy question or blocked tool, e.g. 'May I use the Bash tool?' or 'Why was Read blocked?'][policy question or blocked tool, e.g. 'May I use the Bash tool?' or 'Why was Read blocked?']The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping the user understand their active Cedar policy. This skill is read-only — to modify the policy, direct the user to `/keycard-upsert-policy`.
You are helping the user understand their active Cedar policy. This skill is read-only — to modify the policy, direct the user to /keycard-upsert-policy.
See .agents/reference/cedar-policy.md for Cedar syntax reference. Policy reads must always use keycard agent policy — never the Read tool on the file directly.
The user's input is: $ARGUMENTS
If $ARGUMENTS is empty, ask: "What would you like to know about the policy? (e.g. 'May I use Bash?', 'What tools are allowed?', 'Why was X blocked?')"
Wait for the response, then continue to Step 2.
Run:
keycard agent policy
If the command fails (no policy file or CLI error), display the returned message and stop.
Handle the question or diagnostic request using the policy from Step 2:
forbid matches, note it takes precedence over any permit.permit clauses. Note any with @itl (require approval). Note any forbid overrides.@itl rules?") using the policy text from Step 2. For abstract Cedar concepts not tied to the active policy, say: "That's a general Cedar question — see .agents/reference/cedar-policy.md for syntax details. To change your policy, run /keycard-upsert-policy."When the user reports a tool was blocked ("a tool was just blocked", "Why was X blocked?"):
$ARGUMENTS or ask: "Which tool was blocked? (e.g. Bash, Read, MCP(server.function))"Tool::"bash" matches Bash). If a matching clause has when/unless conditions, note that it may only apply conditionally — quote the conditions alongside the clause.Case A — One or more matching forbid clauses found:
forbid clause is blocking this tool — adding a permit will have no effect while it remains."forbid clauses exactly as they appear in the policy.forbid clause by running /keycard-upsert-policy <change request>."Case B — No matching permit found (and no active forbid):
permit clause was found for this tool.""no matching permit found"/keycard-upsert-policy allow the <tool name> tool."Case C — A permit exists but no forbid is present:
permit clause exists, but it may carry unsatisfied when/unless conditions, or the tool requires in-the-loop (@itl) approval not given at call time."permit clause(s) exactly, including any when/unless conditions.@itl: "Approve the tool call when prompted." For conditional permits: "Check whether the runtime context matched the when conditions; run /keycard-upsert-policy to loosen or remove the condition."Keep answers concise. Quote relevant Cedar clause(s) to justify the answer. Do not propose or write any policy changes.
"May I use X?" query:
Input: May I use the Bash tool?
Output:
Allowed. The following clause permits it:
permit (principal, action == Action::"Agent::ToolUse", resource == Tool::"bash");No active
forbidoverrides this.
"What tools are allowed?" query:
Input: What tools are allowed?
Output:
Permitted tools:
bash— unrestrictedread— requires in-the-loop approval (@itl)No
forbidclauses are active.
Block-diagnosis — Case A (forbid found):
Input: Why was Read blocked?
Output:
Diagnosis: A
forbidclause is blocking this tool — adding apermitwill have no effect while it remains.Blocking clause:
forbid (principal, action == Action::"Agent::ToolUse", resource == Tool::"read");Suggested fix: Remove or narrow the
forbidclause by running/keycard-upsert-policy remove the forbid on the Read tool.
npx claudepluginhub keycardai/plugins --plugin keycard-cliCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.