Skip to main content

Overview

This guide walks you through setting up a complete authorization system with Bedrock. By the end, you’ll have:
  • Scope types defining your organizational hierarchy
  • Scopes representing your organization and teams
  • Roles and permissions for access control
  • A user and an AI agent with appropriate access
  • Resource collections for dynamic grouping
  • Resource policies that restrict AI agents from confidential data
  • Working permission evaluation
Batch Operations: All examples use batch endpoints to minimize API calls. IDs use a namespaced UUIDv7 format (e.g., scope_type_org). You can provide your own IDs for in-batch references.
Credentials. Steps 1–5 are core control-plane operations and require a platform API key; the /evaluate calls in Step 6 require a tenant-scoped service key. Both are sent in the x-api-key: brk_... header (the brk_YOUR_KEY placeholder below). Note: Authorization: Bearer is the Kinde user-JWT path, not the API-key path—an API key in a Bearer header returns 401. See Authentication and Authorization.

Step 1: Set Up Your Hierarchy

Create scope types and their hierarchy relationship in two requests:

Step 2: Create Your Organization Structure

Create scopes and link them in the hierarchy:

Step 3: Define Roles and Permissions

Create permissions and roles, then assign permissions to roles:

Step 4: Add Users and Agents

Create subjects (user and AI agent), memberships, and role assignments:
You now have a user with Editor access and an AI agent with Viewer access to the Engineering team!

Step 5: Add Resources and Policies

Create resources, a collection, and a policy for fine-grained control:

Step 6: Evaluate Permissions

Test your authorization setup:
Done! You’ve set up a complete authorization system with role-based permissions AND resource-level policies that restrict AI agents from accessing confidential documents.

What You Built

Next Steps

Resource Policies

Fine-grained allow/deny on resources

Resource Collections

Dynamic resource grouping

Conditional Permissions

JSON Logic for dynamic access

Agent Governance

Advanced agent permission patterns

Scope Overrides

Fine-tune inherited permissions

API Reference

Explore the complete API