Skip to main content

What is a Subject?

A subject is any entity that can be granted permissions in Bedrock. This includes humans, AI agents, services, and system processes. Bedrock’s unified subject model means you manage all of these with the same APIs and concepts.

Subject Properties

Subject Types

User

Human users authenticated through your identity provider.

Agent

AI agents, LLM-powered assistants, or autonomous workflows.

Service

Backend services, APIs, or microservices that need to perform authorized actions.

API Key

A machine credential acting as its own principal—used when an API key authenticates directly (see authentication) rather than on behalf of a user.
For internal jobs, cron tasks, or platform operations, model them as a service subject.

Memberships

A membership connects a subject to a scope. Without a membership, a subject has no access to a scope.

Membership Properties

A membership alone doesn’t grant permissions—you must also assign roles to the membership.

Role Assignments

After creating a membership, assign roles to grant permissions:

Complete Example: Adding a User

Jane now has Editor permissions in the Engineering scope. (Whether that reaches descendant scopes depends on the scope type’s permissionMode—by default, override, it does not.)

Complete Example: Adding an AI Agent

The agent can now read in Engineering but cannot write.

External IDs

Use externalId to map Bedrock subjects to your existing user/service identifiers:
This allows you to:
  • Sync users from your identity provider
  • Reference subjects by your system’s IDs
  • Avoid storing Bedrock IDs in your application

Subject Metadata

Store custom data on subjects for use in conditional permissions:
Metadata can be used in conditions, which attach to the role-permission edge (condition):

Multiple Memberships

A subject can belong to multiple scopes with different roles:

API Reference

Create Subject

Create a new subject

Create Membership

Add a subject to a scope

Create Role Assignment

Assign a role to a membership

Get by External ID

Look up subjects by external ID

Next Steps

Roles

Learn how roles bundle permissions together