/vtex-ai-skills:vtex-io-rbacfrom vtex-ai-skills
Controls access to VTEX IO app resources using role-based (policies.json) or resource-based (service.json) policies. Covers VRN syntax, app-to-app vs user/integration access, and GraphQL @auth directives for securing routes.
Ships in vtex-ai-skills. 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.
Use this skill when you need to control who can access your VTEX IO app's routes and resources:
policies.json) and resource-based (service.json policies) access control@auth directiveDo not use this skill for:
vtex-io-service-apps)payment-pci-security)vtex-io-service-paths-and-cdn)Role-based (policies.json) | Resource-based (service.json policies) | |
|---|---|---|
| Who can call? | Only other IO apps (by themselves or on behalf of other apps) | Apps, users, and integrations (API keys) |
| API types | GraphQL and REST | REST only |
| How callers get access | Must declare required policies in their manifest.json | No policy declaration needed; just call with auth token |
| Where configured | policies.json in app root | policies array inside route definition in service.json |
| Use when | Exposing GraphQL endpoints; exposing REST endpoints for app-to-app only | Controlling access for users, API keys, or specific apps to REST endpoints |
policies.json) and/or the @auth directive in the schema for user-level authorization.policies.json). Consuming apps must declare the policy in their manifest.json.service.json. Set the route as "public": false and define principals."public": true in service.json. No policies needed, but be aware this means anyone can call it.VRNs (VTEX Resource Names) identify resources and principals:
vrn:{service}:{region}:{account}:{workspace}:{path}
vrn:apps:*:*:*:app/{vendor}.{app-name}@{version}vrn:vtex.vtex-id:*:*:*:user/{email}vrn:vtex.vtex-id:*:*:*:user/vtexappkey-{account}-{hash}* matches any value in a segment. app/* matches all apps. user/*@gmail.com matches all Gmail users.Role-based policies only work for app-to-app communication. If users (admin or storefront) or integrations (API keys) need to call your endpoint, you must use resource-based policies in service.json with the route set to "public": false.
Why this matters — Setting up a role-based policy for a route that users or API keys call results in 403 Forbidden for those callers, because role-based policies don't evaluate user/integration tokens.
Detection — A private route that should be callable by admin users or external integrations, but only has policies.json configuration and no policies array in service.json.
Correct — Resource-based policy in service.json for user/integration access.
{
"routes": {
"orders": {
"path": "/_v/private/my-app/orders",
"public": false,
"policies": [
{
"effect": "allow",
"actions": ["GET", "POST"],
"principals": [
"vrn:vtex.vtex-id:*:*:*:user/*@mycompany.com",
"vrn:apps:*:*:*:app/partner.integration-app@*"
]
}
]
}
}
}
Wrong — Only policies.json for a route that users need.
// policies.json — this only covers app-to-app, not users
[
{
"name": "access-orders",
"statements": [
{
"effect": "allow",
"actions": ["GET"],
"resources": ["vrn:my-app:*:*:*:/_v/private/my-app/orders"]
}
]
}
]
// Users calling this route still get 403
When resource-based policies have overlapping principals between an allow and a deny rule, the deny always wins. Be careful with wildcards in allow rules that intersect with specific deny rules.
Why this matters — A broad allow for app/* combined with a specific deny for app/vendor.bad-app@* correctly blocks bad-app. But the reverse—a broad deny with a specific allow—blocks everything including what you wanted to allow.
Detection — Multiple policy entries for the same route with conflicting effects and overlapping principals.
Correct — Allow broadly, deny specifically.
{
"policies": [
{
"effect": "allow",
"actions": ["POST"],
"principals": ["vrn:apps:*:*:*:app/*"]
},
{
"effect": "deny",
"actions": ["POST"],
"principals": ["vrn:apps:*:*:*:app/untrusted.app@*"]
}
]
}
Wrong — Deny broadly, try to allow specifically (the allow is overridden).
{
"policies": [
{
"effect": "deny",
"actions": ["POST"],
"principals": ["vrn:apps:*:*:*:app/*"]
},
{
"effect": "allow",
"actions": ["POST"],
"principals": ["vrn:apps:*:*:*:app/trusted.app@*"]
}
]
}
policies.json)[
{
"name": "resolve-graphql",
"description": "Allows apps to resolve GraphQL requests",
"statements": [
{
"effect": "allow",
"actions": ["POST"],
"resources": [
"vrn:vtex.store-graphql:{{region}}:{{account}}:{{workspace}}:/_v/graphql"
]
}
]
}
]
The consuming app declares the policy in its manifest.json:
{
"policies": [
{
"name": "resolve-graphql"
}
]
}
{
"routes": {
"webhook": {
"path": "/_v/private/my-app/webhook",
"public": false,
"policies": [
{
"effect": "allow",
"actions": ["POST"],
"principals": [
"vrn:apps:*:*:*:app/vtex.orders-broadcast@*",
"vrn:vtex.vtex-id:*:*:*:user/vtexappkey-myaccount-*"
]
}
]
}
}
}
@auth directiveFor GraphQL endpoints, use the @auth directive for user-level authorization:
type Query {
orders: [Order] @auth(productCode: "10", resourceCode: "list-orders")
adminSettings: Settings
@auth(productCode: "10", resourceCode: "admin-settings")
}
type Mutation {
updateSettings(input: SettingsInput!): Settings
@auth(productCode: "10", resourceCode: "admin-settings")
}
The @auth directive checks the caller's License Manager role for the specified productCode and resourceCode.
policies.json; users and API keys get 403 because role-based policies don't apply to them.public: true — Route set to public when it should be private. Anyone can call it without auth.manifest.json. Results in 403.app/* blocks all apps including trusted ones. Deny takes precedence.@auth on GraphQL mutations — Mutations that modify data accessible without role checks."public": false with appropriate policies?manifest.json?@auth directives with correct productCode and resourceCode?@auth directive detailsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
46 skills in this plugin
/architecture-well-architected-commerceApply when scoping, reviewing, or documenting cross-cutting VTEX commerce architecture across storefront, IO, headless, marketplace, payments, or any other VTEX module. Grounds work in the Well-Architected Commerce framework—Technical Foundation (reliability, trust, integrity; security, infrastructure, compliance), Future-proof (innovation, simplicity, efficiency; scalable and adaptable solutions), and Operational Excellence (accuracy, accountability, data-driven improvement; process and customer experience). Routes implementation detail to product tracks (IO caching and paths, Master Data strategy, marketplace integrations). Use for solution design, architecture reviews, and RFP-level technical structure./faststore-storefrontCore coding rules and workflow for developing VTEX FastStore storefronts. Use when starting any FastStore development task, writing TypeScript/React components, creating section overrides, extending the BFF, or styling. Covers all primary conventions, safety rules, and the development workflow used across every FastStore project./headless-bff-architectureApply when designing or modifying a BFF (Backend-for-Frontend) layer, middleware, or API proxy for a headless VTEX storefront. Covers BFF middleware architecture, public vs private API classification, VtexIdclientAutCookie management, API key protection, and secure request proxying. Use for any headless commerce project that must never expose VTEX_APP_KEY or call private VTEX APIs from the browser.npx claudepluginhub vtex/skills --plugin vtex-ai-skillsOther plugins' skills for the same job