Input Controls
RBAC
rbac decides what an authenticated caller may ask the model to do, based on the roles in its verified identity. You can limit which tools each role may declare, how sensitive the requested data may be, and which roles may send health information.
These rules apply to model traffic. Access to organization resources, such as agents and secrets, is a separate system: IAM roles.
Roles come only from the verified identity of the application token. An X-User-Role: analyst header does not give the caller that role.
Configuration
Save this as a test configuration, or add it to your configuration with the config-first workflow. Replace analyst with a role from your verified identities.
pack:
name: analyst-tool-access
version: 1.0.0
enabled: true
policies:
chain:
- rbac
policy:
rbac:
require_auth: true
roles:
analyst:
allowed_tools:
- search
- summarize
denied_tools:
- delete_*Verify the access rule
The offline test runner has no verified identity, so test through a gateway. Use a test token whose identity has the analyst role, and declare tools in the model request:
| Request | Result |
|---|---|
Declares only search | Passes this rule |
Declares delete_record | Blocked with rbac.tool_not_allowed |
Declares export_data | Blocked, because no rule allows it |
| Has no verified identity | Rejected by authentication, or blocked with rbac.missing_identity |
The control checks the tools that the request declares. It does not run them, so your application must still authorize tool execution.
rbac: {} is the smallest valid block. It requires a verified identity and blocks every tool from an identity with roles, because no allowed_tools rule exists. If rbac is in the chain without any policy.rbac block, every request is blocked with policy.rbac_configuration_required.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
require_auth | boolean | true | Blocks a request without a verified identity. The schema shows false, but the runtime uses true. Set it explicitly. |
deny_if_missing | string[] | [] | Headers that must have non-empty values. The schema shows ["X-User-ID"], but the runtime uses an empty list. |
roles | object | {} | Rules by role name. Names must match the roles in the verified identity. |
roles.<role>.allowed_tools | string[] | [] | Tool name patterns the role can declare. * matches any sequence, including an empty one. |
roles.<role>.denied_tools | string[] | [] | Tool name patterns the role cannot declare. A deny wins over an allow. |
data_access | object | {} | Data sensitivity limits by role name |
data_access.<role>.max_sensitivity | string | public | Highest verdictan.data_sensitivity the role can request: public, internal, confidential, or restricted, in that order |
minimum_necessary.enabled | boolean | false | Blocks health-identifier text from roles that are not in allowed_phi_roles |
minimum_necessary.allowed_phi_roles | string[] | [] | Roles that may send health-identifier text |
How it works
- The control reads the verified identity and its roles from the request context.
- A missing
deny_if_missingheader, or a missing identity withrequire_auth: true, blocks the request withrbac.missing_identity. - If
rolesis not empty and the identity has no role, the request is blocked withrbac.missing_role. - The
deny_if_missingheadersX-User-ID,X-Org-ID, andX-User-Rolemay contain only ASCII letters, digits,-,_, and.. Anything else blocks withrbac.invalid_identity. - For an identity with roles, the control reads each tool name from
tools[].function.nameortools[].name. - Each tool is checked against each role. A
denied_toolsmatch blocks it, and anallowed_toolsmatch allows it. A tool that no role allows blocks the request withrbac.tool_not_allowed. - If
data_accesshas an entry for one of the roles, the control readsverdictan.data_sensitivityfrom the request. A missing or unknown value counts aspublic. If no role allows that level, the request is blocked withrbac.data_access_denied. - If
minimum_necessary.enabledistrue,allowed_phi_rolesis not empty, and the identity has none of those roles, the control runs the HIPAA identifier detector on the message text. A detection blocks withrbac.minimum_necessary. - Otherwise, the request is allowed with
rbac.allowed.
The decision details name the role, the roles list, and the tool, requested_sensitivity, max_sensitivity, or phi_detections value that caused a block.
Phase and verdicts
| Item | Value |
|---|---|
| Phase | input |
| Request families | Chat Completions, Completions, Responses, Messages, Embeddings, Audio transcriptions, Moderation |
| Verdicts | allow, block |
| Reason codes | rbac.allowed, rbac.missing_identity, rbac.missing_role, rbac.invalid_identity, rbac.tool_not_allowed, rbac.data_access_denied, rbac.minimum_necessary, policy.rbac_configuration_required |
A blocked request gets HTTP 400 with error code content_policy_violation and a verdictan.decision object in the body.
Limits and failure behavior
- Roles come only from the verified identity. Headers alone never create a verified identity, and
require_auth: trueblocks such a request. deny_if_missingonly checks that headers have values. It does not authenticate anyone.- The tool check runs when the identity has roles and the request has
tools. Each tool must match anallowed_toolspattern of some role. Withroles: {}, every request withtoolsfrom an identity with roles is blocked. - A role that the identity has but
rolesdoes not list allows no tool. List every role that uses tools. - The data sensitivity check runs only when
data_accesshas an entry for one of the roles. A request withoutverdictan.data_sensitivitycounts aspublicand passes every limit. minimum_necessaryuses the same HIPAA detector as PII Detector inhealthcare_mode. It reads onlymessages[].contentstrings, not structured content parts.require_auth: falselets a request without identity through only whenrolesis empty. With roles configured, such a request is blocked withrbac.missing_role.- The control stops at the first failed check. The details show only that check.
Next steps
- Identity and Access: where the roles in an identity come from.
- Agent Firewall: allow and block tools without role claims.
- Permissions Reference: the control-plane permissions of Verdictan roles.