Skip to main content

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:
  1. Reachability gate (when resource-scope gating is enabled) — if a concrete resource is not reachable in the requested scope, deny outright.
  2. Delegation grant (when onBehalfOf is 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.
  3. Resource policies — policies targeting the resource (and any collections it matches) are evaluated before RBAC, sorted by priority; a matching allow or deny decides. Policies can grant access beyond RBAC, and a policy deny can override an ownership grant.
  4. Role-based permissions (RBAC) — resolve the subject’s grants, composed across the scope chain per the request scope’s permissionMode (default override = that scope only), apply scope overrides, match action + resource pattern, and evaluate any conditions fail-closed.
  5. 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).
  6. Resource hierarchy — still denied? If the resource has ancestors linked with cascade: 'inherit', a parent resource can grant access.
When acting on behalf of another subject, the actor leg and the principal leg are each evaluated this way and the results intersected (see Delegation).
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:
When onBehalfOf is provided, delegation is co-authorization, not authority-borrowing:
  1. 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.
  2. The actor must have the permission (the actor leg).
  3. The principal (onBehalfOf) must also have the permission (the principal leg).
  4. 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:
The engine will:
  1. Look up the resource
  2. Load its tags (if includeResourceTags is true)
  3. Include resource data in the evaluation context
  4. 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 exposes listEffectivePermissions(subjectId, scopeId) with positional arguments:

Debugging Decisions

The decision includes debugging information:

Performance Considerations

Membership and role data changes infrequently. Cache it per-request or with short TTLs.
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.
Only include context data needed for your conditional 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