# Decisions

> Build your own enforcement point on the realm's policies, asking the realm for each decision or deciding locally the way the gateway does.

The gateway is one enforcement point; your API, or a proxy you already run, can be another. Either way the realm's
policies decide, and there are two ways to reach them. **Ask the realm** for each decision, and the answer is always
current and can take the caller's groups into account, at the cost of one call per request. Or **decide locally**:
pull the realm's policies and its revocation feed, and decide in process with no call per request, at the cost of
freshness. The gateway does the second, and asks the realm only what a token can't settle.

Whichever you choose, the decision is the same: every enforcement point reads the same policies by the same rules.
Both ways are available today, with or without the gateway.

<CardGrid>
  <LinkCard title="Ask the realm" description="One decision, a batch, or who a decision would allow, in the AuthZEN shape." href="/gateway/decisions/ask-the-realm/" />
  <LinkCard title="Decide locally" description="Pull the policies and the revocation feed, and decide in process." href="/gateway/decisions/decide-locally/" />
</CardGrid>

## Capabilities

### Decide in your own enforcement point

| Capability | What it gives you |
|---|---|
| [Ask the realm](/gateway/decisions/ask-the-realm/) | One decision, or several at once, in the AuthZEN shape (with limits) |
| [Search](/gateway/decisions/ask-the-realm/#search) | Which users or agents a decision would allow, or which actions |
| [Groups read for you](/gateway/decisions/ask-the-realm/#good-to-know) | The realm reads the subject's groups itself when you send none |
| [Decide locally](/gateway/decisions/decide-locally/) | Pull the realm's policies and decide in process, fetching again only on change (with limits) |
| [Revocation feed](/gateway/revocation/revocation-feed/) | Revoked tokens, sessions and principals, so a local decision refuses them too |

Asking the realm has a limit: it answers *who* and *which actions*, never *which resources*. Deciding locally has
one: a decision made locally isn't on the realm's audit trail.

## Guides

- [Check a token at your API](/gateway/guides/check-a-token-at-your-api/)
- [Open an API to agents](/gateway/guides/open-an-api-to-agents/)
