> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authorize Method • AI Agent SDK

> authorize_method: Central, default-deny authorisation gate for a gateway method.

# authorize\_method

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**protocols**](../modules/protocols) module.

Central, default-deny authorisation gate for a gateway method.

Resolves the required scope from the single source of truth
(:func:`resolve_required_scope`) — so an unclassified/plugin-registered
method is `ADMIN`-only by omission rather than reachable ungated — and
raises :class:`GatewayUnauthorized` when `client_scopes` do not satisfy
it. Dispatch calls this once, centrally, instead of scattering per-endpoint
checks that can drift from the registry.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def authorize_method(method: str, client_scopes: 'Set[OperatorScope]', params: Optional[Dict[str, Any]]) -> None
```

## Parameters

<ParamField query="method" type="str" required={true}>
  No description available.
</ParamField>

<ParamField query="client_scopes" type="'Set[OperatorScope]'" required={true}>
  No description available.
</ParamField>

<ParamField query="params" type="Optional" required={false}>
  No description available.
</ParamField>

## Uses

* `resolve_required_scope`
* `GatewayUnauthorized`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L7329">
  `praisonaiagents/gateway/protocols.py` at line 7329
</Card>
