Overview
When your application asks “Can this subject do this action?”, Bedrock’s evaluation engine processes the request through a series of steps to produce a decision.The Evaluation Input
Every permission check requires an evaluation input:Basic Example
Evaluation Steps
The engine works through several legs to reach a decision—roughly in this order:- Reachability gate (when resource-scope gating is enabled) — if a concrete resource is not reachable in the requested scope, deny outright.
- Delegation grant (when
onBehalfOfis set) — an active delegation grant authorizing the actor to act for the principal in this scope must exist, or the request is denied (NO_DELEGATION_GRANT) before any RBAC runs. - Resource policies — policies targeting the resource (and any collections it matches) are evaluated before RBAC, sorted by priority; a matching
allowordenydecides. Policies can grant access beyond RBAC, and a policydenycan override an ownership grant. - Role-based permissions (RBAC) — resolve the subject’s grants, composed across the scope chain per the request scope’s
permissionMode(defaultoverride= that scope only), apply scope overrides, match action + resource pattern, and evaluate any conditions fail-closed. - Ownership — if RBAC did not grant and a concrete resource is present, an active
owns(subject, resource, role)row grants that owner-role’s matching permissions (also routed through overrides and fail-closed conditions). - Resource hierarchy — still denied? If the resource has ancestors linked with
cascade: 'inherit', a parent resource can grant access.
These are not all strict priority tiers—delegation runs only for on-behalf-of
requests, and the hierarchy fallback runs only when direct RBAC denies and a
concrete resource is present. A resource-policy
deny is the strongest single
signal for locking down a sensitive resource.The Decision Output
Step-by-Step Example
Let’s trace through a real evaluation:Setup
Evaluation Request
Evaluation Trace
Delegation (On Behalf Of)
Agents or services can act on behalf of users:onBehalfOf is provided, delegation is co-authorization, not authority-borrowing:
- An active delegation grant authorizing the actor to act for the principal in this scope must exist—otherwise the request is denied (
NO_DELEGATION_GRANT) before any permission check. - The actor must have the permission (the actor leg).
- The principal (
onBehalfOf) must also have the permission (the principal leg). - The allow is the intersection—both legs must pass, and neither party can exceed the other. See Delegation for how to create grants.
Resource-Based Evaluation
When evaluating against a specific resource:- Look up the resource
- Load its tags (if
includeResourceTagsis true) - Include resource data in the evaluation context
- Evaluate any conditional permissions against this context
Conditional Evaluation
Conditions are attached to the role-permission edge (condition), not to the permission itself, and are evaluated against the context:
Context Variables
The evaluation context includes:The resolved
subject, resource, tags, and tagList overwrite any
same-named keys you pass in context. There is no resource.meta or
resource.ownerId—custom resource data must be supplied via tags or your own
context. See Conditional Permissions for
the full context shape.Effective Permissions
Get all permissions a subject has in a scope. The engine exposeslistEffectivePermissions(subjectId, scopeId) with positional arguments:
Debugging Decisions
The decision includes debugging information:Performance Considerations
Cache membership lookups
Cache membership lookups
Membership and role data changes infrequently. Cache it per-request or with short TTLs.
Prefer effective permissions for many checks
Prefer effective permissions for many checks
When you need many actions for one subject and scope (e.g. rendering a UI), call
listEffectivePermissions(subjectId, scopeId) once instead of many single evaluate calls.Minimize context size
Minimize context size
Only include context data needed for your conditional permissions.
Pre-compute effective permissions
Pre-compute effective permissions
For UI rendering, fetch effective permissions once rather than checking each action individually.
API Reference
Evaluation API
Evaluate permission checks
Scope Overrides
View and manage overrides
Next Steps
User Governance
Apply these concepts to user authorization
Agent Governance
Apply these concepts to AI agent authorization