# Authorization

> How a realm says who may do what, what each user, group and agent holds, and when an agent may act for a user.

Authorization is where you write down who may do what in your realm. **Policies** say who may take which action on
which API address, MCP tool or other resource, and when. **Entitlements** say what a user, a group or an agent holds,
and so which scopes and structured permissions their tokens may carry. When an agent acts for a user, both the user's
say-so and the realm's own delegation policies must allow it.

The realm decides; something in front of your API says no. A policy is enforced by the
[gateway](../../gateway/), or by your own API asking the realm, and both read the same policies and reach
the same answer. Who may administer the realm itself is a separate right, kept apart from all of this: see
[delegated administration](../../platform/realms/delegated-administration/).

<CardGrid>
  <LinkCard title="Policies" description="Who may take which action on which resource, and when. One deny refuses." href="./policies/" />
  <LinkCard title="Entitlements" description="What a user, group or agent holds, for a window you set." href="./entitlements/" />
  <LinkCard title="Agents acting for users" description="Whom an agent may act for, until when, and how far." href="../agents/acting-for-users/" />
  <LinkCard title="Open an API to agents" description="Make a policy stick on a real API, start to finish." href="/gateway/guides/open-an-api-to-agents/" />
</CardGrid>

## Capabilities

### Say who may do what

| Capability | What it gives you |
|---|---|
| [Policies](./policies/) | Rules per resource type: who may take which action on which address, deny over allow (with limits) |
| [Policy subjects](./policies/#what-a-policy-says) | A rule for any signed-in caller, named users, agents or groups, or a token claim, combined with and, or, not |
| [Policy conditions](./policies/#what-a-policy-says) | A rule that holds only for a scope, a structured permission, an address range, a time window, or a sign-in of a given strength |
| [Resource matching](./policies/#how-addresses-and-names-match) | Addresses matched segment by segment; tool and object names matched as a pattern |
| [Answers that explain themselves](./policies/#how-a-decision-is-reached) | Every refusal says why: denied, nothing allowed, undecided, or a policy left out |
| [Policy checks on write](./policies/#good-to-know) | A policy that breaks its set's or type's rules is refused when you link it, and left out of decisions if it breaks them later |
| [Test a policy safely](../guides/access-policies/test-a-policy-safely/) | Try a rule in a set nothing enforces, and ask the realm what it would decide; there's no report-only mode |

### Grant what users and agents hold

| Capability | What it gives you |
|---|---|
| [Entitlements](./entitlements/) | What a user, group or agent holds, each grant with an optional window |
| [Governed scopes](./entitlement-scopes/) | A scope an entitlement names is issued only to its holders |
| [Rich authorization requests](./rich-authorization-requests/) | An entitlement bounds the exact actions a token may carry, such as a payment's maximum |
| [Issuance policy](./issuance-policy/) | One policy set asked before every token is issued |

### Let agents act for users

| Capability | What it gives you |
|---|---|
| [Agents acting for users](../agents/acting-for-users/) | An agent acts for a user within a window and a scope ceiling they set |
| [Delegation policies](../agents/acting-for-users/#the-realms-delegation-policies) | The realm's own rules decide every delegation, beside the user's say-so |
| [Acting as a user](../agents/acting-for-users/#acting-as-the-user) | A token that names only the user, where the realm and a policy both allow it |

## Coming next

See [What's next for authorization](./whats-next/):

- [Geolocation conditions](./whats-next/#geolocation-conditions): a rule that holds only for calls from a country or region.
- [Remembered consent to structured permissions](./whats-next/#remembered-consent-to-structured-permissions).
- [Structured permissions through token exchange](./whats-next/#structured-permissions-through-token-exchange).
- [Device trust at sign-in](./whats-next/#device-trust-at-sign-in): require a managed or compliant device.
- [One policy across every service](./whats-next/#one-policy-across-every-service).

## Guides

- [Common access policies](../guides/access-policies/common-access-policies/)
- [Test a policy safely](../guides/access-policies/test-a-policy-safely/)
- [Open an API to agents](/gateway/guides/open-an-api-to-agents/)
- [Protect an MCP server](../../gateway/guides/protect-an-mcp-server/)
- [Let an agent act for a user](../guides/agents/agent-acts-for-a-person/)
- [Have an agent ask its owner](../guides/agents/agent-asks-its-owner/)
