/stackone:stackone-policiesfrom stackone
Use when the user wants to restrict, block, guard or limit what their AI agents can do in a connected app, control who can run which actions, mask or hide fields such as emails or salaries, or enforce, disable, change or remove an existing runtime policy (rule). Covers reading, writing, testing and retiring Cedar policies and who they apply to. Not for linking or reconnecting accounts (stackone-connection), not for running a provider action, and not for reading logs to diagnose a failed call.
Ships in stackone. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A runtime policy is a rule, written in Cedar, that decides what a project's agents may do on a tool call: let it through, refuse it, or mask fields in the response. Each policy also says who it covers. A wrong rule blocks real work or leaves a gap the user believes is closed, so read first, confirm every write, and test before and after saving.
If this session has no policy tools (stackone_get_policies, stackone_create_policy and the
rest), policies are not available here: tell the user to manage them in the StackOne dashboard at
app.stackone.com, and do not attempt the steps below. Every policy tool needs a project admin; when
one is refused, tell the user to ask a project admin.
stackone_get_policies, or stackone_get_policies {id} for one. Find
every id this way; never ask the user for a policy id.A policy only decides calls made by a signed-in StackOne user: an AI client connected through OAuth
(Claude, Cursor, ChatGPT and similar), the dashboard playground and agent, or a person's own
personal API key. Calls made with a project API key, or through a connect session belonging to a
customer's end user, are never checked, even by a rule assigned to everyone. Tell the user this
whenever their request is about those callers or could be read that way.
stackone_get_connectors and the accounts with
stackone_get_accounts {connector_key: ["<key>"], expand: "connector,connector_profile"}.stackone_get_connector_profiles {connector_key: ["<key>"]}, then
stackone_get_connector_profiles {id} for each profile, which returns its enabled action ids.
Where stackone_search_actions is available, use it to read an action's description and inputs.resource.name like "*delete*": it
misses actions named differently and catches ones it should not. The rule covers the listed ids
only. If the user asks whether it will catch actions added later, answer plainly: no, it lists
today's ids, new actions must be added to it, and you can do that when they appear. Change
nothing else for this: no connector or profile settings, no pinned version, no disabled actions.Deny wins over allow, and a permit on its own restricts nothing, so a restriction is a forbid.
One statement per check. The policy's name goes in name, never in an annotation such as @name.
// Stop agents deleting or ending records in HiBob
forbid (principal, action == StackOne::Action::"invokeTool", resource)
when { resource in [StackOne::Tool::"<delete action id>", StackOne::Tool::"<terminate action id>"] };
Only when the user wants every action of one connector stopped, use
context.account in StackOne::Connector::"<connector key>". For one account use
context.account == StackOne::Account::"<account id>".
When the restriction depends on a value in the call, read the action's input names first, then test
them through context.args. Each value needs both guards, hasTag and has, or the save is
refused. Text is under str, a whole number under num, any number under dec (compare amounts
with dec and decimal("1000.0")), a boolean under bool. A nested input is keyed by its path, such
as compensation.amount. If the user defines a category by several fields together, the condition
tests all of them, not one field that looks similar.
forbid (principal, action == StackOne::Action::"invokeTool", resource)
when { resource == StackOne::Tool::"<create action id>"
&& context.args.hasTag("employment_type") && context.args.getTag("employment_type") has str
&& context.args.hasTag("country") && context.args.getTag("country") has str
&& context.args.getTag("employment_type").str == "contractor"
&& context.args.getTag("country").str == "US" };
principals on create, and on stackone_replace_policy_assignments, is [{type: "everyone"}] or
users and groups by id: {type: "user", id}, {type: "group", id}. No management tool lists users or
groups, so ask the user for the StackOne user id or group id. Never put a name or an email where an id goes. "Only Jessica may use UKG" is a rule for
everyone with Jessica left out:
forbid (principal, action == StackOne::Action::"invokeTool", resource)
when { context.account in StackOne::Connector::"<ukg connector key>" }
unless { principal == StackOne::User::"<Jessica's user id>" };
Replacing assignments replaces the whole set: send everyone who should stay, not just the change.
To mask what a response returns use readField; to refuse a write use writeField. Look up the exact
label with stackone_get_policy_labels and never invent one. If no label fits, or the list is empty,
say so. A client condition needs its guard:
forbid (principal, action == StackOne::Action::"readField", resource)
when { resource in StackOne::Label::"<label name>"
&& context has client && context.client == StackOne::Client::"claude" };
Before every write, tell the user in plain words what will change and who it affects, and wait for their yes.
stackone_create_policy {name, definition, principals}. Leave out project_id,
enforcement_level and expires_at: it starts monitored, which records and blocks nothing.stackone_update_policy {id, definition, expected_version}, where expected_version is
current_version from stackone_get_policies. An edit to an enforced rule acts on the next call.enforced or disabled, and never delete one, unless the user asks. When
they only want a rule to stop applying, offer stackone_set_policy_enforcement_level {id, enforcement_level: "disabled"}, which keeps it; use stackone_delete_policy only on an explicit ask.Dry-run with stackone_evaluate_policy, never by running a real write or delete. Test both sides:
calls the rule must stop, and calls it must leave alone. A persona is a real member (user_id) or a
stand-in with any group_ids, which matches a rule assigned to everyone.
stackone_evaluate_policy {
tool_name: "<delete action id>", account_id: "<account id>", connector_id: "<connector key>",
draft_definition: "<the Cedar>",
personas: [
{ id: "any-agent", group_ids: ["stand-in"], expectation: "deny" },
{ id: "reads-still-work", group_ids: ["stand-in"], expectation: "allow",
call: { tool_name: "<a read action id>", account_id: "<account id>", connector_id: "<connector key>" } }
]
}
Add args to the call for argument rules, client for client rules, and draft_audience when the
rule is not for everyone. For a saved policy pass policy_id (with draft_definition for an edit).
The policy is judged as if enforced: deniedByThis means this rule refused it. Show each verdict,
fix the rule if one is wrong, and test again after saving.
Report the policy's name, enforcement level, who it covers, the exact actions or fields it stops,
and the test verdicts. Say what is left, such as moving it to enforced, and who it cannot reach.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub stackonehq/stackone-plugin --plugin stackone3 skills in this plugin
/stackone-actionsUse StackOne to discover connected apps, look up records, or make a user-approved change in a connected account./stackone-connectionUse when the user wants to connect or link an account, reconnect a broken or expired connector, choose between a connector's profiles before linking, or verify that a newly linked account works. Covers linking, reconnection, profile choice, and link diagnosis. Not for running a provider action on an already-working account.Other plugins' skills for the same job